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

📄 misc.c

📁 Linux内核源代码 为压缩文件 是<<Linux内核>>一书中的源代码
💻 C
字号:
/* $Id: misc.c,v 1.15 1997/05/14 20:45:00 davem Exp $ * misc.c:  Miscellaneous prom functions that don't belong *          anywhere else. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) */#include <linux/types.h>#include <linux/kernel.h>#include <linux/sched.h>#include <asm/sun3-head.h>#include <asm/idprom.h>#include <asm/openprom.h>#include <asm/oplib.h>#include <asm/movs.h>/* Reset and reboot the machine with the command 'bcommand'. */voidprom_reboot(char *bcommand){	unsigned long flags;	save_flags(flags); cli();	(*(romvec->pv_reboot))(bcommand);	restore_flags(flags);}/* Drop into the prom, with the chance to continue with the 'go' * prom command. */voidprom_cmdline(void){}/* Drop into the prom, but completely terminate the program. * No chance of continuing. */voidprom_halt(void){	unsigned long flags;again:	save_flags(flags); cli();	(*(romvec->pv_halt))();	restore_flags(flags);	goto again; /* PROM is out to get me -DaveM */}typedef void (*sfunc_t)(void);/* Get the idprom and stuff it into buffer 'idbuf'.  Returns the * format type.  'num_bytes' is the number of bytes that your idbuf * has space for.  Returns 0xff on error. */unsigned charprom_get_idprom(char *idbuf, int num_bytes){	int i, oldsfc;	GET_SFC(oldsfc);	SET_SFC(FC_CONTROL);	for(i=0;i<num_bytes; i++)	{		/* There is a problem with the GET_CONTROL_BYTE		macro; defining the extra variable		gets around it.		*/		int c;		GET_CONTROL_BYTE(SUN3_IDPROM_BASE + i, c);		idbuf[i] = c;	}	SET_SFC(oldsfc);	return idbuf[0];}/* Get the major prom version number. */intprom_version(void){	return romvec->pv_romvers;}/* Get the prom plugin-revision. */intprom_getrev(void){	return prom_rev;}/* Get the prom firmware print revision. */intprom_getprev(void){	return prom_prev;}

⌨️ 快捷键说明

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