- Timestamp:
- 2006-07-04T17:17:56Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0ffa3ef5
- Parents:
- 991779c5
- Location:
- test
- Files:
-
- 13 edited
-
fpu/fpu1/test.c (modified) (2 diffs)
-
fpu/mips1/test.c (modified) (3 diffs)
-
fpu/sse1/test.c (modified) (3 diffs)
-
mm/falloc1/test.c (modified) (2 diffs)
-
mm/falloc2/test.c (modified) (3 diffs)
-
mm/mapping1/test.c (modified) (4 diffs)
-
mm/purge1/test.c (modified) (1 diff)
-
mm/slab1/test.c (modified) (5 diffs)
-
mm/slab2/test.c (modified) (3 diffs)
-
print/print1/test.c (modified) (2 diffs)
-
synch/rwlock4/test.c (modified) (3 diffs)
-
synch/semaphore2/test.c (modified) (2 diffs)
-
sysinfo/test.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
test/fpu/fpu1/test.c
r991779c5 r7f1c620 96 96 97 97 if((int)(100000000*e)!=E_10e8) 98 panic("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, ( __native) (100000000*e),(__native) E_10e8);98 panic("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000*e),(unative_t) E_10e8); 99 99 } 100 100 101 printf("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, ( __native) (100000000*e),(__native) E_10e8);101 printf("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000*e),(unative_t) E_10e8); 102 102 atomic_inc(&threads_ok); 103 103 } … … 137 137 #ifdef __ia64_ARCH_H__ 138 138 if((int)(1000000*pi)!=PI_10e8) 139 panic("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, ( __native) (1000000*pi),(__native) (PI_10e8/100));139 panic("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (1000000*pi),(unative_t) (PI_10e8/100)); 140 140 #else 141 141 if((int)(100000000*pi)!=PI_10e8) 142 panic("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, ( __native) (100000000*pi),(__native) PI_10e8);142 panic("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000*pi),(unative_t) PI_10e8); 143 143 #endif 144 144 145 145 } 146 146 147 printf("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, ( __native) (100000000*pi),(__native) PI_10e8);147 printf("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000*pi),(unative_t) PI_10e8); 148 148 atomic_inc(&threads_ok); 149 149 } -
test/fpu/mips1/test.c
r991779c5 r7f1c620 48 48 { 49 49 int i; 50 int arg __attribute__((aligned(16))) = (int)(( __native) data);50 int arg __attribute__((aligned(16))) = (int)((unative_t) data); 51 51 int after_arg __attribute__((aligned(16))); 52 52 … … 78 78 { 79 79 int i; 80 int arg __attribute__((aligned(16))) = (int)(( __native) data);80 int arg __attribute__((aligned(16))) = (int)((unative_t) data); 81 81 int after_arg __attribute__((aligned(16))); 82 82 … … 117 117 118 118 for (i=0; i<THREADS/2; i++) { 119 if (!(t = thread_create(testit1, (void *)(( __native)i*2), TASK, 0, "testit1")))119 if (!(t = thread_create(testit1, (void *)((unative_t)i*2), TASK, 0, "testit1"))) 120 120 panic("could not create thread\n"); 121 121 thread_ready(t); 122 if (!(t = thread_create(testit2, (void *)(( __native)i*2+1), TASK, 0, "testit2")))122 if (!(t = thread_create(testit2, (void *)((unative_t)i*2+1), TASK, 0, "testit2"))) 123 123 panic("could not create thread\n"); 124 124 thread_ready(t); -
test/fpu/sse1/test.c
r991779c5 r7f1c620 48 48 { 49 49 int i; 50 int arg __attribute__((aligned(16))) = (int)(( __native) data);50 int arg __attribute__((aligned(16))) = (int)((unative_t) data); 51 51 int after_arg __attribute__((aligned(16))); 52 52 … … 78 78 { 79 79 int i; 80 int arg __attribute__((aligned(16))) = (int)(( __native) data);80 int arg __attribute__((aligned(16))) = (int)((unative_t) data); 81 81 int after_arg __attribute__((aligned(16))); 82 82 … … 117 117 118 118 for (i=0; i<THREADS/2; i++) { 119 if (!(t = thread_create(testit1, (void *)(( __native)i*2), TASK, 0, "testit1")))119 if (!(t = thread_create(testit1, (void *)((unative_t)i*2), TASK, 0, "testit1"))) 120 120 panic("could not create thread\n"); 121 121 thread_ready(t); 122 if (!(t = thread_create(testit2, (void *)(( __native)i*2+1), TASK, 0, "testit2")))122 if (!(t = thread_create(testit2, (void *)((unative_t)i*2+1), TASK, 0, "testit2"))) 123 123 panic("could not create thread\n"); 124 124 thread_ready(t); -
test/mm/falloc1/test.c
r991779c5 r7f1c620 41 41 42 42 void test(void) { 43 __address * frames = (__address *) malloc(MAX_FRAMES*sizeof(__address), 0);43 uintptr_t * frames = (uintptr_t *) malloc(MAX_FRAMES*sizeof(uintptr_t), 0); 44 44 int results[MAX_ORDER+1]; 45 45 … … 55 55 allocated = 0; 56 56 for (i = 0; i < MAX_FRAMES >> order; i++) { 57 frames[allocated] = ( __address) frame_alloc(order, FRAME_ATOMIC | FRAME_KA);57 frames[allocated] = (uintptr_t) frame_alloc(order, FRAME_ATOMIC | FRAME_KA); 58 58 59 59 if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) { -
test/mm/falloc2/test.c
r991779c5 r7f1c620 53 53 { 54 54 int order, run, allocated, i; 55 __u8val = THREAD->tid % THREADS;55 uint8_t val = THREAD->tid % THREADS; 56 56 index_t k; 57 57 58 __address * frames = (__address *) malloc(MAX_FRAMES * sizeof(__address), FRAME_ATOMIC);58 uintptr_t * frames = (uintptr_t *) malloc(MAX_FRAMES * sizeof(uintptr_t), FRAME_ATOMIC); 59 59 ASSERT(frames != NULL); 60 60 … … 66 66 allocated = 0; 67 67 for (i = 0; i < (MAX_FRAMES >> order); i++) { 68 frames[allocated] = ( __address)frame_alloc(order, FRAME_ATOMIC | FRAME_KA);68 frames[allocated] = (uintptr_t)frame_alloc(order, FRAME_ATOMIC | FRAME_KA); 69 69 if (frames[allocated]) { 70 70 memsetb(frames[allocated], FRAME_SIZE << order, val); … … 79 79 for (i = 0; i < allocated; i++) { 80 80 for (k = 0; k <= ((FRAME_SIZE << order) - 1); k++) { 81 if ((( __u8*) frames[i])[k] != val) {81 if (((uint8_t *) frames[i])[k] != val) { 82 82 printf("Thread #%d (cpu%d): Unexpected data (%d) in block %p offset %#zx\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k); 83 83 failed(); -
test/mm/mapping1/test.c
r991779c5 r7f1c620 43 43 void test(void) 44 44 { 45 __addressframe0, frame1;46 __u32v0, v1;45 uintptr_t frame0, frame1; 46 uint32_t v0, v1; 47 47 48 48 printf("Memory management test mapping #1\n"); … … 52 52 53 53 printf("Writing %#x to physical address %p.\n", VALUE0, KA2PA(frame0)); 54 *(( __u32*) frame0) = VALUE0;54 *((uint32_t *) frame0) = VALUE0; 55 55 printf("Writing %#x to physical address %p.\n", VALUE1, KA2PA(frame1)); 56 *(( __u32*) frame1) = VALUE1;56 *((uint32_t *) frame1) = VALUE1; 57 57 58 58 printf("Mapping virtual address %p to physical address %p.\n", PAGE0, KA2PA(frame0)); … … 61 61 page_mapping_insert(AS_KERNEL, PAGE1, KA2PA(frame1), PAGE_PRESENT | PAGE_WRITE); 62 62 63 printf("Value at virtual address %p is %#x.\n", PAGE0, v0 = *(( __u32*) PAGE0));64 printf("Value at virtual address %p is %#x.\n", PAGE1, v1 = *(( __u32*) PAGE1));63 printf("Value at virtual address %p is %#x.\n", PAGE0, v0 = *((uint32_t *) PAGE0)); 64 printf("Value at virtual address %p is %#x.\n", PAGE1, v1 = *((uint32_t *) PAGE1)); 65 65 66 66 ASSERT(v0 == VALUE0); … … 68 68 69 69 printf("Writing %#x to virtual address %p.\n", 0, PAGE0); 70 *(( __u32*) PAGE0) = 0;70 *((uint32_t *) PAGE0) = 0; 71 71 printf("Writing %#x to virtual address %p.\n", 0, PAGE1); 72 *(( __u32*) PAGE1) = 0;72 *((uint32_t *) PAGE1) = 0; 73 73 74 v0 = *(( __u32*) PAGE0);75 v1 = *(( __u32*) PAGE1);74 v0 = *((uint32_t *) PAGE0); 75 v1 = *((uint32_t *) PAGE1); 76 76 77 printf("Value at virtual address %p is %#x.\n", PAGE0, *(( __u32*) PAGE0));78 printf("Value at virtual address %p is %#x.\n", PAGE1, *(( __u32*) PAGE1));77 printf("Value at virtual address %p is %#x.\n", PAGE0, *((uint32_t *) PAGE0)); 78 printf("Value at virtual address %p is %#x.\n", PAGE1, *((uint32_t *) PAGE1)); 79 79 80 80 ASSERT(v0 == 0); -
test/mm/purge1/test.c
r991779c5 r7f1c620 38 38 39 39 extern void tlb_invalidate_all(void); 40 extern void tlb_invalidate_pages(asid_t asid, __addressva, count_t cnt);40 extern void tlb_invalidate_pages(asid_t asid, uintptr_t va, count_t cnt); 41 41 void test(void) 42 42 { -
test/mm/slab1/test.c
r991779c5 r7f1c620 50 50 for (i=0; i < count; i++) { 51 51 data[i] = slab_alloc(cache, 0); 52 memsetb(( __address)data[i], size, 0);52 memsetb((uintptr_t)data[i], size, 0); 53 53 } 54 54 printf("done.\n"); … … 62 62 for (i=0; i < count; i++) { 63 63 data[i] = slab_alloc(cache, 0); 64 memsetb(( __address)data[i], size, 0);64 memsetb((uintptr_t)data[i], size, 0); 65 65 } 66 66 printf("done.\n"); … … 75 75 for (i=count/2; i < count; i++) { 76 76 data[i] = slab_alloc(cache, 0); 77 memsetb(( __address)data[i], size, 0);77 memsetb((uintptr_t)data[i], size, 0); 78 78 } 79 79 printf("done.\n"); … … 111 111 static void slabtest(void *data) 112 112 { 113 int offs = (int)( __native) data;113 int offs = (int)(unative_t) data; 114 114 int i,j; 115 115 … … 141 141 semaphore_initialize(&thr_sem,0); 142 142 for (i=0; i<THREADS; i++) { 143 if (!(t = thread_create(slabtest, (void *)( __native)i, TASK, 0, "slabtest")))143 if (!(t = thread_create(slabtest, (void *)(unative_t)i, TASK, 0, "slabtest"))) 144 144 panic("could not create thread\n"); 145 145 thread_ready(t); -
test/mm/slab2/test.c
r991779c5 r7f1c620 68 68 break; 69 69 } 70 memsetb(( __address)data1, ITEM_SIZE, 0);71 memsetb(( __address)data2, ITEM_SIZE, 0);70 memsetb((uintptr_t)data1, ITEM_SIZE, 0); 71 memsetb((uintptr_t)data2, ITEM_SIZE, 0); 72 72 *((void **)data1) = olddata1; 73 73 *((void **)data2) = olddata2; … … 91 91 panic("Incorrect memory size - use another test."); 92 92 } 93 memsetb(( __address)data1, ITEM_SIZE, 0);93 memsetb((uintptr_t)data1, ITEM_SIZE, 0); 94 94 *((void **)data1) = olddata1; 95 95 olddata1 = data1; … … 100 100 break; 101 101 } 102 memsetb(( __address)data1, ITEM_SIZE, 0);102 memsetb((uintptr_t)data1, ITEM_SIZE, 0); 103 103 *((void **)data1) = olddata1; 104 104 olddata1 = data1; -
test/print/print1/test.c
r991779c5 r7f1c620 34 34 { 35 35 int retval; 36 __nativenat = 0x12345678u;36 unative_t nat = 0x12345678u; 37 37 38 38 char buffer[BUFFER_SIZE]; … … 50 50 printf(" 0xint: x '%#x', 5.3x '%#5.3x', -5.3x '%#-5.3x', 3.5x '%#3.5x', -3.5x '%#-3.5x' \n",17, 17, 17, 17, 17 ); 51 51 52 printf("'%#llx' 64bit, '%#x' 32bit, '%#hhx' 8bit, '%#hx' 16bit, __native'%#zx'. '%#llx' 64bit and '%s' string.\n", 0x1234567887654321ll, 0x12345678, 0x12, 0x1234, nat, 0x1234567887654321ull, "Lovely string" );52 printf("'%#llx' 64bit, '%#x' 32bit, '%#hhx' 8bit, '%#hx' 16bit, unative_t '%#zx'. '%#llx' 64bit and '%s' string.\n", 0x1234567887654321ll, 0x12345678, 0x12, 0x1234, nat, 0x1234567887654321ull, "Lovely string" ); 53 53 54 54 printf(" Print to NULL '%s'\n",NULL); -
test/synch/rwlock4/test.c
r991779c5 r7f1c620 51 51 static waitq_t can_start; 52 52 53 __u32seed = 0xdeadbeef;53 uint32_t seed = 0xdeadbeef; 54 54 55 static __u32 random(__u32max);55 static uint32_t random(uint32_t max); 56 56 57 57 static void writer(void *arg); … … 59 59 static void failed(void); 60 60 61 __u32 random(__u32max)61 uint32_t random(uint32_t max) 62 62 { 63 __u32rc;63 uint32_t rc; 64 64 65 65 spinlock_lock(&lock); … … 122 122 { 123 123 context_t ctx; 124 __u32i, k;124 uint32_t i, k; 125 125 126 126 printf("Read/write locks test #4\n"); -
test/synch/semaphore2/test.c
r991779c5 r7f1c620 46 46 static waitq_t can_start; 47 47 48 __u32seed = 0xdeadbeef;48 uint32_t seed = 0xdeadbeef; 49 49 50 static __u32 random(__u32max);50 static uint32_t random(uint32_t max); 51 51 52 52 static void consumer(void *arg); 53 53 static void failed(void); 54 54 55 __u32 random(__u32max)55 uint32_t random(uint32_t max) 56 56 { 57 __u32rc;57 uint32_t rc; 58 58 59 59 spinlock_lock(&lock); … … 96 96 void test(void) 97 97 { 98 __u32i, k;98 uint32_t i, k; 99 99 100 100 printf("Semaphore test #2\n"); -
test/sysinfo/test.c
r991779c5 r7f1c620 34 34 #include <sysinfo/sysinfo.h> 35 35 /* 36 static __nativecounter(sysinfo_item_t *root)36 static unative_t counter(sysinfo_item_t *root) 37 37 { 38 static __nativei=0;38 static unative_t i=0; 39 39 return i++; 40 40 }*/
Note:
See TracChangeset
for help on using the changeset viewer.
