Rev 2028 | Rev 2050 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2028 | Rev 2029 | ||
---|---|---|---|
Line 60... | Line 60... | ||
60 | page_mapping_insert(AS_KERNEL, PAGE1, KA2PA(frame1), PAGE_PRESENT | PAGE_WRITE); |
60 | page_mapping_insert(AS_KERNEL, PAGE1, KA2PA(frame1), PAGE_PRESENT | PAGE_WRITE); |
61 | 61 | ||
62 | printf("Value at virtual address %p is %#x.\n", PAGE0, v0 = *((uint32_t *) PAGE0)); |
62 | printf("Value at virtual address %p is %#x.\n", PAGE0, v0 = *((uint32_t *) PAGE0)); |
63 | printf("Value at virtual address %p is %#x.\n", PAGE1, v1 = *((uint32_t *) PAGE1)); |
63 | printf("Value at virtual address %p is %#x.\n", PAGE1, v1 = *((uint32_t *) PAGE1)); |
64 | 64 | ||
65 | ASSERT(v0 == VALUE0); |
65 | if (v0 != VALUE0) |
- | 66 | return "Value at v0 not equal to VALUE0"; |
|
66 | ASSERT(v1 == VALUE1); |
67 | if (v1 != VALUE1) |
- | 68 | return "Value at v1 not equal to VALUE1"; |
|
67 | 69 | ||
68 | printf("Writing %#x to virtual address %p.\n", 0, PAGE0); |
70 | printf("Writing %#x to virtual address %p.\n", 0, PAGE0); |
69 | *((uint32_t *) PAGE0) = 0; |
71 | *((uint32_t *) PAGE0) = 0; |
70 | printf("Writing %#x to virtual address %p.\n", 0, PAGE1); |
72 | printf("Writing %#x to virtual address %p.\n", 0, PAGE1); |
71 | *((uint32_t *) PAGE1) = 0; |
73 | *((uint32_t *) PAGE1) = 0; |
Line 74... | Line 76... | ||
74 | v1 = *((uint32_t *) PAGE1); |
76 | v1 = *((uint32_t *) PAGE1); |
75 | 77 | ||
76 | printf("Value at virtual address %p is %#x.\n", PAGE0, *((uint32_t *) PAGE0)); |
78 | printf("Value at virtual address %p is %#x.\n", PAGE0, *((uint32_t *) PAGE0)); |
77 | printf("Value at virtual address %p is %#x.\n", PAGE1, *((uint32_t *) PAGE1)); |
79 | printf("Value at virtual address %p is %#x.\n", PAGE1, *((uint32_t *) PAGE1)); |
78 | 80 | ||
79 | ASSERT(v0 == 0); |
81 | if (v0 != 0) |
- | 82 | return "Value at v0 not equal to 0"; |
|
80 | ASSERT(v1 == 0); |
83 | if (v1 != 0) |
- | 84 | return "Value at v1 not equal to 0"; |
|
81 | 85 | ||
82 | return NULL; |
86 | return NULL; |
83 | } |
87 | } |