Rev 3022 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3022 | Rev 4055 | ||
|---|---|---|---|
| Line 37... | Line 37... | ||
| 37 | 37 | ||
| 38 | #include <arch/types.h> |
38 | #include <arch/types.h> |
| 39 | #include <mm/as.h> |
39 | #include <mm/as.h> |
| 40 | #include <memstr.h> |
40 | #include <memstr.h> |
| 41 | 41 | ||
| 42 | /** |
- | |
| 43 | * Macro for computing page color. |
- | |
| 44 | */ |
- | |
| 45 | #define PAGE_COLOR(va) (((va) >> PAGE_WIDTH) & ((1 << PAGE_COLOR_BITS) - 1)) |
- | |
| 46 | - | ||
| 47 | /** Operations to manipulate page mappings. */ |
42 | /** Operations to manipulate page mappings. */ |
| 48 | typedef struct { |
43 | typedef struct { |
| 49 | void (* mapping_insert)(as_t *as, uintptr_t page, uintptr_t frame, |
44 | void (* mapping_insert)(as_t *as, uintptr_t page, uintptr_t frame, |
| 50 | int flags); |
45 | int flags); |
| 51 | void (* mapping_remove)(as_t *as, uintptr_t page); |
46 | void (* mapping_remove)(as_t *as, uintptr_t page); |
| 52 | pte_t *(* mapping_find)(as_t *as, uintptr_t page); |
47 | pte_t *(* mapping_find)(as_t *as, uintptr_t page); |
| 53 | } page_mapping_operations_t; |
48 | } page_mapping_operations_t; |
| 54 | 49 | ||
| 55 | extern page_mapping_operations_t *page_mapping_operations; |
50 | extern page_mapping_operations_t *page_mapping_operations; |
| Line 62... | Line 57... | ||
| 62 | extern void page_mapping_remove(as_t *as, uintptr_t page); |
57 | extern void page_mapping_remove(as_t *as, uintptr_t page); |
| 63 | extern pte_t *page_mapping_find(as_t *as, uintptr_t page); |
58 | extern pte_t *page_mapping_find(as_t *as, uintptr_t page); |
| 64 | extern pte_t *page_table_create(int flags); |
59 | extern pte_t *page_table_create(int flags); |
| 65 | extern void page_table_destroy(pte_t *page_table); |
60 | extern void page_table_destroy(pte_t *page_table); |
| 66 | extern void map_structure(uintptr_t s, size_t size); |
61 | extern void map_structure(uintptr_t s, size_t size); |
| - | 62 | ||
| 67 | extern uintptr_t hw_map(uintptr_t physaddr, size_t size); |
63 | extern uintptr_t hw_map(uintptr_t physaddr, size_t size); |
| 68 | 64 | ||
| 69 | #endif |
65 | #endif |
| 70 | 66 | ||
| 71 | /** @} |
67 | /** @} |