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

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

?? pciregions.c

?? LINUX設備驅動2源代碼
?? C
字號:
/* * pciregions.c --  a module that prints address regions of PCI devices * * $Id: pciregions.c,v 1.9 2001/03/16 11:30:23 rubini Exp $ * * Copyright (C) 1997,2001   rubini@linux.it (Alessandro Rubini) * *   This program is free software; you can redistribute it and/or modify *   it under the terms of the GNU General Public License as published by *   the Free Software Foundation; either version 2 of the License, or *   (at your option) any later version. * *   This program is distributed in the hope that it will be useful, *   but WITHOUT ANY WARRANTY; without even the implied warranty of *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *   GNU General Public License for more details. * *   You should have received a copy of the GNU General Public License *   along with this program; if not, write to the Free Software *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */#ifndef __KERNEL__#  define __KERNEL__#endif#ifndef MODULE#  define MODULE#endif#include <linux/config.h>#include <linux/module.h>#include <linux/sched.h>#include <linux/delay.h>#include <linux/proc_fs.h>#include <linux/pci.h>#include "sysdep.h"static u32 addresses[] = {    PCI_BASE_ADDRESS_0,    PCI_BASE_ADDRESS_1,    PCI_BASE_ADDRESS_2,    PCI_BASE_ADDRESS_3,    PCI_BASE_ADDRESS_4,    PCI_BASE_ADDRESS_5,    0};int pciregions_read_proc(char *buf, char **start, off_t offset,                   int len, int *eof, void *data){    int i, pos=0;    int bus, devfn, is_multi = 0;    unsigned char headertype, pribus, secbus;    u16 vendorid, deviceid = 0;    /* to print information about several buses, keep an array of them */    #define MAXNBUS 8    int buses[MAXNBUS] = {0,};    int lastbus = 0; /* only one bus, by default, bus 0 */    int busindex = 0;    /* this macro helps keeping the following lines short */    #define PRINTF(fmt, args...) sprintf(buf+len, fmt, ## args)    len=0;    /* Loop through the devices (code not printed in the book) */    if (!pci_present())        return sprintf(buf, "PCI not available in this computer\n");    bus = buses[busindex]; /* first bus (bus 0) */    for (devfn=0; pos < PAGE_SIZE; devfn++) {	struct pci_dev *dev = NULL;	/*	 * A clean implementation	 * would have a separate function to dump a single bus, but i	 * preferred to keep it in one function to include part of it	 * in the book (the printed code is automagically extracted from	 * this file).	 *	 * Instead, I use a dirty trick to fold two loops in one.	 */	if (devfn > 0xff) { /* end of this bus */	    if (busindex == lastbus) break; 	    /* loop over to the next bus */	    bus = buses[++busindex];	    devfn = 0;	}	/*	 * This code is derived from "drivers/pci/pci.c" in version	 * 2.0, although it has been modified to work with the 2.4 interface.	 * This means that the GPL applies to this source file	 * and credit is due to the original authors	 * (Drew Eckhardt, Frederic Potter, David Mosberger-Tang)	 */        if (PCI_FUNC(devfn) && !is_multi) /* not multi-function */	    continue;	dev = pci_find_slot(bus, devfn);	if (!dev) {	    if (!PCI_FUNC(devfn)) is_multi = 0; /* no first implies no other */	    continue; /* no such device */	}	pci_read_config_byte(dev, PCI_HEADER_TYPE, &headertype);        if (!PCI_FUNC(devfn)) /* first function */	    is_multi = headertype & 0x80;	headertype &= 0x7f; /* mask multi-function bit */	/* FIXME: should get rid of the PAGE_SIZE limit */        if (len > PAGE_SIZE / 2) { /* a big margin, just to be sure */	    *eof = 1; return len;	}	vendorid = dev->vendor;	deviceid = dev->device;        len += PRINTF("Bus %i, device %2i, devfn %2i (id %04x-%04x,"		      " headertype 0x%02x)\n",		      bus, devfn>>3, devfn & 7,		      vendorid, deviceid, headertype);	if (headertype == PCI_HEADER_TYPE_BRIDGE) {	    /* This is a bridge, print what it does */	    pci_read_config_byte(dev, PCI_PRIMARY_BUS, &pribus);	    pci_read_config_byte(dev, PCI_SECONDARY_BUS, &secbus);	    len += PRINTF("\tbridge connecting PCI bus %i to PCI bus %i\n",			  secbus, pribus);	    /* remember about this bus, to dump it later */	    if (lastbus <= MAXNBUS-1) {		lastbus++;		buses[lastbus] = secbus;		len += PRINTF("\t(bus %i is dumped below)\n", secbus);	    } else {		len += PRINTF("\t(bus %i won't be dumped)\n", secbus);	    }	    pci_release_device(dev); /* 2.0 compatibility */	    continue;	} else if (headertype == PCI_HEADER_TYPE_CARDBUS) {	    /* This is a CardBus bridge, print what it does */	    pci_read_config_byte(dev, PCI_CB_PRIMARY_BUS,&pribus);	    pci_read_config_byte(dev, PCI_CB_CARD_BUS,&secbus);	    len += PRINTF("\tbridge connecting CardBus %i to PCI bus %i\n",			  secbus, pribus);	    pci_release_device(dev); /* 2.0 compatibility */	    continue;	} else if (headertype != PCI_HEADER_TYPE_NORMAL) {	    len += PRINTF("\tunknown header type, skipping\n");	    pci_release_device(dev); /* 2.0 compatibility */	    continue;	}		        /* Print the address regions of this device */        for (i=0; addresses[i]; i++) {            u32 curr, mask, size;            char *type;            pci_read_config_dword(dev, addresses[i],&curr);            cli();            pci_write_config_dword(dev, addresses[i],~0);            pci_read_config_dword(dev, addresses[i],&mask);            pci_write_config_dword(dev, addresses[i],curr);            sti();            if (!mask)		continue; /* there may be other regions */	    /*	     * apply the I/O or memory mask to current position	     * note that I/O is limited to 0xffff, and 64-bit is not	     * supported by this simple imeplementation	     */	    if (curr & PCI_BASE_ADDRESS_SPACE_IO) {		curr &= PCI_BASE_ADDRESS_IO_MASK;	    } else {		curr &= PCI_BASE_ADDRESS_MEM_MASK;	    }		            len += PRINTF("\tregion %i: mask 0x%08lx, now at 0x%08lx\n", i,                           (unsigned long)mask,                           (unsigned long)curr);            /* extract the type, and the programmable bits */            if (mask & PCI_BASE_ADDRESS_SPACE_IO) {                type = "I/O"; mask &= PCI_BASE_ADDRESS_IO_MASK;		size = (~mask + 1) & 0xffff; /* Bleah */            } else {                type = "mem"; mask &= PCI_BASE_ADDRESS_MEM_MASK;		size = ~mask + 1;            }            len += PRINTF("\tregion %i: type %s, size %i (%i%s)\n", i,                          type, size,			  (size & 0xfffff) == 0 ? size >> 20 :			    (size & 0x3ff) == 0 ? size >> 10 : size,			  (size & 0xfffff) == 0 ? "MB" :			    (size & 0x3ff) == 0 ? "KB" : "B");	    if (len > PAGE_SIZE / 2) {		len += PRINTF("... more info skipped ...\n");		*eof = 1; return len;	    }        }	pci_release_device(dev); /* 2.0 compatibility */    } /* devfn */    *eof = 1;    return len;}#ifdef USE_PROC_REGISTERstatic int pciregions_old_read_proc(char *buf, char **start, off_t offset,				 int len, int unused){    int eof;    return pciregions_read_proc(buf, start, offset, len, &eof, NULL);}struct proc_dir_entry pciregions_proc_entry = {        0,                 /* low_ino: the inode -- dynamic */       10, "pciregions",   /* len of name and name */        S_IFREG | S_IRUGO, /* mode */        1, 0, 0,           /* nlinks, owner, group */        0, NULL,           /* size - unused; operations -- use default */        &pciregions_old_read_proc,   /* function used to read data */        /* nothing more */    };#endif /* USE_PROC_REGISTER */int init_module(void){#ifdef USE_PROC_REGISTER    proc_register_dynamic(&proc_root, &pciregions_proc_entry);#else    create_proc_read_entry("pciregions", 0, NULL, pciregions_read_proc, NULL);#endif    return 0;}void cleanup_module(void){#ifdef USE_PROC_REGISTER    proc_unregister(&proc_root, pciregions_proc_entry.low_ino);#else    remove_proc_entry("pciregions", 0);#endif}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美日韩视频一区二区| 国产欧美一区二区精品忘忧草| 国产成人自拍在线| 国产一区二三区好的| 麻豆传媒一区二区三区| 麻豆成人免费电影| 久久99精品国产麻豆不卡| 国产一区二区美女| 福利视频网站一区二区三区| 国产成人精品免费网站| 成人av动漫网站| 99re亚洲国产精品| 欧美日韩和欧美的一区二区| 51精品久久久久久久蜜臀| 欧美va亚洲va在线观看蝴蝶网| 久久这里都是精品| 国产精品久久久久永久免费观看| 国产精品成人免费在线| 亚洲成人av中文| 韩国女主播成人在线| 波多野结衣亚洲| 欧美日韩中文另类| 精品国产精品网麻豆系列| 亚洲国产高清在线| 亚洲高清一区二区三区| 精品在线免费视频| www.在线成人| 555夜色666亚洲国产免| 国产欧美日韩卡一| 亚洲国产一区在线观看| 国产精品中文字幕日韩精品| 91成人免费在线视频| 欧美成人一区二区三区片免费 | 色哟哟国产精品| 欧美少妇一区二区| 久久先锋资源网| 一二三区精品视频| 国产一区二区精品久久99| 99国产麻豆精品| 日韩一级片在线观看| 成人免费一区二区三区视频| 日韩国产在线一| 99视频超级精品| 日韩精品一区二区三区视频播放| 中文字幕日韩欧美一区二区三区| 偷拍亚洲欧洲综合| 成人性生交大合| 欧美刺激脚交jootjob| 亚洲综合另类小说| 成人午夜av电影| 日韩欧美国产三级| 亚洲国产一二三| 91网上在线视频| 久久久激情视频| 捆绑调教美女网站视频一区| 欧美在线免费视屏| 国产精品久久久久影院色老大| 久久99精品久久久久久久久久久久 | 欧美日韩中文字幕一区二区| 国产精品久久毛片| 国产麻豆精品视频| 精品日韩99亚洲| 麻豆中文一区二区| 日韩亚洲欧美综合| 轻轻草成人在线| 欧美片网站yy| 日韩一区精品视频| 精品污污网站免费看| 一区二区三区丝袜| 色综合激情久久| 一区二区三区精品| 色狠狠av一区二区三区| 亚洲乱码日产精品bd| 色婷婷综合久色| **网站欧美大片在线观看| 懂色av一区二区夜夜嗨| 亚洲国产精品成人综合色在线婷婷 | 最新热久久免费视频| 成av人片一区二区| 亚洲欧美一区二区三区久本道91| 成人久久视频在线观看| 中文字幕一区二区三区在线观看| av在线播放不卡| 亚洲狠狠丁香婷婷综合久久久| 91福利在线看| 日韩精品一二三四| 日韩欧美一级特黄在线播放| 美国毛片一区二区三区| 久久综合久久综合久久| 国产精品一区二区免费不卡| 国产精品丝袜在线| 欧美影片第一页| 免费成人在线观看视频| 国产日韩av一区| 91在线看国产| 性做久久久久久| 精品国产髙清在线看国产毛片| 国产suv精品一区二区三区| 亚洲日本丝袜连裤袜办公室| 欧美性欧美巨大黑白大战| 视频一区中文字幕国产| 国产亚洲午夜高清国产拍精品| av中文一区二区三区| 亚洲动漫第一页| 久久午夜国产精品| 色综合久久综合中文综合网| 免费精品视频最新在线| 国产精品水嫩水嫩| 欧美精选一区二区| 国产传媒欧美日韩成人| 亚洲午夜精品17c| 久久夜色精品国产噜噜av | 91精品国产色综合久久久蜜香臀| 精品无人区卡一卡二卡三乱码免费卡| 久久精品夜夜夜夜久久| 在线精品视频小说1| 韩国av一区二区三区在线观看| 亚洲欧美另类小说视频| 欧美大片日本大片免费观看| 色噜噜久久综合| 精品影视av免费| 五月激情六月综合| 中文字幕av资源一区| 日韩小视频在线观看专区| 91视频免费看| 国产精品69久久久久水密桃| 午夜精品久久久久久久99樱桃| 日本一二三四高清不卡| 日韩一区二区三区四区五区六区| 99国产精品99久久久久久| 国产精品一区二区无线| 日韩1区2区3区| 亚洲一区二区精品3399| 国产精品亲子乱子伦xxxx裸| 欧美r级在线观看| 欧美一区二区精品| 欧美午夜精品久久久| 99久久精品免费| 国产成人免费9x9x人网站视频| 蜜桃视频第一区免费观看| 天堂在线亚洲视频| 亚洲成a人v欧美综合天堂下载| 亚洲乱码中文字幕| 亚洲欧洲中文日韩久久av乱码| 亚洲国产经典视频| 欧美韩日一区二区三区四区| 久久精品日产第一区二区三区高清版| 5月丁香婷婷综合| 5858s免费视频成人| 欧美丰满少妇xxxxx高潮对白| 欧美日韩亚洲综合一区| 欧美唯美清纯偷拍| 91国偷自产一区二区三区成为亚洲经典 | 美女视频网站黄色亚洲| 日韩精品电影一区亚洲| 视频一区中文字幕国产| 日本麻豆一区二区三区视频| 日本一道高清亚洲日美韩| 日韩国产高清影视| 久久精品99久久久| 激情五月婷婷综合网| 国产精品18久久久久久久久久久久| 国内精品视频一区二区三区八戒| 精品在线免费视频| 国产成人自拍网| 9i在线看片成人免费| 91免费国产在线| 欧美日韩三级一区二区| 日韩一区二区免费在线电影| 精品国产123| 中国av一区二区三区| 国产精品电影一区二区三区| 亚洲中国最大av网站| 天堂久久一区二区三区| 精品一区二区日韩| 成人做爰69片免费看网站| 91在线观看下载| 欧美亚洲动漫制服丝袜| 欧美一二三区在线观看| 欧美激情综合五月色丁香小说| 亚洲天堂中文字幕| 麻豆精品一区二区| 成人app软件下载大全免费| 欧美日韩日日摸| 久久免费电影网| 一区二区高清在线| 精品一区免费av| 欧美亚洲动漫制服丝袜| 久久久美女毛片| 亚洲一区在线观看视频| 裸体健美xxxx欧美裸体表演| hitomi一区二区三区精品| 欧美福利视频一区| 国产欧美精品一区| 日韩va欧美va亚洲va久久| 不卡电影一区二区三区| 日韩欧美你懂的| 亚洲伊人色欲综合网| 粉嫩一区二区三区在线看| 91麻豆精品久久久久蜜臀|