diff options
Diffstat (limited to 'arch/v850/kernel/setup.c')
-rw-r--r-- | arch/v850/kernel/setup.c | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/arch/v850/kernel/setup.c b/arch/v850/kernel/setup.c index c41d72b01b88..abd48409dcca 100644 --- a/arch/v850/kernel/setup.c +++ b/arch/v850/kernel/setup.c | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * arch/v850/kernel/setup.c -- Arch-dependent initialization functions | 2 | * arch/v850/kernel/setup.c -- Arch-dependent initialization functions |
3 | * | 3 | * |
4 | * Copyright (C) 2001,02,03 NEC Electronics Corporation | 4 | * Copyright (C) 2001,02,03,05 NEC Electronics Corporation |
5 | * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> | 5 | * Copyright (C) 2001,02,03,05 Miles Bader <miles@gnu.org> |
6 | * | 6 | * |
7 | * This file is subject to the terms and conditions of the GNU General | 7 | * This file is subject to the terms and conditions of the GNU General |
8 | * Public License. See the file COPYING in the main directory of this | 8 | * Public License. See the file COPYING in the main directory of this |
@@ -98,10 +98,20 @@ void __init trap_init (void) | |||
98 | } | 98 | } |
99 | 99 | ||
100 | #ifdef CONFIG_MTD | 100 | #ifdef CONFIG_MTD |
101 | |||
102 | /* From drivers/mtd/devices/slram.c */ | ||
103 | #define SLRAM_BLK_SZ 0x4000 | ||
104 | |||
101 | /* Set the root filesystem to be the given memory region. | 105 | /* Set the root filesystem to be the given memory region. |
102 | Some parameter may be appended to CMD_LINE. */ | 106 | Some parameter may be appended to CMD_LINE. */ |
103 | void set_mem_root (void *addr, size_t len, char *cmd_line) | 107 | void set_mem_root (void *addr, size_t len, char *cmd_line) |
104 | { | 108 | { |
109 | /* Some sort of idiocy in MTD means we must supply a length that's | ||
110 | a multiple of SLRAM_BLK_SZ. We just round up the real length, | ||
111 | as the file system shouldn't attempt to access anything beyond | ||
112 | the end of the image anyway. */ | ||
113 | len = (((len - 1) + SLRAM_BLK_SZ) / SLRAM_BLK_SZ) * SLRAM_BLK_SZ; | ||
114 | |||
105 | /* The only way to pass info to the MTD slram driver is via | 115 | /* The only way to pass info to the MTD slram driver is via |
106 | the command line. */ | 116 | the command line. */ |
107 | if (*cmd_line) { | 117 | if (*cmd_line) { |
@@ -284,3 +294,33 @@ init_mem_alloc (unsigned long ram_start, unsigned long ram_len) | |||
284 | free_area_init_node (0, NODE_DATA(0), zones_size, | 294 | free_area_init_node (0, NODE_DATA(0), zones_size, |
285 | ADDR_TO_PAGE (PAGE_OFFSET), 0); | 295 | ADDR_TO_PAGE (PAGE_OFFSET), 0); |
286 | } | 296 | } |
297 | |||
298 | |||
299 | |||
300 | /* Taken from m68knommu */ | ||
301 | void show_mem(void) | ||
302 | { | ||
303 | unsigned long i; | ||
304 | int free = 0, total = 0, reserved = 0, shared = 0; | ||
305 | int cached = 0; | ||
306 | |||
307 | printk(KERN_INFO "\nMem-info:\n"); | ||
308 | show_free_areas(); | ||
309 | i = max_mapnr; | ||
310 | while (i-- > 0) { | ||
311 | total++; | ||
312 | if (PageReserved(mem_map+i)) | ||
313 | reserved++; | ||
314 | else if (PageSwapCache(mem_map+i)) | ||
315 | cached++; | ||
316 | else if (!page_count(mem_map+i)) | ||
317 | free++; | ||
318 | else | ||
319 | shared += page_count(mem_map+i) - 1; | ||
320 | } | ||
321 | printk(KERN_INFO "%d pages of RAM\n",total); | ||
322 | printk(KERN_INFO "%d free pages\n",free); | ||
323 | printk(KERN_INFO "%d reserved pages\n",reserved); | ||
324 | printk(KERN_INFO "%d pages shared\n",shared); | ||
325 | printk(KERN_INFO "%d pages swap cached\n",cached); | ||
326 | } | ||