Ignore:
File:
1 edited

Legend:

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

    re2a0d76 r5df1963  
    4141const char *test_mapping1(void)
    4242{
    43         uintptr_t page0, page1;
    44         uint32_t v;
     43        uintptr_t frame = frame_alloc(1, FRAME_NONE, 0);
    4544       
    46         uintptr_t frame = frame_alloc(ONE_FRAME, FRAME_NONE, 0);
    47        
    48         page0 = km_map(frame, FRAME_SIZE,
     45        uintptr_t page0 = km_map(frame, FRAME_SIZE,
    4946            PAGE_READ | PAGE_WRITE | PAGE_CACHEABLE);
    5047        TPRINTF("Virtual address %p mapped to physical address %p.\n",
    5148            (void *) page0, (void *) frame);
    52         page1 = km_map(frame, FRAME_SIZE,
     49       
     50        uintptr_t page1 = km_map(frame, FRAME_SIZE,
    5351            PAGE_READ | PAGE_WRITE | PAGE_CACHEABLE);
    5452        TPRINTF("Virtual address %p mapped to physical address %p.\n",
     
    6260                TPRINTF("Reading magic using the second virtual address.\n");
    6361               
    64                 v = *((uint32_t *) page1);
     62                uint32_t v = *((uint32_t *) page1);
    6563               
    6664                if (v != TEST_MAGIC) {
    6765                        km_unmap(page0, PAGE_SIZE);
    6866                        km_unmap(page1, PAGE_SIZE);
    69                         frame_free(frame);
     67                        frame_free(frame, 1);
    7068                        return "Criss-cross read does not match the value written.";
    7169                }
     
    8280                        km_unmap(page0, PAGE_SIZE);
    8381                        km_unmap(page1, PAGE_SIZE);
    84                         frame_free(frame);
     82                        frame_free(frame, 1);
    8583                        return "Criss-cross read does not match the value written.";
    8684                }
     
    8987        km_unmap(page0, PAGE_SIZE);
    9088        km_unmap(page1, PAGE_SIZE);
    91         frame_free(frame);
     89        frame_free(frame, 1);
    9290       
    9391        return NULL;
Note: See TracChangeset for help on using the changeset viewer.