34,10 → 34,6 |
#include <panic.h> |
#include <memstr.h> |
|
#ifdef CONFIG_BENCH |
#include <arch/cycle.h> |
#endif |
|
#define VAL_COUNT 1024 |
|
static void * data[VAL_COUNT]; |
103,14 → 99,13 |
testit(16385, 128); |
} |
|
|
#define THREADS 6 |
#define THR_MEM_COUNT 1024 |
#define THR_MEM_SIZE 128 |
|
void * thr_data[THREADS][THR_MEM_COUNT]; |
slab_cache_t *thr_cache; |
semaphore_t thr_sem; |
static void * thr_data[THREADS][THR_MEM_COUNT]; |
static slab_cache_t *thr_cache; |
static semaphore_t thr_sem; |
|
static void slabtest(void *data) |
{ |
145,7 → 140,8 |
semaphore_initialize(&thr_sem,0); |
for (i=0; i<THREADS; i++) { |
if (!(t = thread_create(slabtest, (void *)(unative_t)i, TASK, 0, "slabtest"))) |
panic("could not create thread\n"); |
printf("Could not create thread %d\n", i); |
else |
thread_ready(t); |
} |
|
157,15 → 153,10 |
|
} |
|
void test_slab1(void) |
char * test_slab1(void) |
{ |
#ifdef CONFIG_BENCH |
uint64_t t0 = get_cycle(); |
#endif |
testsimple(); |
testthreads(); |
#ifdef CONFIG_BENCH |
uint64_t dt = get_cycle() - t0; |
printf("Time: %.*d cycles\n", sizeof(dt) * 2, dt); |
#endif |
|
return NULL; |
} |