ia64/linux-2.6.18-xen.hg

view arch/ppc/amiga/bootinfo.c @ 647:a5bb490065f6

Fix the build after public header sync.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Aug 13 14:01:49 2008 +0100 (2008-08-13)
parents 831230e53067
children
line source
1 /*
2 * Extracted from arch/m68k/kernel/setup.c.
3 * Should be properly generalized and put somewhere else.
4 * Jesper
5 */
7 #include <linux/types.h>
8 #include <linux/kernel.h>
9 #include <linux/string.h>
10 #include <linux/init.h>
12 #include <asm/setup.h>
13 #include <asm/bootinfo.h>
15 extern char cmd_line[CL_SIZE];
17 extern int num_memory;
18 extern int m68k_realnum_memory;
19 extern struct mem_info memory[NUM_MEMINFO];
20 extern struct mem_info m68k_memory[NUM_MEMINFO];
21 extern struct mem_info ramdisk;
23 extern int amiga_parse_bootinfo(const struct bi_record *);
24 extern int atari_parse_bootinfo(const struct bi_record *);
25 extern int mac_parse_bootinfo(const struct bi_record *);
27 void __init parse_bootinfo(const struct bi_record *record)
28 {
29 while (record->tag != BI_LAST) {
30 int unknown = 0;
31 const u_long *data = record->data;
32 switch (record->tag) {
33 case BI_MACHTYPE:
34 case BI_CPUTYPE:
35 case BI_FPUTYPE:
36 case BI_MMUTYPE:
37 /* Already set up by head.S */
38 break;
40 case BI_MEMCHUNK:
41 if (num_memory < NUM_MEMINFO) {
42 memory[num_memory].addr = data[0];
43 memory[num_memory].size = data[1];
44 num_memory++;
46 /* FIXME: duplicate for m68k drivers. */
47 m68k_memory[m68k_realnum_memory].addr = data[0];
48 m68k_memory[m68k_realnum_memory].size = data[1];
49 m68k_realnum_memory++;
50 } else
51 printk("parse_bootinfo: too many memory chunks\n");
52 break;
54 case BI_RAMDISK:
55 ramdisk.addr = data[0];
56 ramdisk.size = data[1];
57 break;
59 case BI_COMMAND_LINE:
60 strlcpy(cmd_line, (const char *)data, sizeof(cmd_line));
61 break;
63 default:
64 if (MACH_IS_AMIGA)
65 unknown = amiga_parse_bootinfo(record);
66 else if (MACH_IS_ATARI)
67 unknown = atari_parse_bootinfo(record);
68 else if (MACH_IS_MAC)
69 unknown = mac_parse_bootinfo(record);
70 else
71 unknown = 1;
72 }
73 if (unknown)
74 printk("parse_bootinfo: unknown tag 0x%04x ignored\n",
75 record->tag);
76 record = (struct bi_record *)((u_long)record+record->size);
77 }
78 }