2 * arch/ppc/amiga/bootinfo.c
4 * Extracted from arch/m68k/kernel/setup.c.
5 * Should be properly generalized and put somewhere else.
9 #include <linux/types.h>
10 #include <linux/kernel.h>
11 #include <linux/string.h>
12 #include <linux/init.h>
14 #include <asm/setup.h>
15 #include <asm/bootinfo.h>
17 extern char cmd_line[CL_SIZE];
19 extern int num_memory;
20 extern int m68k_realnum_memory;
21 extern struct mem_info memory[NUM_MEMINFO];
22 extern struct mem_info m68k_memory[NUM_MEMINFO];
23 extern struct mem_info ramdisk;
25 extern int amiga_parse_bootinfo(const struct bi_record *);
26 extern int atari_parse_bootinfo(const struct bi_record *);
27 extern int mac_parse_bootinfo(const struct bi_record *);
29 void __init parse_bootinfo(const struct bi_record *record)
31 while (record->tag != BI_LAST) {
33 const u_long *data = record->data;
34 switch (record->tag) {
39 /* Already set up by head.S */
43 if (num_memory < NUM_MEMINFO) {
44 memory[num_memory].addr = data[0];
45 memory[num_memory].size = data[1];
48 /* FIXME: duplicate for m68k drivers. */
49 m68k_memory[m68k_realnum_memory].addr = data[0];
50 m68k_memory[m68k_realnum_memory].size = data[1];
51 m68k_realnum_memory++;
53 printk("parse_bootinfo: too many memory chunks\n");
57 ramdisk.addr = data[0];
58 ramdisk.size = data[1];
62 strlcpy(cmd_line, (const char *)data, sizeof(cmd_line));
67 unknown = amiga_parse_bootinfo(record);
68 else if (MACH_IS_ATARI)
69 unknown = atari_parse_bootinfo(record);
71 unknown = mac_parse_bootinfo(record);
76 printk("parse_bootinfo: unknown tag 0x%04x ignored\n",
78 record = (struct bi_record *)((u_long)record+record->size);