Changeset 46c20c8 in mainline for kernel/test/mm


Ignore:
Timestamp:
2010-11-26T20:08:10Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
Children:
45df59a
Parents:
fb150d78 (diff), ffdd2b9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

Location:
kernel/test/mm
Files:
7 edited

Legend:

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

    rfb150d78 r46c20c8  
    3333#include <mm/slab.h>
    3434#include <arch/mm/page.h>
    35 #include <arch/types.h>
     35#include <typedefs.h>
    3636#include <debug.h>
    3737#include <align.h>
     
    4141#define TEST_RUNS   2
    4242
    43 char *test_falloc1(void) {
     43const char *test_falloc1(void) {
    4444        uintptr_t *frames
    4545            = (uintptr_t *) malloc(MAX_FRAMES * sizeof(uintptr_t), 0);
     
    6464                               
    6565                                if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) {
    66                                         TPRINTF("Block at address %p (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
     66                                        TPRINTF("Block at address %p (size %dK) is not aligned\n",
     67                                            (void *) frames[allocated], (FRAME_SIZE << order) >> 10);
    6768                                        return "Test failed";
    6869                                }
  • kernel/test/mm/falloc2.c

    rfb150d78 r46c20c8  
    3333#include <mm/slab.h>
    3434#include <arch/mm/page.h>
    35 #include <arch/types.h>
     35#include <typedefs.h>
    3636#include <atomic.h>
    3737#include <debug.h>
     
    8585                                for (k = 0; k <= (((size_t) FRAME_SIZE << order) - 1); k++) {
    8686                                        if (((uint8_t *) frames[i])[k] != val) {
    87                                                 TPRINTF("Thread #%" PRIu64 " (cpu%u): Unexpected data (%c) in block %p offset %#" PRIs "\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
     87                                                TPRINTF("Thread #%" PRIu64 " (cpu%u): Unexpected data (%c) in block %p offset %zu\n",
     88                                                    THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
    8889                                                atomic_inc(&thread_fail);
    8990                                                goto cleanup;
     
    104105}
    105106
    106 char *test_falloc2(void)
     107const char *test_falloc2(void)
    107108{
    108109        unsigned int i;
     
    121122       
    122123        while (atomic_get(&thread_count) > 0) {
    123                 TPRINTF("Threads left: %ld\n", atomic_get(&thread_count));
     124                TPRINTF("Threads left: %" PRIua "\n", atomic_get(&thread_count));
    124125                thread_sleep(1);
    125126        }
  • kernel/test/mm/mapping1.c

    rfb150d78 r46c20c8  
    3333#include <mm/as.h>
    3434#include <arch/mm/page.h>
    35 #include <arch/types.h>
     35#include <typedefs.h>
    3636#include <debug.h>
    3737
     
    3939#define PAGE1  (PAGE0 + PAGE_SIZE)
    4040
    41 #define VALUE0  0x01234567
    42 #define VALUE1  0x89abcdef
     41#define VALUE0  UINT32_C(0x01234567)
     42#define VALUE1  UINT32_C(0x89abcdef)
    4343
    44 char *test_mapping1(void)
     44const char *test_mapping1(void)
    4545{
    4646        uintptr_t frame0, frame1;
     
    5050        frame1 = (uintptr_t) frame_alloc(ONE_FRAME, FRAME_KA);
    5151       
    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));
    5354        *((uint32_t *) frame0) = VALUE0;
    5455       
    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));
    5658        *((uint32_t *) frame1) = VALUE1;
    5759       
    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));
    5962        page_mapping_insert(AS_KERNEL, PAGE0, KA2PA(frame0), PAGE_PRESENT | PAGE_WRITE);
    6063       
    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));
    6266        page_mapping_insert(AS_KERNEL, PAGE1, KA2PA(frame1), PAGE_PRESENT | PAGE_WRITE);
    6367       
    6468        v0 = *((uint32_t *) PAGE0);
    6569        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);
    6874       
    6975        if (v0 != VALUE0)
     
    7278                return "Value at v1 not equal to VALUE1";
    7379       
    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);
    7582        *((uint32_t *) PAGE0) = 0;
    7683       
    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);
    7886        *((uint32_t *) PAGE1) = 0;
    7987       
     
    8189        v1 = *((uint32_t *) PAGE1);
    8290       
    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));
    8595       
    8696        if (v0 != 0)
  • kernel/test/mm/purge1.c

    rfb150d78 r46c20c8  
    3434#include <arch/mm/page.h>
    3535#include <arch/mm/tlb.h>
    36 #include <arch/types.h>
     36#include <typedefs.h>
    3737#include <debug.h>
    3838
     
    4040extern void tlb_invalidate_pages(asid_t asid, uintptr_t va, size_t cnt);
    4141
    42 char *test_purge1(void)
     42const char *test_purge1(void)
    4343{
    4444        tlb_entry_t entryi;
  • kernel/test/mm/purge1_skip.c

    rfb150d78 r46c20c8  
    2929#include <test.h>
    3030
    31 char *test_purge1(void)
     31const char *test_purge1(void)
    3232{
    3333        return NULL;
  • kernel/test/mm/slab1.c

    rfb150d78 r46c20c8  
    170170}
    171171
    172 char *test_slab1(void)
     172const char *test_slab1(void)
    173173{
    174174        testsimple();
  • kernel/test/mm/slab2.c

    rfb150d78 r46c20c8  
    226226}
    227227
    228 char *test_slab2(void)
     228const char *test_slab2(void)
    229229{
    230230        TPRINTF("Running reclaim single-thread test .. pass 1\n");
Note: See TracChangeset for help on using the changeset viewer.