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

📄 ns87312.c

📁 Linux内核源代码 为压缩文件 是<<Linux内核>>一书中的源代码
💻 C
字号:
/* *	linux/arch/alpha/kernel/ns87312.c */#include <linux/init.h>#include <asm/io.h>#include "proto.h"/* * The SRM console *disables* the IDE interface, this code ensures it's * enabled. * * This code bangs on a control register of the 87312 Super I/O chip * that implements parallel port/serial ports/IDE/FDI.  Depending on * the motherboard, the Super I/O chip can be configured through a * pair of registers that are located either at I/O ports 0x26e/0x26f * or 0x398/0x399.  Unfortunately, autodetecting which base address is * in use works only once (right after a reset).  The Super I/O chip * has the additional quirk that configuration register data must be * written twice (I believe this is a safety feature to prevent * accidental modification---fun, isn't it?). */void __initns87312_enable_ide(long ide_base){	int data;	unsigned long flags;	__save_and_cli(flags);	outb(0, ide_base);		/* set the index register for reg #0 */	data = inb(ide_base+1);		/* read the current contents */	outb(0, ide_base);		/* set the index register for reg #0 */	outb(data | 0x40, ide_base+1);	/* turn on IDE */	outb(data | 0x40, ide_base+1);	/* turn on IDE, really! */	__restore_flags(flags);}

⌨️ 快捷键说明

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