Changes in kernel/test/mm/mapping1.c [cb01e1e:7e752b2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/test/mm/mapping1.c
rcb01e1e r7e752b2 33 33 #include <mm/as.h> 34 34 #include <arch/mm/page.h> 35 #include < arch/types.h>35 #include <typedefs.h> 36 36 #include <debug.h> 37 37 … … 39 39 #define PAGE1 (PAGE0 + PAGE_SIZE) 40 40 41 #define VALUE0 0x0123456742 #define VALUE1 0x89abcdef41 #define VALUE0 UINT32_C(0x01234567) 42 #define VALUE1 UINT32_C(0x89abcdef) 43 43 44 c har *test_mapping1(void)44 const char *test_mapping1(void) 45 45 { 46 46 uintptr_t frame0, frame1; … … 50 50 frame1 = (uintptr_t) frame_alloc(ONE_FRAME, FRAME_KA); 51 51 52 TPRINTF("Writing %#x to physical address %p.\n", VALUE0, KA2PA(frame0)); 52 TPRINTF("Writing %#" PRIx32 " to physical address %p.\n", 53 (uint32_t) VALUE0, (void *) KA2PA(frame0)); 53 54 *((uint32_t *) frame0) = VALUE0; 54 55 55 TPRINTF("Writing %#x to physical address %p.\n", VALUE1, KA2PA(frame1)); 56 TPRINTF("Writing %#" PRIx32 " to physical address %p.\n", 57 (uint32_t) VALUE1, (void *) KA2PA(frame1)); 56 58 *((uint32_t *) frame1) = VALUE1; 57 59 58 TPRINTF("Mapping virtual address %p to physical address %p.\n", PAGE0, KA2PA(frame0)); 60 TPRINTF("Mapping virtual address %p to physical address %p.\n", 61 (void *) PAGE0, (void *) KA2PA(frame0)); 59 62 page_mapping_insert(AS_KERNEL, PAGE0, KA2PA(frame0), PAGE_PRESENT | PAGE_WRITE); 60 63 61 TPRINTF("Mapping virtual address %p to physical address %p.\n", PAGE1, KA2PA(frame1)); 64 TPRINTF("Mapping virtual address %p to physical address %p.\n", 65 (void *) PAGE1, (void *) KA2PA(frame1)); 62 66 page_mapping_insert(AS_KERNEL, PAGE1, KA2PA(frame1), PAGE_PRESENT | PAGE_WRITE); 63 67 64 68 v0 = *((uint32_t *) PAGE0); 65 69 v1 = *((uint32_t *) PAGE1); 66 TPRINTF("Value at virtual address %p is %#x.\n", PAGE0, v0); 67 TPRINTF("Value at virtual address %p is %#x.\n", PAGE1, v1); 70 TPRINTF("Value at virtual address %p is %#" PRIx32 ".\n", 71 (void *) PAGE0, v0); 72 TPRINTF("Value at virtual address %p is %#" PRIx32 ".\n", 73 (void *) PAGE1, v1); 68 74 69 75 if (v0 != VALUE0) … … 72 78 return "Value at v1 not equal to VALUE1"; 73 79 74 TPRINTF("Writing %#x to virtual address %p.\n", 0, PAGE0); 80 TPRINTF("Writing %#" PRIx32 " to virtual address %p.\n", 81 (uint32_t) 0, (void *) PAGE0); 75 82 *((uint32_t *) PAGE0) = 0; 76 83 77 TPRINTF("Writing %#x to virtual address %p.\n", 0, PAGE1); 84 TPRINTF("Writing %#" PRIx32 " to virtual address %p.\n", 85 (uint32_t) 0, (void *) PAGE1); 78 86 *((uint32_t *) PAGE1) = 0; 79 87 … … 81 89 v1 = *((uint32_t *) PAGE1); 82 90 83 TPRINTF("Value at virtual address %p is %#x.\n", PAGE0, *((uint32_t *) PAGE0)); 84 TPRINTF("Value at virtual address %p is %#x.\n", PAGE1, *((uint32_t *) PAGE1)); 91 TPRINTF("Value at virtual address %p is %#" PRIx32 ".\n", 92 (void *) PAGE0, *((uint32_t *) PAGE0)); 93 TPRINTF("Value at virtual address %p is %#" PRIx32 ".\n", 94 (void *) PAGE1, *((uint32_t *) PAGE1)); 85 95 86 96 if (v0 != 0)
Note:
See TracChangeset
for help on using the changeset viewer.