X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fv850%2Fkernel%2Fsetup.c;h=62bdb8d29fc05191750c7f1033a802e24f445d4d;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=c41d72b01b8806cf07ddbc5a664240f0597a84b6;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/arch/v850/kernel/setup.c b/arch/v850/kernel/setup.c index c41d72b01..62bdb8d29 100644 --- a/arch/v850/kernel/setup.c +++ b/arch/v850/kernel/setup.c @@ -1,8 +1,8 @@ /* * arch/v850/kernel/setup.c -- Arch-dependent initialization functions * - * Copyright (C) 2001,02,03 NEC Electronics Corporation - * Copyright (C) 2001,02,03 Miles Bader + * Copyright (C) 2001,02,03,05 NEC Electronics Corporation + * Copyright (C) 2001,02,03,05 Miles Bader * * This file is subject to the terms and conditions of the GNU General * Public License. See the file COPYING in the main directory of this @@ -98,10 +98,20 @@ void __init trap_init (void) } #ifdef CONFIG_MTD + +/* From drivers/mtd/devices/slram.c */ +#define SLRAM_BLK_SZ 0x4000 + /* Set the root filesystem to be the given memory region. Some parameter may be appended to CMD_LINE. */ void set_mem_root (void *addr, size_t len, char *cmd_line) { + /* Some sort of idiocy in MTD means we must supply a length that's + a multiple of SLRAM_BLK_SZ. We just round up the real length, + as the file system shouldn't attempt to access anything beyond + the end of the image anyway. */ + len = (((len - 1) + SLRAM_BLK_SZ) / SLRAM_BLK_SZ) * SLRAM_BLK_SZ; + /* The only way to pass info to the MTD slram driver is via the command line. */ if (*cmd_line) { @@ -128,13 +138,13 @@ static void nmi_end (unsigned irq) } static struct hw_interrupt_type nmi_irq_type = { - "NMI", - irq_zero, /* startup */ - irq_nop, /* shutdown */ - irq_nop, /* enable */ - irq_nop, /* disable */ - irq_nop, /* ack */ - nmi_end, /* end */ + .typename = "NMI", + .startup = irq_zero, /* startup */ + .shutdown = irq_nop, /* shutdown */ + .enable = irq_nop, /* enable */ + .disable = irq_nop, /* disable */ + .ack = irq_nop, /* ack */ + .end = nmi_end, /* end */ }; void __init init_IRQ (void) @@ -284,3 +294,33 @@ init_mem_alloc (unsigned long ram_start, unsigned long ram_len) free_area_init_node (0, NODE_DATA(0), zones_size, ADDR_TO_PAGE (PAGE_OFFSET), 0); } + + + +/* Taken from m68knommu */ +void show_mem(void) +{ + unsigned long i; + int free = 0, total = 0, reserved = 0, shared = 0; + int cached = 0; + + printk(KERN_INFO "\nMem-info:\n"); + show_free_areas(); + i = max_mapnr; + while (i-- > 0) { + total++; + if (PageReserved(mem_map+i)) + reserved++; + else if (PageSwapCache(mem_map+i)) + cached++; + else if (!page_count(mem_map+i)) + free++; + else + shared += page_count(mem_map+i) - 1; + } + printk(KERN_INFO "%d pages of RAM\n",total); + printk(KERN_INFO "%d free pages\n",free); + printk(KERN_INFO "%d reserved pages\n",reserved); + printk(KERN_INFO "%d pages shared\n",shared); + printk(KERN_INFO "%d pages swap cached\n",cached); +}