Changeset f272cb8 in mainline for kernel/test/mm/mapping1.c


Ignore:
Timestamp:
2006-12-11T19:19:28Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
70b6de1
Parents:
50661ab
Message:

integrate more tests

File:
1 moved

Legend:

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

    r50661ab rf272cb8  
    3535#include <debug.h>
    3636
     37#ifdef CONFIG_BENCH
     38#include <arch/cycle.h>
     39#endif
     40
    3741#define PAGE0   0x10000000
    3842#define PAGE1   (PAGE0+PAGE_SIZE)
     
    4145#define VALUE1  0x89abcdef
    4246
    43 void test(void)
     47void test_mapping1(void)
    4448{
     49#ifdef CONFIG_BENCH
     50        uint64_t t0 = get_cycle();
     51#endif
    4552        uintptr_t frame0, frame1;
    4653        uint32_t v0, v1;
     
    4855        printf("Memory management test mapping #1\n");
    4956
    50         frame0 = frame_alloc(ONE_FRAME, FRAME_KA);
    51         frame1 = frame_alloc(ONE_FRAME, FRAME_KA);
     57        frame0 = (uintptr_t) frame_alloc(ONE_FRAME, FRAME_KA);
     58        frame1 = (uintptr_t) frame_alloc(ONE_FRAME, FRAME_KA);
    5259
    5360        printf("Writing %#x to physical address %p.\n", VALUE0, KA2PA(frame0));
     
    8289       
    8390        printf("Test passed.\n");
    84        
     91#ifdef CONFIG_BENCH
     92        uint64_t dt = get_cycle() - t0;
     93        printf("Time: %.*d cycles\n", sizeof(dt) * 2, dt);
     94#endif 
    8595}
Note: See TracChangeset for help on using the changeset viewer.