Changes in kernel/generic/include/mm/as.h [ca21f1e2:84176f3] in mainline
- File:
-
- 1 edited
-
kernel/generic/include/mm/as.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/mm/as.h
rca21f1e2 r84176f3 45 45 #include <synch/mutex.h> 46 46 #include <adt/list.h> 47 #include <adt/btree.h>48 47 #include <adt/odict.h> 49 48 #include <lib/elf.h> … … 59 58 */ 60 59 #define KERNEL_ADDRESS_SPACE_SHADOWED KERNEL_ADDRESS_SPACE_SHADOWED_ARCH 60 61 /** 62 * Defined to be true if user address space and kernel address space do not 63 * share the same page table. 64 */ 65 #define KERNEL_SEPARATE_PTL0 KERNEL_SEPARATE_PTL0_ARCH 61 66 62 67 #define KERNEL_ADDRESS_SPACE_START KERNEL_ADDRESS_SPACE_START_ARCH … … 137 142 } as_operations_t; 138 143 144 /** Single anonymous page mapping. */ 145 typedef struct { 146 /** Containing pagemap structure */ 147 struct as_pagemap *pagemap; 148 /** Link to @c shinfo->pagemap ordered dictionary */ 149 odlink_t lpagemap; 150 /** Virtual address */ 151 uintptr_t vaddr; 152 /** Physical frame address */ 153 uintptr_t frame; 154 } as_page_mapping_t; 155 156 /** Map of anonymous pages in a shared area. */ 157 typedef struct as_pagemap { 158 /** 159 * Dictionary ordered by virtual address. Members are of type 160 * as_page_mapping_t 161 */ 162 odict_t map; 163 } as_pagemap_t; 164 165 /** Used space interval */ 166 typedef struct { 167 /** Containing used_space structure */ 168 struct used_space *used_space; 169 /** Link to @c used_space->ivals */ 170 odlink_t lused_space; 171 /** First page address */ 172 uintptr_t page; 173 /** Count of pages */ 174 size_t count; 175 } used_space_ival_t; 176 177 /** Map of used space in an address space area */ 178 typedef struct used_space { 179 /** 180 * Dictionary of intervals by start address. 181 * Members are of type @c used_space_ival_t. 182 */ 183 odict_t ivals; 184 /** Total number of used pages. */ 185 size_t pages; 186 } used_space_t; 187 139 188 /** 140 189 * This structure contains information associated with the shared address space … … 150 199 bool shared; 151 200 152 /** 153 * B+tree containing complete map of anonymous pages of the shared area. 154 */ 155 btree_t pagemap; 201 /** Complete map of anonymous pages of the shared area. */ 202 as_pagemap_t pagemap; 156 203 157 204 /** Address space area backend. */ … … 221 268 size_t pages; 222 269 223 /** Number of resident pages in the area. */224 size_t resident;225 226 270 /** Base address of this area. */ 227 271 uintptr_t base; 228 272 229 273 /** Map of used space. */ 230 btree_t used_space;274 used_space_t used_space; 231 275 232 276 /** … … 283 327 extern as_area_t *as_area_next(as_area_t *); 284 328 329 extern void as_pagemap_initialize(as_pagemap_t *); 330 extern void as_pagemap_finalize(as_pagemap_t *); 331 extern as_page_mapping_t *as_pagemap_first(as_pagemap_t *); 332 extern as_page_mapping_t *as_pagemap_next(as_page_mapping_t *); 333 extern errno_t as_pagemap_find(as_pagemap_t *, uintptr_t, uintptr_t *); 334 extern void as_pagemap_insert(as_pagemap_t *, uintptr_t, uintptr_t); 335 extern void as_pagemap_remove(as_page_mapping_t *); 336 285 337 extern unsigned int as_area_get_flags(as_area_t *); 286 338 extern bool as_area_check_access(as_area_t *, pf_access_t); 287 339 extern size_t as_area_get_size(uintptr_t); 288 extern bool used_space_insert(as_area_t *, uintptr_t, size_t); 289 extern bool used_space_remove(as_area_t *, uintptr_t, size_t); 340 extern used_space_ival_t *used_space_first(used_space_t *); 341 extern used_space_ival_t *used_space_next(used_space_ival_t *); 342 extern used_space_ival_t *used_space_find_gteq(used_space_t *, uintptr_t); 343 extern bool used_space_insert(used_space_t *, uintptr_t, size_t); 290 344 291 345 /* Interface to be implemented by architectures. */
Note:
See TracChangeset
for help on using the changeset viewer.
