Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/test/mm/mapping1.c

    r5df1963 re2a0d76  
    4141const char *test_mapping1(void)
    4242{
    43         uintptr_t frame = frame_alloc(1, FRAME_NONE, 0);
     43        uintptr_t page0, page1;
     44        uint32_t v;
    4445       
    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,
    4649            PAGE_READ | PAGE_WRITE | PAGE_CACHEABLE);
    4750        TPRINTF("Virtual address %p mapped to physical address %p.\n",
    4851            (void *) page0, (void *) frame);
    49        
    50         uintptr_t page1 = km_map(frame, FRAME_SIZE,
     52        page1 = km_map(frame, FRAME_SIZE,
    5153            PAGE_READ | PAGE_WRITE | PAGE_CACHEABLE);
    5254        TPRINTF("Virtual address %p mapped to physical address %p.\n",
     
    6062                TPRINTF("Reading magic using the second virtual address.\n");
    6163               
    62                 uint32_t v = *((uint32_t *) page1);
     64                v = *((uint32_t *) page1);
    6365               
    6466                if (v != TEST_MAGIC) {
    6567                        km_unmap(page0, PAGE_SIZE);
    6668                        km_unmap(page1, PAGE_SIZE);
    67                         frame_free(frame, 1);
     69                        frame_free(frame);
    6870                        return "Criss-cross read does not match the value written.";
    6971                }
     
    8082                        km_unmap(page0, PAGE_SIZE);
    8183                        km_unmap(page1, PAGE_SIZE);
    82                         frame_free(frame, 1);
     84                        frame_free(frame);
    8385                        return "Criss-cross read does not match the value written.";
    8486                }
     
    8789        km_unmap(page0, PAGE_SIZE);
    8890        km_unmap(page1, PAGE_SIZE);
    89         frame_free(frame, 1);
     91        frame_free(frame);
    9092       
    9193        return NULL;
Note: See TracChangeset for help on using the changeset viewer.