Rev 826 | Rev 965 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 826 | Rev 955 | ||
---|---|---|---|
Line 30... | Line 30... | ||
30 | #define __PAGE_H__ |
30 | #define __PAGE_H__ |
31 | 31 | ||
32 | #include <arch/mm/asid.h> |
32 | #include <arch/mm/asid.h> |
33 | #include <arch/types.h> |
33 | #include <arch/types.h> |
34 | #include <typedefs.h> |
34 | #include <typedefs.h> |
- | 35 | #include <memstr.h> |
|
35 | 36 | ||
36 | #define PAGE_CACHEABLE_SHIFT 0 |
37 | #define PAGE_CACHEABLE_SHIFT 0 |
37 | #define PAGE_NOT_CACHEABLE_SHIFT PAGE_CACHEABLE_SHIFT |
38 | #define PAGE_NOT_CACHEABLE_SHIFT PAGE_CACHEABLE_SHIFT |
38 | #define PAGE_PRESENT_SHIFT 1 |
39 | #define PAGE_PRESENT_SHIFT 1 |
39 | #define PAGE_NOT_PRESENT_SHIFT PAGE_PRESENT_SHIFT |
40 | #define PAGE_NOT_PRESENT_SHIFT PAGE_PRESENT_SHIFT |
Line 57... | Line 58... | ||
57 | #define PAGE_WRITE (1<<PAGE_WRITE_SHIFT) |
58 | #define PAGE_WRITE (1<<PAGE_WRITE_SHIFT) |
58 | #define PAGE_EXEC (1<<PAGE_EXEC_SHIFT) |
59 | #define PAGE_EXEC (1<<PAGE_EXEC_SHIFT) |
59 | 60 | ||
60 | #define PAGE_GLOBAL (1<<PAGE_GLOBAL_SHIFT) |
61 | #define PAGE_GLOBAL (1<<PAGE_GLOBAL_SHIFT) |
61 | 62 | ||
- | 63 | ||
- | 64 | /* TODO - check that userspace is OK, platform specific functions etc */ |
|
- | 65 | static inline void copy_to_uspace(void *dst, void *src, count_t cnt) |
|
- | 66 | { |
|
- | 67 | memcpy(dst, src, cnt); |
|
- | 68 | } |
|
- | 69 | ||
- | 70 | static inline void copy_to_kernel(void *dst, void *src, count_t cnt) |
|
- | 71 | { |
|
- | 72 | memcpy(dst, src, cnt); |
|
- | 73 | } |
|
- | 74 | ||
62 | /** Operations to manipulate page mappings. */ |
75 | /** Operations to manipulate page mappings. */ |
63 | struct page_mapping_operations { |
76 | struct page_mapping_operations { |
64 | void (* mapping_insert)(as_t *as, __address page, __address frame, int flags); |
77 | void (* mapping_insert)(as_t *as, __address page, __address frame, int flags); |
65 | void (* mapping_remove)(as_t *as, __address page); |
78 | void (* mapping_remove)(as_t *as, __address page); |
66 | pte_t *(* mapping_find)(as_t *as, __address page); |
79 | pte_t *(* mapping_find)(as_t *as, __address page); |