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

📄 getidprom.c

📁 操作系统SunOS 4.1.3版本的源码
💻 C
字号:
#if !defined(lint) && !defined(BOOTBLOCK)static char sccsid[] = "@(#)getidprom.c 1.1 92/07/30 SMI";#endif/* * Note: Obsoleted and replaced by prom_idprom.c. * No longer used. */#include <sys/types.h>#include <machine/param.h>#include <mon/idprom.h>#include <mon/sunromvec.h>#include <sun/openprom.h>#define	nextnode		(dnode_t)prom_nextnode#define	rootnode()		nextnode((dnode_t)0)#define	getproplen		prom_getproplen#define	getprop			prom_getprop#define	NO_FORMAT	((char)(IDFORM_1 - 1))static int idpromlength;static struct idprom idprom;/* * Get idprom from "idprom" property of root node. */chargetidprom(addr, size)	caddr_t addr;	int size;{	int length;	dnode_t rootid;	caddr_t p = addr;	if (idpromlength == 0)  {		if ((rootid = rootnode()) == OBP_BADNODE)  {			printf("getidprom: can't get root node!\n");			return (NO_FORMAT);		}		length = getproplen(rootid, OBP_IDPROM);		if (length == -1)  {			printf("Missing idprom property.\n");			return (NO_FORMAT):		}		if (length > sizeof (idprom))  {			printf("getidprom: property size <%d> too large!\n",				length);			return (NO_FORMAT);		}		idpromlength = length;		(void)getprop(rootid, OBP_IDPROM, (char *)idprom);	}	bcopy((char *)idprom, addr, size);	return (*addr);}

⌨️ 快捷键说明

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