亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
老司机一区二区| 日韩精品一区在线| 69av一区二区三区| 国产日韩在线不卡| 亚洲国产精品久久人人爱| 国产一区二区剧情av在线| 欧美伊人久久大香线蕉综合69| 久久久亚洲国产美女国产盗摄 | 福利电影一区二区| 91九色最新地址| 中文字幕乱码久久午夜不卡 | 精品日韩欧美在线| 午夜日韩在线电影| 91在线无精精品入口| 欧美精品一区二区三区蜜桃| 亚洲一区二区三区四区五区中文 | 亚洲高清免费在线| 欧美肥妇毛茸茸| 亚洲国产精品久久一线不卡| 欧美一级久久久| 视频精品一区二区| 欧美色精品在线视频| 亚洲黄色免费网站| 成人av在线网站| 国产亚洲欧美一级| 国产高清在线精品| 久久精品一区二区三区不卡 | 欧美三级一区二区| 国产最新精品精品你懂的| 精品三级av在线| 成人av在线一区二区| 天堂久久久久va久久久久| 久久精品在线免费观看| 在线视频一区二区三区| 亚洲欧美激情小说另类| 99riav一区二区三区| 日韩av高清在线观看| 91精品国产综合久久久久| 成人综合婷婷国产精品久久 | 亚洲视频小说图片| 99re视频这里只有精品| 日韩成人免费看| 中文字幕不卡在线观看| 欧美日韩成人一区| 免费看欧美女人艹b| 精品国产乱子伦一区| 91在线视频观看| 久久超碰97中文字幕| 亚洲自拍偷拍综合| 国产天堂亚洲国产碰碰| 欧美久久久久免费| 不卡av免费在线观看| 美女脱光内衣内裤视频久久网站 | 亚洲国产精品国自产拍av| 在线成人av网站| 99视频一区二区| 亚洲成av人片观看| 日韩一级视频免费观看在线| 99久久er热在这里只有精品15| 久久成人免费网| 亚洲成a天堂v人片| 亚洲欧洲日产国码二区| 欧美午夜精品一区二区蜜桃| 丁香啪啪综合成人亚洲小说| 美日韩一级片在线观看| 一区二区三区精密机械公司| 7777精品伊人久久久大香线蕉完整版 | 色偷偷久久人人79超碰人人澡| 尤物在线观看一区| 久久精品人人爽人人爽| 91精品国产全国免费观看| 极品销魂美女一区二区三区| 中文久久乱码一区二区| 日本大香伊一区二区三区| 国产精品一区二区x88av| 亚洲美女一区二区三区| 久久精品欧美一区二区三区麻豆| 91精品国产色综合久久不卡电影 | 91丨九色丨蝌蚪富婆spa| 亚洲高清一区二区三区| 综合电影一区二区三区 | 国产成人精品影院| 久久精品72免费观看| 性做久久久久久免费观看 | 亚洲免费资源在线播放| 中文字幕欧美激情| 国产欧美一区二区在线观看| 亚洲精品一区二区三区四区高清| 欧美一区二区三区喷汁尤物| 欧美日韩在线亚洲一区蜜芽| 日本精品一区二区三区四区的功能| 懂色av一区二区三区免费看| 国产美女久久久久| 精一区二区三区| 看电影不卡的网站| 蜜桃免费网站一区二区三区| 日韩国产在线一| 日日夜夜免费精品视频| 亚洲成av人片www| 午夜欧美2019年伦理| 亚洲成人7777| 午夜精品久久久久久久久久| 偷窥少妇高潮呻吟av久久免费| 亚洲一区二区三区视频在线播放| 亚洲一卡二卡三卡四卡| 亚洲午夜久久久久中文字幕久| 一区二区免费看| 亚洲综合丁香婷婷六月香| 亚洲一区日韩精品中文字幕| 亚洲一区二区三区影院| 亚洲第一主播视频| 五月婷婷激情综合网| 日本亚洲最大的色成网站www| 视频一区二区三区入口| 奇米一区二区三区av| 精品一区二区三区欧美| 国内不卡的二区三区中文字幕 | 亚洲综合色自拍一区| 亚洲在线视频网站| 亚洲第一福利视频在线| 亚洲午夜在线视频| 日韩高清一区二区| 狠狠色丁香九九婷婷综合五月 | 国产一区二区三区免费观看| 国产成人综合在线观看| av在线一区二区| 色狠狠综合天天综合综合| 色老汉一区二区三区| 777亚洲妇女| 久久综合色天天久久综合图片| 日本乱码高清不卡字幕| 欧美日韩视频在线观看一区二区三区 | 亚洲综合视频网| 日产欧产美韩系列久久99| 精品一区二区三区不卡| 国产成人av一区| 91视频观看免费| 欧美亚洲丝袜传媒另类| 日韩一区二区三区免费观看| 2017欧美狠狠色| 国产精品久久久久四虎| 久久一二三国产| 中文字幕在线观看一区二区| 亚洲国产视频一区二区| 美日韩一区二区三区| 成人综合日日夜夜| 欧美三级中文字| 26uuu另类欧美亚洲曰本| 国产精品短视频| 亚洲成人一区在线| 国产中文字幕精品| 日本精品视频一区二区三区| 91精品综合久久久久久| 国产人久久人人人人爽| 亚洲宅男天堂在线观看无病毒| 久久99久久久欧美国产| 成人av免费网站| 91精品婷婷国产综合久久性色 | 91行情网站电视在线观看高清版| 91精品国产高清一区二区三区 | 亚洲欧美一区二区久久 | 日韩黄色免费网站| 国产凹凸在线观看一区二区| 欧美在线观看18| 久久久久高清精品| 一区二区久久久| 国产一区二区三区最好精华液| 91在线国产福利| 精品美女一区二区三区| 亚洲欧美日本韩国| 国产又黄又大久久| 欧美日韩国产综合久久| 国产欧美日韩麻豆91| 日韩国产欧美在线视频| www.av精品| 日韩精品一区二区三区四区视频| 国产精品国产自产拍在线| 日本亚洲电影天堂| 91在线观看成人| 久久色视频免费观看| 亚洲小说欧美激情另类| 成人一区在线观看| 日韩一级黄色片| 亚洲精选在线视频| 国产精品自拍三区| 91精品国产综合久久精品图片 | 欧美日韩的一区二区| 国产精品久久久久国产精品日日| 奇米精品一区二区三区在线观看一 | 欧美二区在线观看| 亚洲日本在线看| 国产精品综合网| 欧美一区二区二区| 亚洲综合视频在线观看| 粉嫩蜜臀av国产精品网站| 精品少妇一区二区三区免费观看 | 欧美精品一区二区精品网| 亚洲午夜精品在线| 91亚洲午夜精品久久久久久| 久久蜜臀中文字幕|