Changeset 4e147a6 in mainline
- Timestamp:
- 2006-02-02T01:51:25Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9ea8a7ca
- Parents:
- b5e0bb8
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
rb5e0bb8 r4e147a6 116 116 generic/src/mm/tlb.c \ 117 117 generic/src/mm/as.c \ 118 generic/src/mm/slab.c \ 118 119 generic/src/lib/func.c \ 119 120 generic/src/lib/list.c \ -
generic/include/mm/frame.h
rb5e0bb8 r4e147a6 36 36 #include <synch/spinlock.h> 37 37 #include <mm/buddy.h> 38 #include <mm/slab.h> 38 39 39 40 #define ONE_FRAME 0 … … 41 42 #define FRAME_KA 1 /* skip frames conflicting with user address space */ 42 43 #define FRAME_PANIC 2 /* panic on failure */ 43 #define FRAME_ NON_BLOCKING4 /* do not panic and do not sleep on failure */44 #define FRAME_ATOMIC 4 /* do not panic and do not sleep on failure */ 44 45 45 46 #define FRAME_OK 0 /* frame_alloc return status */ … … 78 79 __u8 buddy_order; /**< buddy system block order */ 79 80 link_t buddy_link; /**< link to the next free block inside one order */ 81 slab_slab_t *slab; /**< If allocated by slab, this points there */ 80 82 }; 81 83 -
generic/src/console/cmd.c
rb5e0bb8 r4e147a6 51 51 #include <mm/frame.h> 52 52 #include <main/version.h> 53 #include <mm/slab.h> 53 54 54 55 /** Data and methods for 'help' command. */ … … 244 245 245 246 247 static int cmd_slabs(cmd_arg_t *argv); 248 static cmd_info_t slabs_info = { 249 .name = "slabs", 250 .description = "List SLAB caches.", 251 .func = cmd_slabs, 252 .argc = 0 253 }; 254 246 255 /** Data and methods for 'zones' command */ 247 256 static int cmd_zones(cmd_arg_t *argv); … … 353 362 if (!cmd_register(&zones_info)) 354 363 panic("could not register command %s\n", zones_info.name); 364 365 cmd_initialize(&slabs_info); 366 if (!cmd_register(&slabs_info)) 367 panic("could not register command %s\n", slabs_info.name); 355 368 356 369 cmd_initialize(&zone_info); … … 604 617 } 605 618 619 /** Command for listings SLAB caches 620 * 621 * @param argv Ignores 622 * 623 * @return Always 1 624 */ 625 int cmd_slabs(cmd_arg_t * argv) { 626 slab_print_list(); 627 return 1; 628 } 629 606 630 /** Command for listing memory zones 607 631 * -
generic/src/main/main.c
rb5e0bb8 r4e147a6 50 50 #include <mm/tlb.h> 51 51 #include <mm/as.h> 52 #include <mm/slab.h> 52 53 #include <synch/waitq.h> 53 54 #include <arch/arch.h> … … 163 164 page_init(); 164 165 tlb_init(); 166 slab_cache_init(); 165 167 arch_post_mm_init(); 166 168 -
generic/src/mm/frame.c
rb5e0bb8 r4e147a6 124 124 interrupts_restore(ipl); 125 125 126 if (flags & FRAME_ NON_BLOCKING) {126 if (flags & FRAME_ATOMIC) { 127 127 ASSERT(status != NULL); 128 128 *status = FRAME_NO_MEMORY; … … 158 158 v = PA2KA(v); 159 159 160 if (flags & FRAME_ NON_BLOCKING) {160 if (flags & FRAME_ATOMIC) { 161 161 ASSERT(status != NULL); 162 162 *status = FRAME_OK; -
kernel.config
rb5e0bb8 r4e147a6 81 81 @ "mm/falloc1" Frame Allocation test 1 82 82 @ "mm/falloc2" Frame Allocation test 2 83 @ "mm/slab1" SLAB Allocator test 1 83 84 @ [ARCH=mips32] "debug/mips1" Mips breakpoint-debug test 84 85 ! CONFIG_TEST (choice) -
test/mm/falloc1/test.c
rb5e0bb8 r4e147a6 56 56 allocated = 0; 57 57 for (i = 0; i < MAX_FRAMES >> order; i++) { 58 frames[allocated] = frame_alloc(FRAME_ NON_BLOCKING| FRAME_KA, order, &status);58 frames[allocated] = frame_alloc(FRAME_ATOMIC | FRAME_KA, order, &status); 59 59 60 60 if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) { -
test/mm/falloc2/test.c
rb5e0bb8 r4e147a6 64 64 allocated = 0; 65 65 for (i = 0; i < (MAX_FRAMES >> order); i++) { 66 frames[allocated] = frame_alloc(FRAME_ NON_BLOCKING| FRAME_KA, order, &status);66 frames[allocated] = frame_alloc(FRAME_ATOMIC | FRAME_KA, order, &status); 67 67 if (status == 0) { 68 68 memsetb(frames[allocated], FRAME_SIZE << order, val);
Note:
See TracChangeset
for help on using the changeset viewer.