⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setup.c

📁 linux-2.6.15.6
💻 C
📖 第 1 页 / 共 3 页
字号:
	 * This may restore real CABRIO and EB66+ family names, ie	 * EB64+ and EB66.	 *	 * Oh, and "white box" AS800 (aka DIGITAL Server 3000 series)	 * and AS1200 (DIGITAL Server 5000 series) have the type as	 * the negative of the real one.	 */        if ((long)hwrpb->sys_type < 0) {		hwrpb->sys_type = -((long)hwrpb->sys_type);		hwrpb_update_checksum(hwrpb);	}	/* Register a call for panic conditions. */	notifier_chain_register(&panic_notifier_list, &alpha_panic_block);#ifdef CONFIG_ALPHA_GENERIC	/* Assume that we've booted from SRM if we haven't booted from MILO.	   Detect the later by looking for "MILO" in the system serial nr.  */	alpha_using_srm = strncmp((const char *)hwrpb->ssn, "MILO", 4) != 0;#endif	/* If we are using SRM, we want to allow callbacks	   as early as possible, so do this NOW, and then	   they should work immediately thereafter.	*/	kernel_end = callback_init(kernel_end);	/* 	 * Locate the command line.	 */	/* Hack for Jensen... since we're restricted to 8 or 16 chars for	   boot flags depending on the boot mode, we need some shorthand.	   This should do for installation.  */	if (strcmp(COMMAND_LINE, "INSTALL") == 0) {		strlcpy(command_line, "root=/dev/fd0 load_ramdisk=1", sizeof command_line);	} else {		strlcpy(command_line, COMMAND_LINE, sizeof command_line);	}	strcpy(saved_command_line, command_line);	*cmdline_p = command_line;	/* 	 * Process command-line arguments.	 */	while ((p = strsep(&args, " \t")) != NULL) {		if (!*p) continue;		if (strncmp(p, "alpha_mv=", 9) == 0) {			vec = get_sysvec_byname(p+9);			continue;		}		if (strncmp(p, "cycle=", 6) == 0) {			est_cycle_freq = simple_strtol(p+6, NULL, 0);			continue;		}		if (strncmp(p, "mem=", 4) == 0) {			mem_size_limit = get_mem_size_limit(p+4);			continue;		}		if (strncmp(p, "srmcons", 7) == 0) {			srmcons_output |= 1;			continue;		}		if (strncmp(p, "console=srm", 11) == 0) {			srmcons_output |= 2;			continue;		}		if (strncmp(p, "gartsize=", 9) == 0) {			alpha_agpgart_size =				get_mem_size_limit(p+9) << PAGE_SHIFT;			continue;		}#ifdef CONFIG_VERBOSE_MCHECK		if (strncmp(p, "verbose_mcheck=", 15) == 0) {			alpha_verbose_mcheck = simple_strtol(p+15, NULL, 0);			continue;		}#endif	}	/* Replace the command line, now that we've killed it with strsep.  */	strcpy(command_line, saved_command_line);	/* If we want SRM console printk echoing early, do it now. */	if (alpha_using_srm && srmcons_output) {		register_srm_console();		/*		 * If "console=srm" was specified, clear the srmcons_output		 * flag now so that time.c won't unregister_srm_console		 */		if (srmcons_output & 2)			srmcons_output = 0;	}#ifdef CONFIG_MAGIC_SYSRQ	/* If we're using SRM, make sysrq-b halt back to the prom,	   not auto-reboot.  */	if (alpha_using_srm) {		struct sysrq_key_op *op = __sysrq_get_key_op('b');		op->handler = (void *) machine_halt;	}#endif	/*	 * Identify and reconfigure for the current system.	 */	cpu = (struct percpu_struct*)((char*)hwrpb + hwrpb->processor_offset);	get_sysnames(hwrpb->sys_type, hwrpb->sys_variation,		     cpu->type, &type_name, &var_name);	if (*var_name == '0')		var_name = "";	if (!vec) {		vec = get_sysvec(hwrpb->sys_type, hwrpb->sys_variation,				 cpu->type);	}	if (!vec) {		panic("Unsupported system type: %s%s%s (%ld %ld)\n",		      type_name, (*var_name ? " variation " : ""), var_name,		      hwrpb->sys_type, hwrpb->sys_variation);	}	if (vec != &alpha_mv) {		alpha_mv = *vec;	}		printk("Booting "#ifdef CONFIG_ALPHA_GENERIC	       "GENERIC "#endif	       "on %s%s%s using machine vector %s from %s\n",	       type_name, (*var_name ? " variation " : ""),	       var_name, alpha_mv.vector_name,	       (alpha_using_srm ? "SRM" : "MILO"));	printk("Major Options: "#ifdef CONFIG_SMP	       "SMP "#endif#ifdef CONFIG_ALPHA_EV56	       "EV56 "#endif#ifdef CONFIG_ALPHA_EV67	       "EV67 "#endif#ifdef CONFIG_ALPHA_LEGACY_START_ADDRESS	       "LEGACY_START "#endif#ifdef CONFIG_VERBOSE_MCHECK	       "VERBOSE_MCHECK "#endif#ifdef CONFIG_DISCONTIGMEM	       "DISCONTIGMEM "#ifdef CONFIG_NUMA	       "NUMA "#endif#endif#ifdef CONFIG_DEBUG_SPINLOCK	       "DEBUG_SPINLOCK "#endif#ifdef CONFIG_MAGIC_SYSRQ	       "MAGIC_SYSRQ "#endif	       "\n");	printk("Command line: %s\n", command_line);	/* 	 * Sync up the HAE.	 * Save the SRM's current value for restoration.	 */	srm_hae = *alpha_mv.hae_register;	__set_hae(alpha_mv.hae_cache);	/* Reset enable correctable error reports.  */	wrmces(0x7);	/* Find our memory.  */	setup_memory(kernel_end);	/* First guess at cpu cache sizes.  Do this before init_arch.  */	determine_cpu_caches(cpu->type);	/* Initialize the machine.  Usually has to do with setting up	   DMA windows and the like.  */	if (alpha_mv.init_arch)		alpha_mv.init_arch();	/* Reserve standard resources.  */	reserve_std_resources();	/* 	 * Give us a default console.  TGA users will see nothing until	 * chr_dev_init is called, rather late in the boot sequence.	 */#ifdef CONFIG_VT#if defined(CONFIG_VGA_CONSOLE)	conswitchp = &vga_con;#elif defined(CONFIG_DUMMY_CONSOLE)	conswitchp = &dummy_con;#endif#endif	/* Default root filesystem to sda2.  */	ROOT_DEV = Root_SDA2;#ifdef CONFIG_EISA	/* FIXME:  only set this when we actually have EISA in this box? */	EISA_bus = 1;#endif 	/*	 * Check ASN in HWRPB for validity, report if bad.	 * FIXME: how was this failing?  Should we trust it instead,	 * and copy the value into alpha_mv.max_asn? 	 */ 	if (hwrpb->max_asn != MAX_ASN) {		printk("Max ASN from HWRPB is bad (0x%lx)\n", hwrpb->max_asn); 	}	/*	 * Identify the flock of penguins.	 */#ifdef CONFIG_SMP	setup_smp();#endif	paging_init();}void __initdisable_early_printk(void){	if (alpha_using_srm && srmcons_output) {		unregister_srm_console();		srmcons_output = 0;	}}static char sys_unknown[] = "Unknown";static char systype_names[][16] = {	"0",	"ADU", "Cobra", "Ruby", "Flamingo", "Mannequin", "Jensen",	"Pelican", "Morgan", "Sable", "Medulla", "Noname",	"Turbolaser", "Avanti", "Mustang", "Alcor", "Tradewind",	"Mikasa", "EB64", "EB66", "EB64+", "AlphaBook1",	"Rawhide", "K2", "Lynx", "XL", "EB164", "Noritake",	"Cortex", "29", "Miata", "XXM", "Takara", "Yukon",	"Tsunami", "Wildfire", "CUSCO", "Eiger", "Titan", "Marvel"};static char unofficial_names[][8] = {"100", "Ruffian"};static char api_names[][16] = {"200", "Nautilus"};static char eb164_names[][8] = {"EB164", "PC164", "LX164", "SX164", "RX164"};static int eb164_indices[] = {0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,3,4};static char alcor_names[][16] = {"Alcor", "Maverick", "Bret"};static int alcor_indices[] = {0,0,0,1,1,1,0,0,0,0,0,0,2,2,2,2,2,2};static char eb64p_names[][16] = {"EB64+", "Cabriolet", "AlphaPCI64"};static int eb64p_indices[] = {0,0,1,2};static char eb66_names[][8] = {"EB66", "EB66+"};static int eb66_indices[] = {0,0,1};static char marvel_names[][16] = {	"Marvel/EV7"};static int marvel_indices[] = { 0 };static char rawhide_names[][16] = {	"Dodge", "Wrangler", "Durango", "Tincup", "DaVinci"};static int rawhide_indices[] = {0,0,0,1,1,2,2,3,3,4,4};static char titan_names[][16] = {	"DEFAULT", "Privateer", "Falcon", "Granite"};static int titan_indices[] = {0,1,2,2,3};static char tsunami_names[][16] = {	"0", "DP264", "Warhol", "Windjammer", "Monet", "Clipper",	"Goldrush", "Webbrick", "Catamaran", "Brisbane", "Melbourne",	"Flying Clipper", "Shark"};static int tsunami_indices[] = {0,1,2,3,4,5,6,7,8,9,10,11,12};static struct alpha_machine_vector * __initget_sysvec(unsigned long type, unsigned long variation, unsigned long cpu){	static struct alpha_machine_vector *systype_vecs[] __initdata =	{		NULL,		/* 0 */		NULL,		/* ADU */		NULL,		/* Cobra */		NULL,		/* Ruby */		NULL,		/* Flamingo */		NULL,		/* Mannequin */		&jensen_mv,		NULL, 		/* Pelican */		NULL,		/* Morgan */		NULL,		/* Sable -- see below.  */		NULL,		/* Medulla */		&noname_mv,		NULL,		/* Turbolaser */		&avanti_mv,		NULL,		/* Mustang */		NULL,		/* Alcor, Bret, Maverick. HWRPB inaccurate? */		NULL,		/* Tradewind */		NULL,		/* Mikasa -- see below.  */		NULL,		/* EB64 */		NULL,		/* EB66 -- see variation.  */		NULL,		/* EB64+ -- see variation.  */		&alphabook1_mv,		&rawhide_mv,		NULL,		/* K2 */		&lynx_mv,	/* Lynx */		&xl_mv,		NULL,		/* EB164 -- see variation.  */		NULL,		/* Noritake -- see below.  */		NULL,		/* Cortex */		NULL,		/* 29 */		&miata_mv,		NULL,		/* XXM */		&takara_mv,		NULL,		/* Yukon */		NULL,		/* Tsunami -- see variation.  */		&wildfire_mv,	/* Wildfire */		NULL,		/* CUSCO */		&eiger_mv,	/* Eiger */		NULL,		/* Titan */		NULL,		/* Marvel */	};	static struct alpha_machine_vector *unofficial_vecs[] __initdata =	{		NULL,		/* 100 */		&ruffian_mv,	};	static struct alpha_machine_vector *api_vecs[] __initdata =	{		NULL,		/* 200 */		&nautilus_mv,	};	static struct alpha_machine_vector *alcor_vecs[] __initdata = 	{		&alcor_mv, &xlt_mv, &xlt_mv	};	static struct alpha_machine_vector *eb164_vecs[] __initdata =	{		&eb164_mv, &pc164_mv, &lx164_mv, &sx164_mv, &rx164_mv	};	static struct alpha_machine_vector *eb64p_vecs[] __initdata =	{		&eb64p_mv,		&cabriolet_mv,		&cabriolet_mv		/* AlphaPCI64 */	};	static struct alpha_machine_vector *eb66_vecs[] __initdata =	{		&eb66_mv,		&eb66p_mv	};	static struct alpha_machine_vector *marvel_vecs[] __initdata =	{		&marvel_ev7_mv,	};	static struct alpha_machine_vector *titan_vecs[] __initdata =	{		&titan_mv,		/* default   */		&privateer_mv,		/* privateer */		&titan_mv,		/* falcon    */		&privateer_mv,		/* granite   */	};	static struct alpha_machine_vector *tsunami_vecs[]  __initdata =	{		NULL,		&dp264_mv,		/* dp264 */		&dp264_mv,		/* warhol */		&dp264_mv,		/* windjammer */		&monet_mv,		/* monet */		&clipper_mv,		/* clipper */		&dp264_mv,		/* goldrush */		&webbrick_mv,		/* webbrick */		&dp264_mv,		/* catamaran */		NULL,			/* brisbane? */		NULL,			/* melbourne? */		NULL,			/* flying clipper? */		&shark_mv,		/* shark */	};	/* ??? Do we need to distinguish between Rawhides?  */	struct alpha_machine_vector *vec;	/* Search the system tables first... */	vec = NULL;	if (type < N(systype_vecs)) {		vec = systype_vecs[type];	} else if ((type > ST_API_BIAS) &&		   (type - ST_API_BIAS) < N(api_vecs)) {		vec = api_vecs[type - ST_API_BIAS];	} else if ((type > ST_UNOFFICIAL_BIAS) &&		   (type - ST_UNOFFICIAL_BIAS) < N(unofficial_vecs)) {		vec = unofficial_vecs[type - ST_UNOFFICIAL_BIAS];	}	/* If we've not found one, try for a variation.  */	if (!vec) {		/* Member ID is a bit-field. */		unsigned long member = (variation >> 10) & 0x3f;		cpu &= 0xffffffff; /* make it usable */		switch (type) {		case ST_DEC_ALCOR:			if (member < N(alcor_indices))				vec = alcor_vecs[alcor_indices[member]];			break;		case ST_DEC_EB164:			if (member < N(eb164_indices))				vec = eb164_vecs[eb164_indices[member]];			/* PC164 may show as EB164 variation with EV56 CPU,			   but, since no true EB164 had anything but EV5... */			if (vec == &eb164_mv && cpu == EV56_CPU)				vec = &pc164_mv;			break;		case ST_DEC_EB64P:			if (member < N(eb64p_indices))				vec = eb64p_vecs[eb64p_indices[member]];			break;		case ST_DEC_EB66:			if (member < N(eb66_indices))				vec = eb66_vecs[eb66_indices[member]];			break;		case ST_DEC_MARVEL:			if (member < N(marvel_indices))				vec = marvel_vecs[marvel_indices[member]];			break;		case ST_DEC_TITAN:			vec = titan_vecs[0];	/* default */			if (member < N(titan_indices))				vec = titan_vecs[titan_indices[member]];			break;		case ST_DEC_TSUNAMI:			if (member < N(tsunami_indices))				vec = tsunami_vecs[tsunami_indices[member]];			break;		case ST_DEC_1000:			if (cpu == EV5_CPU || cpu == EV56_CPU)				vec = &mikasa_primo_mv;			else				vec = &mikasa_mv;			break;		case ST_DEC_NORITAKE:			if (cpu == EV5_CPU || cpu == EV56_CPU)				vec = &noritake_primo_mv;			else				vec = &noritake_mv;			break;		case ST_DEC_2100_A500:			if (cpu == EV5_CPU || cpu == EV56_CPU)				vec = &sable_gamma_mv;			else				vec = &sable_mv;			break;		}	}	return vec;}static struct alpha_machine_vector * __initget_sysvec_byname(const char *name){	static struct alpha_machine_vector *all_vecs[] __initdata =	{		&alcor_mv,		&alphabook1_mv,		&avanti_mv,		&cabriolet_mv,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -