Changes in kernel/test/mm/mapping1.c [5df1963:e2a0d76] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/test/mm/mapping1.c
r5df1963 re2a0d76 41 41 const char *test_mapping1(void) 42 42 { 43 uintptr_t frame = frame_alloc(1, FRAME_NONE, 0); 43 uintptr_t page0, page1; 44 uint32_t v; 44 45 45 uintptr_t page0 = km_map(frame, FRAME_SIZE, 46 uintptr_t frame = frame_alloc(ONE_FRAME, FRAME_NONE, 0); 47 48 page0 = km_map(frame, FRAME_SIZE, 46 49 PAGE_READ | PAGE_WRITE | PAGE_CACHEABLE); 47 50 TPRINTF("Virtual address %p mapped to physical address %p.\n", 48 51 (void *) page0, (void *) frame); 49 50 uintptr_t page1 = km_map(frame, FRAME_SIZE, 52 page1 = km_map(frame, FRAME_SIZE, 51 53 PAGE_READ | PAGE_WRITE | PAGE_CACHEABLE); 52 54 TPRINTF("Virtual address %p mapped to physical address %p.\n", … … 60 62 TPRINTF("Reading magic using the second virtual address.\n"); 61 63 62 uint32_tv = *((uint32_t *) page1);64 v = *((uint32_t *) page1); 63 65 64 66 if (v != TEST_MAGIC) { 65 67 km_unmap(page0, PAGE_SIZE); 66 68 km_unmap(page1, PAGE_SIZE); 67 frame_free(frame , 1);69 frame_free(frame); 68 70 return "Criss-cross read does not match the value written."; 69 71 } … … 80 82 km_unmap(page0, PAGE_SIZE); 81 83 km_unmap(page1, PAGE_SIZE); 82 frame_free(frame , 1);84 frame_free(frame); 83 85 return "Criss-cross read does not match the value written."; 84 86 } … … 87 89 km_unmap(page0, PAGE_SIZE); 88 90 km_unmap(page1, PAGE_SIZE); 89 frame_free(frame , 1);91 frame_free(frame); 90 92 91 93 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.