- Timestamp:
- 2006-02-02T14:00:32Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2d43f3e
- Parents:
- 758e065
- Location:
- test/mm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
test/mm/falloc1/test.c
r758e065 ra294ad0 56 56 allocated = 0; 57 57 for (i = 0; i < MAX_FRAMES >> order; i++) { 58 frames[allocated] = frame_alloc(FRAME_ATOMIC | FRAME_KA, order, &status );58 frames[allocated] = frame_alloc(FRAME_ATOMIC | FRAME_KA, order, &status, NULL); 59 59 60 60 if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) { -
test/mm/falloc2/test.c
r758e065 ra294ad0 64 64 allocated = 0; 65 65 for (i = 0; i < (MAX_FRAMES >> order); i++) { 66 frames[allocated] = frame_alloc(FRAME_ATOMIC | FRAME_KA, order, &status );66 frames[allocated] = frame_alloc(FRAME_ATOMIC | FRAME_KA, order, &status, NULL); 67 67 if (status == 0) { 68 68 memsetb(frames[allocated], FRAME_SIZE << order, val); -
test/mm/mapping1/test.c
r758e065 ra294ad0 48 48 printf("Memory management test mapping #1\n"); 49 49 50 frame0 = frame_alloc(FRAME_KA, ONE_FRAME, NULL );51 frame1 = frame_alloc(FRAME_KA, ONE_FRAME, NULL );50 frame0 = frame_alloc(FRAME_KA, ONE_FRAME, NULL, NULL); 51 frame1 = frame_alloc(FRAME_KA, ONE_FRAME, NULL, NULL); 52 52 53 53 printf("Writing %L to physical address %P.\n", VALUE0, KA2PA(frame0)); -
test/mm/slab1/test.c
r758e065 ra294ad0 29 29 #include <test.h> 30 30 #include <mm/slab.h> 31 #include <print.h> 32 33 #define VAL_SIZE 128 34 #define VAL_COUNT 1024 35 36 void * data[16384]; 31 37 32 38 void test(void) 33 39 { 34 slab_cache_create("test_cache", 10, 0, NULL, NULL, 0); 40 slab_cache_t *cache; 41 int i; 42 43 44 printf("Creating cache.\n"); 45 cache = slab_cache_create("test_cache", VAL_SIZE, 0, NULL, NULL, SLAB_CACHE_NOMAGAZINE); 46 slab_print_list(); 47 printf("Destroying cache.\n"); 48 slab_cache_destroy(cache); 49 50 printf("Creating cache.\n"); 51 cache = slab_cache_create("test_cache", VAL_SIZE, 0, NULL, NULL, 52 SLAB_CACHE_NOMAGAZINE); 53 54 printf("Allocating %d items...", VAL_COUNT); 55 for (i=0; i < VAL_COUNT; i++) { 56 data[i] = slab_alloc(cache, 0); 57 } 58 printf("done.\n"); 59 printf("Freeing %d items...", VAL_COUNT); 60 for (i=0; i < VAL_COUNT; i++) { 61 slab_free(cache, data[i]); 62 } 63 printf("done.\n"); 35 64 }
Note:
See TracChangeset
for help on using the changeset viewer.