00001 #ifndef mmg_routines_h
00002 #define mmg_routines_h
00003
00004 typedef unsigned long long uint64;
00005
00006 #include <acbdef.h>
00007 #if 0
00008
00009 #include <boddef.h>
00010 #endif
00011 #include <ccbdef.h>
00012 #include <far_pointers.h>
00013 #include <gsddef.h>
00014 #if 0
00015 #include <hwrpbdef.h>
00016 #include <ints.h>
00017 #endif
00018 #include <pcbdef.h>
00019 #include <pfndef.h>
00020 #include <phddef.h>
00021 #include <ptedef.h>
00022 #include <rdedef.h>
00023 #if 0
00024 #include <rmddef.h>
00025 #endif
00026 #include <secdef.h>
00027 #include <wsldef.h>
00028
00029 void mmg_std_add_pt_win_cnt (VOID_PQ va, PTE_PQ va_pte, int win_count);
00030 int mmg_std_alloc_pfn_64 (PFN_PPQ pfndbe_p);
00031 int mmg_alloc_pfn_algnd_64 (uint64 vpn, PFN_PPQ pfndbe_p);
00032 int mmg_std_alloc_zero_pfn_64 (PFN_PPQ pfndbe_p);
00033 int mmg_alloc_zero_algnd_64 (uint64 vpn, PFN_PPQ pfndbe_p);
00034 int mmg_std_allo_contig (uint32 pfn_count);
00035 int mmg_std_allo_contig_pfn (uint32 pfn_count, uint32 max_pfn);
00036
00037 int mmg_std_allo_contig_a (uint32 pfn_count, uint32 byte_align);
00038 int mmg_std_allo_contig_pfn_a (uint32 pfn_count, uint32 byte_align, uint32 max_pfn);
00039 #ifndef MMG_STD_ALLOC_CTG_PFN_MAP_SVA_SRC
00040 int mmg_std_alloc_ctg_pfn_map_sva (
00041 const int proto_pte,
00042 const int page_count,
00043 const uint32 refcnt,
00044 VOID_PQ sva,
00045 const uint32 max_pfn,
00046 ...
00047
00048 );
00049 #endif
00050 void mmg_std_dalloc_contig_pfn (uint32 pfn, uint32 pfn_count);
00051 void mmg_std_dalloc_pfn_64 (int pfn, PFN_PQ pfndbe);
00052 void mmg_std_dalloc_zero_pfn_64 (int pfn, PFN_PQ pfndbe);
00053 void mmg_std_del_contents_pfn_64 (int pfn, PFN_PQ pfndbe);
00054 int mmg_std_alloc_gpt (const int req_pages, PTE_PPQ gpte_p);
00055 int mmg_std_dealloc_gpt (const int page_count, const PTE_PQ gpte);
00056 void mmg_std_decptref_pfndb (PFN_PQ const pfndbe);
00057 void mmg_std_deref_bufobj (int32 object_handle_1, int32 object_handle_2);
00058 int mmg_std_iolock_buf (VOID_PQ const buf, const int bufsiz,
00059 const int is_read, struct _pcb *const pcb,
00060 PTE_PPQ va_pte_p, VOID_PPQ fault_va_p);
00061 void mmg_std_iounlock_buf (const int npages, PTE_PQ const va_pte);
00062 void mmg_std_lockpgtb_64 (PTE_PQ const va_pte, struct _phd *const phd);
00063 void mmg_std_svaptechk (VOID_PQ va, struct _pcb *pcb, struct _phd *phd, struct _pte **svapte_p);
00064 void mmg_tbi_all (void);
00065 int mmg_std_ref_bufobj (int32 object_handle_1, int32 object_handle_2, ...);
00066 void mmg_tbi_single (VOID_PQ va);
00067 void mmg_tbi_single_threads (VOID_PQ va);
00068 void mmg_std_tbi_data_64 (VOID_PQ va);
00069 void mmg_std_tbi_data_64_threads (VOID_PQ va);
00070
00071 int mmg_std_delpag_64 (struct _rde *rde, VOID_PPQ start_va_p, uint64 *pages_1,
00072 int acmode, int *mmg_flags);
00073 void mmg_std_delete_pts (VOID_PQ start_va, VOID_PQ end_va);
00074 void mmg_std_delete_private_l3pt (PTE_PQ l3pt_va, struct _pcb *pcb, struct _phd *phd);
00075 void mmg_std_check_contract_64_1 (struct _rde *rde, struct _phd *phd, VOID_PQ start_va);
00076 void mmg_std_check_contract_64 (struct _rde *rde, struct _phd *phd, VOID_PQ start_va,
00077 VOID_PQ end_va);
00078 int mmg_std_try_all_64(struct _rde *rde, VOID_PQ start_va, VOID_PQ end_va,
00079 uint64 expbytes, uint64 pages, int *pagefile_cache_p,
00080 int *mmg_flags_p);
00081 void mmg_std_fast_create_64(struct _rde *rde, VOID_PQ start_va, VOID_PQ end_va,
00082 uint64 pages, struct _pte prot_pte);
00083 int mmg_std_crepag_64(struct _rde *rde, VOID_PPQ va_p, uint64 *pages_1, int max_mode,
00084 struct _pte proto_pte, int *pagefile_cache_p, int *mmg_flags_p);
00085 int mmg_std_create_shpt_mapping_64 (struct _rde *rde, VOID_PPQ va_p, uint64 *pages_1, int max_mode,
00086 struct _pte proto_pte, int *mmg_flags_p);
00087 int mmg_std_check_window_64(int channel, struct _ccb **ccb_p, int *efblk_p);
00088
00089 #ifdef __NEW_STARLET
00090 int mmg_std_init_pste_64(struct _ccb *ccb, uint64 *pagelets_p, int section_flags,
00091 uint64 start_vbn, int pfc_pagelets, int *efblk_p, struct _secdef **pste_p,
00092 int *pstx_p);
00093 int mmg_std_gfile_gste_64(struct _gsd *gsd, struct _ccb *ccb, uint64 *pagelets_p,
00094 int section_flags, uint64 start_vbn, int pfc_pagelets, int *efblk_p,
00095 struct _secdef **gste_p, unsigned int *gstx_p);
00096 int mmg_std_gdzro_gste_64(struct _gsd *gsd, uint64 *pagelets_p, int section_flags,
00097 struct _secdef **gste_p, unsigned int *gstx_p);
00098 int mmg_std_setsecprotown_64(struct _pte *proto_pte_p, int section_flags, int acmode,
00099 struct _secdef *section_table_entry_p, struct _gsd *gsd);
00100 int mmg_std_chkpro_audit(struct _gsd *gsd, struct _secdef *gste, int section_flags,
00101 int status, int callers_mode);
00102 int mmg_std_global_fast_map_64(VOID_PQ start_va, VOID_PQ end_va, uint64 pages,
00103 struct _pte proto_pte, struct _secdef *gste);
00104 #endif
00105
00106 int mmg_std_sec_fast_create_64 (struct _rde *rde, VOID_PQ start_va, VOID_PQ end_va,
00107 uint64 pages, struct _pte proto_pte, int mmg_flags);
00108 void mmg_std_set_gh_and_fastmap_64 (VOID_PQ start_va, VOID_PQ end_va,
00109 uint64 pages, struct _pte proto_pte);
00110 int mmg_std_init_orb(struct _gsd *gsd, struct _ccb *ccb, int prot);
00111 void mmg_std_dalcstxscn(struct _phd *phd);
00112 void mmg_std_subsecrefl(int refcnt, int index, struct _phd *phd);
00113 int mmg_std_derive_granhint_64(struct _rde *rde, VOID_PPQ start_va_p,
00114 VOID_PPQ end_va_p, uint64 page_count, struct _pte proto_pte,
00115 int *mmg_flags_p);
00116 void mmg_std_fastmap_with_gh_64(VOID_PQ start_va, VOID_PQ end_va,
00117 uint64 page_count, struct _pte proto_pte);
00118 void mmg_std_set_gh_and_fastmap_64(VOID_PQ start_va, VOID_PQ end_va,
00119 uint64 page_count, struct _pte proto_pte);
00120 void mmg_std_perform_audit(struct _gsd *gsd, int status);
00121 void mmg_std_delgblwcb(struct _pcb *pcb);
00122 void mmg_std_movgsdnam(char *dest_p, char *source_p, struct _gsd *gsd);
00123 int mmg_std_sec_privchk(char *gs_string_p, int flags);
00124 int mmg_std_lckulkpag(VOID_PQ start_va, int acmode, int flags, struct _pcb *pcb,
00125 struct _phd *phd, struct _wsl * wsl);
00126 void mmg_std_purgwspag_64(VOID_PQ start_va, int acmode, uint64 pages_1,
00127 int page_inc);
00128 int mmg_std_lckbufobjpag(VOID_PQ start_va, int acmode, int page_inc,
00129 struct _bod *bod, PTE_PPQ va_pte_p);
00130 void mmg_std_delbufobjpages(struct _bod *bod, struct _pcb *pcb);
00131 int mmg_std_setprtpag_64(struct _rde *rde, VOID_PQ start_va, int acmode,
00132 int alpha_prot, int *prev_prot_p);
00133 int mmg_std_setfltpag_64(struct _rde *rde, VOID_PQ start_va, int acmode,
00134 int fault_mask);
00135 int mmg_std_has_priv_pswapm(struct _pcb *pcb);
00136 void mmg_std_addprcpgfl(int pages, struct _phd *phd);
00137 void mmg_std_lock_gpt_64(PTE_PQ gpte, struct _phd *sys_phd,...);
00138 int mmg_std_gsdscan(VOID_PQ input_gsnam,
00139 UINT64_PQ input_ident, int section_flags, char *return_gsnam,
00140 uint64 *return_ident, struct _gsd **gsd);
00141 int mmg_alloc_sva_map (int proto_pte, int page_count, int refcnt,
00142 struct _pte ** ret_svapte, void ** ret_sva, int *ret_pfn);
00143 int mmg_alloc_pfn_map_sva (int proto_pte, int page_count, int refcnt,
00144 struct _pte * svapte, void ** ret_sva, int *ret_pfn);
00145
00146 #ifndef MMG_STD_ALLOC_SYSTEM_VA_MAP_SRC
00147 int mmg_std_alloc_system_va_map (const int proto_pte, const int page_count,
00148 const uint32 refcnt, const uint32 system_region, VOID_PPQ sva, ...);
00149 #endif
00150
00151 #ifndef MMG_STD_ALLOC_PFN_MAP_SYSTEM_VA_SRC
00152 int mmg_std_alloc_pfn_map_system_va (const int proto_pte, const int page_count,
00153 const uint32 refcnt, VOID_PQ sva, ...);
00154 #endif
00155
00156 int mmg_std_dealloc_sva (int page_count, VOID_PQ sva);
00157
00158 int mmg_std_get_pte_for_va (VOID_PQ const va, struct _phd *const phd, PTE_PQ pte_p);
00159 void mmg_std_rem_pfn_64 (int pfn, int list, PFN_PQ pfndbe_p);
00160 void mmg_std_ins_pfnh_64 (int pfn, int list, PFN_PQ pfndbe_p);
00161
00162 int mmg_std_use_res_mem (uint32 page_count, uint32 char_count, char *name, uint32 flags, uint32 group,
00163 uint32 *return_pfn, uint32 *reserved_pages);
00164 int mmg_std_free_res_mem (uint32 char_count, char *name, uint32 flags, uint32 group, uint32 *freed_pages);
00165 int mmg_std_return_res_mem (uint32 page_count, uint32 char_count, char *name, uint32 flags, uint32 group, ...);
00166 int mmg_std_copy_rmd (uint32 rmd_count, uint32 char_count, char *name, uint32 flags, uint32 group, struct _rmd *copy_address);
00167 int mmg_test_page(uint32 *pfn_count_p);
00168 int mmg_std_rem_pfnh_64(int list, PFN_PPQ pfndbe_p);
00169 void mmg_compute_mem_checksum(struct _pmreg *pmr, int32 bitmap_size, uint32 flag);
00170
00171 int mmg_std_map_pfns_gh (uint32 first_pfn, uint32 pfn_count, uint32 protection, VOID_PQ sva);
00172 int mmg_std_alloc_map_pfns (uint32 pfn_count, uint32 protection, VOID_PQ sva);
00173
00174 int mmg_std_establish_freepte_list (PTELIST_PQ pte_list, VOID_PQ sva, uint64 pte_count);
00175 int mmg_std_insque_free_pte (PTELIST_PQ pte_list, VOID_PQ sva, uint64 pte_count);
00176 int mmg_std_remque_free_pte (PTELIST_PQ pte_list, uint64 pte_count);
00177 int mmg_std_establish_freepfn_list (uint32 count, void (*callback_routine)(PRVPFN_PQ pfn_list), uint32 priority, PRVPFN_PPQ prvpfn, UINT32_PQ return_count);
00178 int mmg_std_insque_free_pfn (PRVPFN_PQ pfn_list, uint32 count, UINT32_PQ return_count);
00179 int mmg_std_remque_free_pfn (PRVPFN_PQ pfn_list, uint32 count);
00180 int mmg_std_map_from_lists (PTELIST_PQ pte_list, PRVPFN_PQ prvpfn, uint32 protection, VOID_PPQ sva);
00181 int mmg_std_unmap_to_lists (VOID_PQ sva, PTELIST_PQ pte_list, PRVPFN_PQ prvpfn);
00182
00183 int mmg_pfncheck (uint32 pfn, UINT32_PQ which_list);
00184 int mmg_pfncheck_range (uint32 pfn, uint32 page_count);
00185 int mmg_ptecheckw_process (void);
00186 int mmg_ptecheckw_system (void);
00187 void mmg_ptecheckw_process_ast(struct _pcb *pcb, struct _acb *acb);
00188
00189 int mmg_mem_config_info (UINT32_PQ max_mem_desc_nodes_p, UINT32_PQ max_frag_per_node_p);
00190
00191 int mmg_mem_config_pfn (uint32 pfn, INT_PQ page_type_p, UINT64_PQ part_id_p, UINT64_PQ comm_id_p);
00192
00193 int mmg_alloc_pfn_color_64 (uint32 flags, uint64 vpn, uint32 rad, PFN_PPQ pfndbe_p);
00194 int mmg_alloc_zero_color_64 (uint32 flags, uint64 vpn, uint32 rad, PFN_PPQ pfndbe_p);
00195 int mmg_alloc_contig_color_a (uint32 pfn_count, uint32 flags, uint32 byte_align, uint32 rad, UINT32_PQ largest_chunk_p);
00196
00197 int mmg_va_to_rad (VOID_PQ va, UINT32_PQ rad_p);
00198
00199 int mmg_relpfn(signed int pfn);
00200 int mmg_incptref(struct _phd * phd, struct _mypte * pte);
00201 int mmg_decptref(struct _phd * phd, struct _mypte * pte);
00202 int mmg_makewsle(struct _pcb * p, struct _phd * phd, void * va, void * pte, signed int pfn);
00203 int mmg_frewsle(struct _pcb * p, void * va);
00204 int mmg_frewslx(struct _pcb * p, void * va,unsigned long * pte, unsigned long index);
00205 int mmg_allocpagfil1(int size, int * page);
00206 int mmg_dallocpagfil1(int page);
00207 int mmg_delpag(int acmode, void * va, struct _pcb * p, signed int pagedirection, struct _rde * rde, unsigned long newpte);
00208 int mmg_crepag (int acmode, void * va, struct _pcb * p, signed int pagedirection, struct _rde * rde, unsigned long newpte);
00209 int mmg_credel(int acmode, void * first, void * last, void (* pagesubr)(), struct _va_range *inadr, struct _va_range *retadr, unsigned int acmodeagain, struct _pcb * p, int numpages);
00210 int mmg_crepag (int acmode, void * va, struct _pcb * p, signed int pagedirection, struct _rde * rde, unsigned long newpte);
00211 int mmg_fast_create(struct _pcb * p, struct _rde *rde, void * start_va, void * end_va, unsigned long pages, unsigned long prot_pte);
00212 int mmg_fast_create_gptx(struct _pcb * p, struct _rde *rde, void * start_va, void * end_va, unsigned long pages, unsigned long prot_pte);
00213 int mmg_vfysecflg(void);
00214 int mmg_purgwsscn(int acmode, void * va, struct _pcb * p, signed int pagedirection, struct _rde * rde, unsigned long newpte);
00215 int mmg_purgwspag (int acmode, void * va, struct _pcb * p, signed int pagedirection, struct _rde * rde, unsigned long newpte);
00216 signed long mmg_allocpfn(void);
00217 #ifdef __x86_64__
00218 signed long mmg_rempfn(unsigned long type, int pfn);
00219 #else
00220 signed long mmg_rempfn(unsigned long type, struct _pfn * pfn);
00221 #endif
00222 mmg_delwslx(struct _pcb * pcb, struct _phd * phd, int index,int pte);
00223 mmg_delpfnlst(int type, int pfn);
00224 mmg_dalcstxscn(void);
00225 mmg_gsdscn(void * input_gsnam, unsigned long long * input_ident, int section_flags, char *return_gsnam, unsigned long long *return_ident, struct _gsd **gsd);
00226 mmg_imgreset();
00227 void mmg_purgempl(unsigned long command);
00228 void mmg_wrtmfypag(void);
00229 signed int mmg_ininewpfn(struct _pcb * p, struct _phd * phd, void * va, struct _mypte * pte);
00230 signed long mmg_dallocpfn(struct _pfn * pageframe);
00231 signed long mmg_allocontig(unsigned long num);
00232 signed long mmg_allocontig_align(unsigned long num);
00233 signed long mmg_allocontig_align(unsigned long num);
00234 signed long mmg_inspfnt(unsigned long type, struct _pfn * pfn);
00235 #ifdef __i386__
00236 signed long mmg_inspfn(unsigned long type, struct _pfn * pfn, struct _pfn * list);
00237 #else
00238 signed long mmg_inspfn(unsigned long type, int pfn, int list);
00239 #endif
00240 signed long mmg_inspfnh(unsigned long type, struct _pfn * pfn);
00241 mmg_delconpfn(struct _pcb * p, int pfn);
00242
00243 #include <linux/linkage.h>
00244
00245 asmlinkage int exe_mgblsc(struct _va_range *inadr, struct _va_range *retadr, unsigned int acmode, unsigned int flags, void *gsdnam, struct _secid *ident, unsigned int relpag);
00246 #if 0
00247 asmlinkage int exe_crmpsc(struct _va_range *inadr, struct _va_range *retadr, unsigned int acmode, unsigned int flags, void *gsdnam, unsigned long long * ident, unsigned int relpag, unsigned int chan, unsigned int pagcnt, unsigned int vbn, unsigned int prot,unsigned int pfc);
00248 #endif
00249
00250 #endif
00251