Rev 2071 | Rev 2105 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2071 | Rev 2089 | ||
---|---|---|---|
Line 44... | Line 44... | ||
44 | 44 | ||
45 | #ifdef KERNEL |
45 | #ifdef KERNEL |
46 | 46 | ||
47 | #ifndef __ASM__ |
47 | #ifndef __ASM__ |
48 | 48 | ||
49 | #include <mm/page.h> |
49 | //#include <arch/types.h> |
50 | #include <arch/types.h> |
50 | //#include <genarch/mm/page_ht.h> |
51 | #include <genarch/mm/page_ht.h> |
51 | #include <arch/interrupt.h> |
52 | 52 | ||
53 | extern uintptr_t physmem_base; |
53 | extern uintptr_t physmem_base; |
54 | 54 | ||
55 | #define KA2PA(x) (((uintptr_t) (x)) + physmem_base) |
55 | #define KA2PA(x) (((uintptr_t) (x)) + physmem_base) |
56 | #define PA2KA(x) (((uintptr_t) (x)) - physmem_base) |
56 | #define PA2KA(x) (((uintptr_t) (x)) - physmem_base) |
57 | 57 | ||
58 | union page_address { |
58 | typedef union { |
59 | uintptr_t address; |
59 | uintptr_t address; |
60 | struct { |
60 | struct { |
61 | uint64_t vpn : 51; /**< Virtual Page Number. */ |
61 | uint64_t vpn : 51; /**< Virtual Page Number. */ |
62 | unsigned offset : 13; /**< Offset. */ |
62 | unsigned offset : 13; /**< Offset. */ |
63 | } __attribute__ ((packed)); |
63 | } __attribute__ ((packed)); |
64 | }; |
- | |
65 | - | ||
66 | typedef union page_address page_address_t; |
64 | } page_address_t; |
67 | 65 | ||
68 | extern void page_arch_init(void); |
66 | extern void page_arch_init(void); |
69 | 67 | ||
70 | #endif /* !def __ASM__ */ |
68 | #endif /* !def __ASM__ */ |
71 | 69 |