コード例 #1
0
ファイル: bootinfo.c プロジェクト: 3sOx/asuswrt-merlin
void __init parse_bootinfo(const struct bi_record *record)
{
    while (record->tag != BI_LAST) {
	int unknown = 0;
	const u_long *data = record->data;
	switch (record->tag) {
	    case BI_MACHTYPE:
	    case BI_CPUTYPE:
	    case BI_FPUTYPE:
	    case BI_MMUTYPE:
		/* Already set up by head.S */
		break;

	    case BI_MEMCHUNK:
		if (num_memory < NUM_MEMINFO) {
		    memory[num_memory].addr = data[0];
		    memory[num_memory].size = data[1];
		    num_memory++;

		    /* FIXME: duplicate for m68k drivers. */
		    m68k_memory[m68k_realnum_memory].addr = data[0];
		    m68k_memory[m68k_realnum_memory].size = data[1];
		    m68k_realnum_memory++;
		} else
		    printk("parse_bootinfo: too many memory chunks\n");
		break;

	    case BI_RAMDISK:
		ramdisk.addr = data[0];
		ramdisk.size = data[1];
		break;

	    case BI_COMMAND_LINE:
		strlcpy(cmd_line, (const char *)data, sizeof(cmd_line));
		break;

	    default:
		if (MACH_IS_AMIGA)
		    unknown = amiga_parse_bootinfo(record);
		else if (MACH_IS_ATARI)
		    unknown = atari_parse_bootinfo(record);
		else if (MACH_IS_MAC)
		    unknown = mac_parse_bootinfo(record);
		else
		    unknown = 1;
	}
	if (unknown)
	    printk("parse_bootinfo: unknown tag 0x%04x ignored\n",
		   record->tag);
	record = (struct bi_record *)((u_long)record+record->size);
    }
}
コード例 #2
0
static void __init m68k_parse_bootinfo(const struct bi_record *record)
{
	while (record->tag != BI_LAST) {
		int unknown = 0;
		const unsigned long *data = record->data;

		switch (record->tag) {
		case BI_MACHTYPE:
		case BI_CPUTYPE:
		case BI_FPUTYPE:
		case BI_MMUTYPE:
			/* Already set up by head.S */
			break;

		case BI_MEMCHUNK:
			if (m68k_num_memory < NUM_MEMINFO) {
				m68k_memory[m68k_num_memory].addr = data[0];
				m68k_memory[m68k_num_memory].size = data[1];
				m68k_num_memory++;
			} else
				printk("m68k_parse_bootinfo: too many memory chunks\n");
			break;

		case BI_RAMDISK:
			m68k_ramdisk.addr = data[0];
			m68k_ramdisk.size = data[1];
			break;

		case BI_COMMAND_LINE:
			strlcpy(m68k_command_line, (const char *)data,
				sizeof(m68k_command_line));
			break;

		default:
			if (MACH_IS_AMIGA)
				unknown = amiga_parse_bootinfo(record);
			else if (MACH_IS_ATARI)
				unknown = atari_parse_bootinfo(record);
			else if (MACH_IS_MAC)
				unknown = mac_parse_bootinfo(record);
			else if (MACH_IS_Q40)
				unknown = q40_parse_bootinfo(record);
			else if (MACH_IS_BVME6000)
				unknown = bvme6000_parse_bootinfo(record);
			else if (MACH_IS_MVME16x)
				unknown = mvme16x_parse_bootinfo(record);
			else if (MACH_IS_MVME147)
				unknown = mvme147_parse_bootinfo(record);
			else if (MACH_IS_HP300)
				unknown = hp300_parse_bootinfo(record);
			else if (MACH_IS_APOLLO)
				unknown = apollo_parse_bootinfo(record);
			else
				unknown = 1;
		}
		if (unknown)
			printk("m68k_parse_bootinfo: unknown tag 0x%04x ignored\n",
			       record->tag);
		record = (struct bi_record *)((unsigned long)record +
					      record->size);
	}

	m68k_realnum_memory = m68k_num_memory;
#ifdef CONFIG_SINGLE_MEMORY_CHUNK
	if (m68k_num_memory > 1) {
		printk("Ignoring last %i chunks of physical memory\n",
		       (m68k_num_memory - 1));
		m68k_num_memory = 1;
	}
#endif
}