亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hd.c

?? linux 內核源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* *  Copyright (C) 1991, 1992  Linus Torvalds * * This is the low-level hd interrupt support. It traverses the * request-list, using interrupts to jump between functions. As * all the functions are called within interrupts, we may not * sleep. Special care is recommended. * *  modified by Drew Eckhardt to check nr of hd's from the CMOS. * *  Thanks to Branko Lankester, lankeste@fwi.uva.nl, who found a bug *  in the early extended-partition checks and added DM partitions * *  IRQ-unmask, drive-id, multiple-mode, support for ">16 heads", *  and general streamlining by Mark Lord. * *  Removed 99% of above. Use Mark's ide driver for those options. *  This is now a lightweight ST-506 driver. (Paul Gortmaker) * *  Modified 1995 Russell King for ARM processor. * *  Bugfix: max_sectors must be <= 255 or the wheels tend to come *  off in a hurry once you queue things up - Paul G. 02/2001 *//* Uncomment the following if you want verbose error reports. *//* #define VERBOSE_ERRORS */#include <linux/blkdev.h>#include <linux/errno.h>#include <linux/signal.h>#include <linux/interrupt.h>#include <linux/timer.h>#include <linux/fs.h>#include <linux/kernel.h>#include <linux/genhd.h>#include <linux/slab.h>#include <linux/string.h>#include <linux/ioport.h>#include <linux/mc146818rtc.h> /* CMOS defines */#include <linux/init.h>#include <linux/blkpg.h>#include <linux/hdreg.h>#define REALLY_SLOW_IO#include <asm/system.h>#include <asm/io.h>#include <asm/uaccess.h>#ifdef __arm__#undef  HD_IRQ#endif#include <asm/irq.h>#ifdef __arm__#define HD_IRQ IRQ_HARDDISK#endif/* Hd controller regster ports */#define HD_DATA		0x1f0		/* _CTL when writing */#define HD_ERROR	0x1f1		/* see err-bits */#define HD_NSECTOR	0x1f2		/* nr of sectors to read/write */#define HD_SECTOR	0x1f3		/* starting sector */#define HD_LCYL		0x1f4		/* starting cylinder */#define HD_HCYL		0x1f5		/* high byte of starting cyl */#define HD_CURRENT	0x1f6		/* 101dhhhh , d=drive, hhhh=head */#define HD_STATUS	0x1f7		/* see status-bits */#define HD_FEATURE	HD_ERROR	/* same io address, read=error, write=feature */#define HD_PRECOMP	HD_FEATURE	/* obsolete use of this port - predates IDE */#define HD_COMMAND	HD_STATUS	/* same io address, read=status, write=cmd */#define HD_CMD		0x3f6		/* used for resets */#define HD_ALTSTATUS	0x3f6		/* same as HD_STATUS but doesn't clear irq *//* Bits of HD_STATUS */#define ERR_STAT		0x01#define INDEX_STAT		0x02#define ECC_STAT		0x04	/* Corrected error */#define DRQ_STAT		0x08#define SEEK_STAT		0x10#define SERVICE_STAT		SEEK_STAT#define WRERR_STAT		0x20#define READY_STAT		0x40#define BUSY_STAT		0x80/* Bits for HD_ERROR */#define MARK_ERR		0x01	/* Bad address mark */#define TRK0_ERR		0x02	/* couldn't find track 0 */#define ABRT_ERR		0x04	/* Command aborted */#define MCR_ERR			0x08	/* media change request */#define ID_ERR			0x10	/* ID field not found */#define MC_ERR			0x20	/* media changed */#define ECC_ERR			0x40	/* Uncorrectable ECC error */#define BBD_ERR			0x80	/* pre-EIDE meaning:  block marked bad */#define ICRC_ERR		0x80	/* new meaning:  CRC error during transfer */static DEFINE_SPINLOCK(hd_lock);static struct request_queue *hd_queue;#define MAJOR_NR HD_MAJOR#define QUEUE (hd_queue)#define CURRENT elv_next_request(hd_queue)#define TIMEOUT_VALUE	(6*HZ)#define	HD_DELAY	0#define MAX_ERRORS     16	/* Max read/write errors/sector */#define RESET_FREQ      8	/* Reset controller every 8th retry */#define RECAL_FREQ      4	/* Recalibrate every 4th retry */#define MAX_HD		2#define STAT_OK		(READY_STAT|SEEK_STAT)#define OK_STATUS(s)	(((s)&(STAT_OK|(BUSY_STAT|WRERR_STAT|ERR_STAT)))==STAT_OK)static void recal_intr(void);static void bad_rw_intr(void);static int reset;static int hd_error;/* *  This struct defines the HD's and their types. */struct hd_i_struct {	unsigned int head,sect,cyl,wpcom,lzone,ctl;	int unit;	int recalibrate;	int special_op;};	#ifdef HD_TYPEstatic struct hd_i_struct hd_info[] = { HD_TYPE };static int NR_HD = ARRAY_SIZE(hd_info);#elsestatic struct hd_i_struct hd_info[MAX_HD];static int NR_HD;#endifstatic struct gendisk *hd_gendisk[MAX_HD];static struct timer_list device_timer;#define TIMEOUT_VALUE (6*HZ)#define SET_TIMER							\	do {								\		mod_timer(&device_timer, jiffies + TIMEOUT_VALUE);	\	} while (0)static void (*do_hd)(void) = NULL;#define SET_HANDLER(x) \if ((do_hd = (x)) != NULL) \	SET_TIMER; \else \	del_timer(&device_timer);#if (HD_DELAY > 0)#include <asm/i8253.h>unsigned long last_req;unsigned long read_timer(void){	unsigned long t, flags;	int i;	spin_lock_irqsave(&i8253_lock, flags);	t = jiffies * 11932;    	outb_p(0, 0x43);	i = inb_p(0x40);	i |= inb(0x40) << 8;	spin_unlock_irqrestore(&i8253_lock, flags);	return(t - i);}#endifstatic void __init hd_setup(char *str, int *ints){	int hdind = 0;	if (ints[0] != 3)		return;	if (hd_info[0].head != 0)		hdind=1;	hd_info[hdind].head = ints[2];	hd_info[hdind].sect = ints[3];	hd_info[hdind].cyl = ints[1];	hd_info[hdind].wpcom = 0;	hd_info[hdind].lzone = ints[1];	hd_info[hdind].ctl = (ints[2] > 8 ? 8 : 0);	NR_HD = hdind+1;}static void dump_status (const char *msg, unsigned int stat){	char *name = "hd?";	if (CURRENT)		name = CURRENT->rq_disk->disk_name;#ifdef VERBOSE_ERRORS	printk("%s: %s: status=0x%02x { ", name, msg, stat & 0xff);	if (stat & BUSY_STAT)	printk("Busy ");	if (stat & READY_STAT)	printk("DriveReady ");	if (stat & WRERR_STAT)	printk("WriteFault ");	if (stat & SEEK_STAT)	printk("SeekComplete ");	if (stat & DRQ_STAT)	printk("DataRequest ");	if (stat & ECC_STAT)	printk("CorrectedError ");	if (stat & INDEX_STAT)	printk("Index ");	if (stat & ERR_STAT)	printk("Error ");	printk("}\n");	if ((stat & ERR_STAT) == 0) {		hd_error = 0;	} else {		hd_error = inb(HD_ERROR);		printk("%s: %s: error=0x%02x { ", name, msg, hd_error & 0xff);		if (hd_error & BBD_ERR)		printk("BadSector ");		if (hd_error & ECC_ERR)		printk("UncorrectableError ");		if (hd_error & ID_ERR)		printk("SectorIdNotFound ");		if (hd_error & ABRT_ERR)	printk("DriveStatusError ");		if (hd_error & TRK0_ERR)	printk("TrackZeroNotFound ");		if (hd_error & MARK_ERR)	printk("AddrMarkNotFound ");		printk("}");		if (hd_error & (BBD_ERR|ECC_ERR|ID_ERR|MARK_ERR)) {			printk(", CHS=%d/%d/%d", (inb(HD_HCYL)<<8) + inb(HD_LCYL),				inb(HD_CURRENT) & 0xf, inb(HD_SECTOR));			if (CURRENT)				printk(", sector=%ld", CURRENT->sector);		}		printk("\n");	}#else	printk("%s: %s: status=0x%02x.\n", name, msg, stat & 0xff);	if ((stat & ERR_STAT) == 0) {		hd_error = 0;	} else {		hd_error = inb(HD_ERROR);		printk("%s: %s: error=0x%02x.\n", name, msg, hd_error & 0xff);	}#endif}static void check_status(void){	int i = inb_p(HD_STATUS);	if (!OK_STATUS(i)) {		dump_status("check_status", i);		bad_rw_intr();	}}static int controller_busy(void){	int retries = 100000;	unsigned char status;	do {		status = inb_p(HD_STATUS);	} while ((status & BUSY_STAT) && --retries);	return status;}static int status_ok(void){	unsigned char status = inb_p(HD_STATUS);	if (status & BUSY_STAT)		return 1;	/* Ancient, but does it make sense??? */	if (status & WRERR_STAT)		return 0;	if (!(status & READY_STAT))		return 0;	if (!(status & SEEK_STAT))		return 0;	return 1;}static int controller_ready(unsigned int drive, unsigned int head){	int retry = 100;	do {		if (controller_busy() & BUSY_STAT)			return 0;		outb_p(0xA0 | (drive<<4) | head, HD_CURRENT);		if (status_ok())			return 1;	} while (--retry);	return 0;}		static void hd_out(struct hd_i_struct *disk,		   unsigned int nsect,		   unsigned int sect,		   unsigned int head,		   unsigned int cyl,		   unsigned int cmd,		   void (*intr_addr)(void)){	unsigned short port;#if (HD_DELAY > 0)	while (read_timer() - last_req < HD_DELAY)		/* nothing */;#endif	if (reset)		return;	if (!controller_ready(disk->unit, head)) {		reset = 1;		return;	}	SET_HANDLER(intr_addr);	outb_p(disk->ctl,HD_CMD);	port=HD_DATA;	outb_p(disk->wpcom>>2,++port);	outb_p(nsect,++port);	outb_p(sect,++port);	outb_p(cyl,++port);	outb_p(cyl>>8,++port);	outb_p(0xA0|(disk->unit<<4)|head,++port);	outb_p(cmd,++port);}static void hd_request (void);static int drive_busy(void){	unsigned int i;	unsigned char c;	for (i = 0; i < 500000 ; i++) {		c = inb_p(HD_STATUS);		if ((c & (BUSY_STAT | READY_STAT | SEEK_STAT)) == STAT_OK)			return 0;	}	dump_status("reset timed out", c);	return 1;}static void reset_controller(void){	int	i;	outb_p(4,HD_CMD);	for(i = 0; i < 1000; i++) barrier();	outb_p(hd_info[0].ctl & 0x0f,HD_CMD);	for(i = 0; i < 1000; i++) barrier();	if (drive_busy())		printk("hd: controller still busy\n");	else if ((hd_error = inb(HD_ERROR)) != 1)		printk("hd: controller reset failed: %02x\n",hd_error);}static void reset_hd(void){	static int i;repeat:	if (reset) {		reset = 0;		i = -1;		reset_controller();	} else {		check_status();		if (reset)			goto repeat;	}	if (++i < NR_HD) {		struct hd_i_struct *disk = &hd_info[i];		disk->special_op = disk->recalibrate = 1;		hd_out(disk,disk->sect,disk->sect,disk->head-1,			disk->cyl,WIN_SPECIFY,&reset_hd);		if (reset)			goto repeat;	} else		hd_request();}/* * Ok, don't know what to do with the unexpected interrupts: on some machines * doing a reset and a retry seems to result in an eternal loop. Right now I * ignore it, and just set the timeout. * * On laptops (and "green" PCs), an unexpected interrupt occurs whenever the * drive enters "idle", "standby", or "sleep" mode, so if the status looks * "good", we just ignore the interrupt completely. */static void unexpected_hd_interrupt(void){	unsigned int stat = inb_p(HD_STATUS);	if (stat & (BUSY_STAT|DRQ_STAT|ECC_STAT|ERR_STAT)) {		dump_status ("unexpected interrupt", stat);		SET_TIMER;	}}/* * bad_rw_intr() now tries to be a bit smarter and does things * according to the error returned by the controller. * -Mika Liljeberg (liljeber@cs.Helsinki.FI) */static void bad_rw_intr(void)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品一区二区精品网| 蜜乳av一区二区三区| 日韩电影在线免费观看| 国产成人av电影| 91精品久久久久久久99蜜桃| 一区在线观看视频| 九九热在线视频观看这里只有精品 | 亚洲一卡二卡三卡四卡| 成人永久看片免费视频天堂| 日韩三级.com| 亚洲成av人**亚洲成av**| 91女神在线视频| 日韩一区在线播放| 成人午夜视频在线观看| 久久亚洲一区二区三区四区| 美女网站一区二区| 欧美一区二区三区四区久久| 午夜国产精品影院在线观看| 在线视频一区二区三区| 亚洲视频免费在线观看| voyeur盗摄精品| 国产亚洲欧美在线| 国产一区二区三区观看| 精品日韩欧美在线| 激情五月激情综合网| 欧美成人一区二区| 极品美女销魂一区二区三区| 精品久久久久久久久久久久久久久久久| 午夜a成v人精品| 欧美日韩成人综合在线一区二区| 亚洲福利视频三区| 欧美日韩成人高清| 免费观看成人av| 精品国产自在久精品国产| 精品一二三四区| 久久久久国产精品免费免费搜索| 国产一区二区h| 国产女同性恋一区二区| 99久久伊人网影院| 一区二区三区四区在线| 欧美裸体一区二区三区| 婷婷开心激情综合| 欧美v亚洲v综合ⅴ国产v| 久久精品国产第一区二区三区| 日韩三级视频中文字幕| 国产精品原创巨作av| 国产精品毛片大码女人| 一本色道**综合亚洲精品蜜桃冫 | 国产欧美日韩激情| 99在线精品观看| 一区二区不卡在线播放| 欧美日韩国产片| 激情欧美一区二区| 国产精品二区一区二区aⅴ污介绍| 色综合色狠狠天天综合色| 亚洲国产精品久久人人爱| 欧美一区二区播放| 粉嫩av一区二区三区在线播放| 一区二区三区高清在线| 欧美大片国产精品| av一区二区三区在线| 日韩高清不卡在线| 国产精品久久综合| 欧美久久久影院| 成人一区在线看| 亚洲一区二区三区四区中文字幕| 欧美xxxx在线观看| 色吊一区二区三区| 狠狠色丁香久久婷婷综| 亚洲精品国产第一综合99久久| 制服.丝袜.亚洲.中文.综合| 国产99久久久国产精品免费看| 一区二区三区四区不卡在线| 欧美tickling挠脚心丨vk| 91久久精品一区二区| 国产一区二区导航在线播放| 亚洲bdsm女犯bdsm网站| 欧美高清在线一区| 日韩女优视频免费观看| 91一区二区在线| 国产激情一区二区三区桃花岛亚洲| 一区二区三区波多野结衣在线观看| 久久一区二区三区四区| 欧美高清视频www夜色资源网| 国产不卡在线视频| 久久99日本精品| 婷婷国产v国产偷v亚洲高清| 中文字幕一区二区在线播放| 精品捆绑美女sm三区| 欧美性猛交xxxx乱大交退制版| 成人激情小说网站| 国产一区激情在线| 久久精品999| 免费精品视频在线| 污片在线观看一区二区| 一区二区三区产品免费精品久久75| 中文一区在线播放| 久久精品人人做人人综合| 日韩一级大片在线| 日韩一区二区影院| 宅男噜噜噜66一区二区66| 欧美视频完全免费看| 在线影视一区二区三区| 99久久婷婷国产综合精品电影| 从欧美一区二区三区| 国产麻豆精品在线| 国产精品亚洲视频| 国产精品一色哟哟哟| 国产一区二区三区观看| 精品一区二区日韩| 韩国成人福利片在线播放| 精品综合久久久久久8888| 麻豆91精品91久久久的内涵| 另类小说一区二区三区| 蜜桃一区二区三区在线| 狠狠色狠狠色综合| 国内不卡的二区三区中文字幕 | 午夜视频在线观看一区二区三区| 亚洲图片你懂的| 综合久久久久久| 亚洲综合色网站| 日韩在线观看一区二区| 青青草国产精品97视觉盛宴| 精品一区二区在线免费观看| 国产麻豆视频一区二区| 成人深夜福利app| 91网址在线看| 欧美色倩网站大全免费| 欧美一级二级三级乱码| 久久久久国产精品厨房| 亚洲欧洲日产国码二区| 亚洲美女视频一区| 日本亚洲天堂网| 国产成人啪免费观看软件| 99久久精品国产麻豆演员表| 精品视频资源站| 欧美大白屁股肥臀xxxxxx| 久久精品人人做人人综合| 亚洲人成网站色在线观看| 日本欧美肥老太交大片| 国产精品中文字幕一区二区三区| av亚洲精华国产精华精华| 欧美午夜电影一区| 久久夜色精品国产噜噜av| 亚洲丝袜美腿综合| 免费人成黄页网站在线一区二区| 国产精品一区二区三区网站| 91丝袜高跟美女视频| 日韩一区二区电影| 成人免费在线观看入口| 人人狠狠综合久久亚洲| av电影在线观看一区| 制服丝袜在线91| 国产精品激情偷乱一区二区∴| 日韩黄色免费电影| av在线一区二区| 亚洲精品在线观| 亚洲v日本v欧美v久久精品| 国产成人久久精品77777最新版本| 在线一区二区三区| 国产喷白浆一区二区三区| 亚洲成人av电影| www.久久久久久久久| 亚洲精品一区二区精华| 五月婷婷激情综合网| 99久久免费精品| 久久精品水蜜桃av综合天堂| 偷拍一区二区三区四区| 一本大道久久a久久综合| 久久精品亚洲麻豆av一区二区| 午夜精品福利一区二区三区av| av在线综合网| 欧美激情一区二区三区全黄| 美女一区二区视频| 欧美精品第一页| 亚洲一区在线观看免费| 成年人国产精品| 国产亚洲精久久久久久| 久久99在线观看| 日韩欧美综合一区| 香蕉影视欧美成人| 欧美午夜片在线观看| 亚洲人成网站色在线观看| 懂色av一区二区三区蜜臀| 久久久久久9999| 国产福利一区二区三区视频在线| 日韩欧美专区在线| 美国十次了思思久久精品导航| 欧美日韩国产成人在线91| 一区二区三区免费网站| 91在线porny国产在线看| 最新久久zyz资源站| 91在线观看高清| 亚洲欧美另类图片小说| 91欧美一区二区| 亚洲主播在线播放| 欧美日韩成人综合在线一区二区| 天天av天天翘天天综合网| 欧美日韩国产精选| 免费成人美女在线观看|