2 * Extracted from arch/m68k/kernel/setup.c.
3 * Should be properly generalized and put somewhere else.
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
)
29 while (record
->tag
!= BI_LAST
) {
31 const u_long
*data
= record
->data
;
32 switch (record
->tag
) {
37 /* Already set up by head.S */
41 if (num_memory
< NUM_MEMINFO
) {
42 memory
[num_memory
].addr
= data
[0];
43 memory
[num_memory
].size
= data
[1];
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
++;
51 printk("parse_bootinfo: too many memory chunks\n");
55 ramdisk
.addr
= data
[0];
56 ramdisk
.size
= data
[1];
60 strlcpy(cmd_line
, (const char *)data
, sizeof(cmd_line
));
65 unknown
= amiga_parse_bootinfo(record
);
66 else if (MACH_IS_ATARI
)
67 unknown
= atari_parse_bootinfo(record
);
69 unknown
= mac_parse_bootinfo(record
);
74 printk("parse_bootinfo: unknown tag 0x%04x ignored\n",
76 record
= (struct bi_record
*)((u_long
)record
+record
->size
);