From: acevest Date: Tue, 2 Nov 2021 07:30:21 +0000 (+0800) Subject: remove code X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=1bb95fc4e49146c205adfdaab987cbec50001ab8;p=kernel.git remove code --- diff --git a/mm/bootmem.c b/mm/bootmem.c index 12d3570..c6eaa08 100644 --- a/mm/bootmem.c +++ b/mm/bootmem.c @@ -158,15 +158,6 @@ void init_bootmem() { e820_print_map(); e820_init_bootmem_data(); init_bootmem_allocator(); - -#if 0 - printk("alloc 10 bytes align 8 addr %08x\n", alloc_bootmem(10, 8)); - printk("alloc 40961 bytes align 4096 addr %08x\n", alloc_bootmem(40961, 4096)); - printk("alloc 5 bytes align 4 addr %08x\n", alloc_bootmem(5, 4)); - printk("alloc 10 bytes align 1024 addr %08x\n", alloc_bootmem(10, 1024)); - printk("alloc 123bytes align 2 addr %08x\n", alloc_bootmem(123, 2)); - printk("alloc 123bytes align 2 addr %08x\n", alloc_bootmem(123, 2)); -#endif } // 由于只有在构建buddy system的时候才会用到 @@ -174,7 +165,6 @@ void init_bootmem() { void *alloc_from_bootmem(unsigned long size, char *title) { void *region = NULL; unsigned long pfn_cnt = PFN_UP(size); - printk("%s alloc bootmem size: %x pfn: %d\n", title, size, pfn_cnt); bootmem_data_t *pbd = &bootmem_data; @@ -216,5 +206,7 @@ find_next_block: pbd->prepare_alloc_pfn = end_pfn; + printk("%s alloc bootmem size: %x pfn cnt: %d [%d, %d)\n", title, size, pfn_cnt, bgn_pfn, end_pfn); + return region; } \ No newline at end of file diff --git a/mm/buddy.c b/mm/buddy.c index ba7213a..d2ceed7 100644 --- a/mm/buddy.c +++ b/mm/buddy.c @@ -169,21 +169,6 @@ void dump_buddy_system() { printk("\n"); } - -#if 0 - printk("alloc 1 pages va 0x%08x\n", alloc_pages(0, 0)); - printk("alloc 1 pages va 0x%08x\n", alloc_pages(0, 0)); - printk("alloc 1 pages va 0x%08x\n", alloc_pages(0, 0)); - printk("alloc 1 pages va 0x%08x\n", alloc_pages(0, 0)); - printk("alloc 1 pages va 0x%08x\n", alloc_pages(0, 0)); - printk("alloc 1 pages va 0x%08x\n", alloc_pages(0, 0)); - printk("alloc 1 pages va 0x%08x\n", alloc_pages(0, 0)); - printk("alloc 1 pages va 0x%08x\n", alloc_pages(0, 0)); - printk("alloc 1 pages va 0x%08x\n", alloc_pages(0, 0)); - printk("alloc 2 pages va 0x%08x\n", alloc_pages(0, 1)); - printk("alloc 4 pages va 0x%08x\n", alloc_pages(0, 2)); - printk("alloc 8 pages va 0x%08x\n", alloc_pages(0, 3)); -#endif } void init_buddy_system() { @@ -232,5 +217,5 @@ void init_buddy_system() { // free bootmem bitmap pages to buddy system // ... - // dump_buddy_system(); + dump_buddy_system(); }