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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? pciregions.c

?? Linux設(shè)備驅(qū)動程序第二版
?? 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}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区三区中文字幕在线| 久久不见久久见免费视频7| 性欧美疯狂xxxxbbbb| 国产一区二区三区高清播放| 色综合色综合色综合色综合色综合| 日韩一区二区三| 亚洲美女屁股眼交| 国产精品性做久久久久久| 亚洲国产精品精华液网站| 亚洲国产精品黑人久久久| 欧美一二区视频| 亚洲人成网站色在线观看| 国产一区视频网站| 欧美精品乱码久久久久久| ...av二区三区久久精品| 国产精品中文字幕欧美| 日韩亚洲欧美在线观看| 亚洲午夜av在线| 色综合一区二区| 欧美激情一区在线观看| 韩国三级在线一区| 欧美成人免费网站| 日韩av高清在线观看| 欧美三级电影一区| 一区二区欧美国产| 欧日韩精品视频| 亚洲精品免费视频| 色久优优欧美色久优优| 国产精品夫妻自拍| 99久久久无码国产精品| 国产精品乱人伦一区二区| 国产一区不卡视频| 久久精品夜色噜噜亚洲aⅴ| 久久成人精品无人区| 欧美α欧美αv大片| 蜜臀精品一区二区三区在线观看 | 欧美极品少妇xxxxⅹ高跟鞋 | 亚洲激情男女视频| 色婷婷亚洲综合| 一区二区三区在线不卡| 91极品美女在线| 亚洲一区二区三区免费视频| 欧美性色欧美a在线播放| 亚洲韩国一区二区三区| 欧美精品18+| 麻豆专区一区二区三区四区五区| 欧美一区二区三区不卡| 韩国三级在线一区| 国产精品福利电影一区二区三区四区| 成年人国产精品| 亚洲综合视频在线| 91精品一区二区三区久久久久久| 麻豆极品一区二区三区| 久久久久久久久久电影| 91亚洲精品乱码久久久久久蜜桃| 一区二区三区四区视频精品免费| 欧美日韩国产系列| 久久99精品网久久| 国产精品久久影院| 欧美午夜精品一区二区蜜桃| 蜜桃精品在线观看| 国产区在线观看成人精品| 91麻豆自制传媒国产之光| 亚洲va天堂va国产va久| 亚洲精品在线免费观看视频| 成人av片在线观看| 天天色天天爱天天射综合| 久久久精品人体av艺术| 日韩欧美中文一区二区| 国产精品99久久不卡二区| 亚洲三级免费观看| 欧美一区二区日韩一区二区| 成人激情图片网| 日韩av一区二区在线影视| 国产精品免费观看视频| 91精品国产综合久久香蕉的特点| 国产精品一二三区| 天使萌一区二区三区免费观看| 国产清纯白嫩初高生在线观看91| 在线观看成人免费视频| 国产精品中文字幕一区二区三区| 亚洲最新视频在线观看| 国产亚洲1区2区3区| 欧美日韩国产一区二区三区地区| 国产91精品免费| 天天色天天操综合| 亚洲欧美色综合| 久久久久国产精品免费免费搜索 | 成人动漫av在线| 日本成人在线看| 亚洲激情五月婷婷| 日本一区二区电影| xfplay精品久久| 9191国产精品| 在线观看网站黄不卡| 国产精品911| 麻豆91免费看| 日韩av不卡一区二区| 亚洲黄色免费网站| 国产精品不卡在线| 国产日产欧美精品一区二区三区| 欧美一区二区三区免费观看视频| 日本精品一级二级| 91香蕉国产在线观看软件| 国产精品77777| 九九在线精品视频| 久久成人免费网| 日韩电影免费一区| 亚洲v中文字幕| 亚洲大片一区二区三区| 1024成人网| 日韩一区在线看| 亚洲欧洲日韩女同| 中文字幕一区二区三区四区 | 久久老女人爱爱| 欧美不卡在线视频| 精品免费国产二区三区| 欧美电影免费提供在线观看| 91精品免费观看| 91精品国产综合久久久久久久| 欧美日韩视频专区在线播放| 欧美日韩免费不卡视频一区二区三区| 色八戒一区二区三区| 日本韩国视频一区二区| 色视频成人在线观看免| 欧美三级日韩在线| 在线不卡免费av| 日韩美一区二区三区| 日韩精品资源二区在线| 久久久蜜桃精品| 国产女主播视频一区二区| 国产精品久久久久久久久搜平片 | 色哟哟日韩精品| 欧美性三三影院| 欧美一区二区在线免费播放| 日韩视频在线你懂得| 精品国产123| 国产精品三级视频| 亚洲综合区在线| 另类人妖一区二区av| 国产.欧美.日韩| 色综合久久中文综合久久牛| 欧美日韩国产精选| 日韩精品一区二区三区swag| 亚洲国产高清在线观看视频| 亚洲色图欧洲色图| 免费久久精品视频| 处破女av一区二区| 欧美剧情电影在线观看完整版免费励志电影 | 亚洲精品在线一区二区| 国产精品免费看片| 天天亚洲美女在线视频| 国产精品一二一区| 欧美午夜精品免费| 精品国产免费一区二区三区四区 | 激情深爱一区二区| 91亚洲永久精品| 日韩欧美国产1| 亚洲美女少妇撒尿| 激情综合色播激情啊| 在线中文字幕不卡| 欧美精品一区二区不卡| 亚洲卡通欧美制服中文| 久久精品国产久精国产| 在线区一区二视频| 欧美精品一区二区三区蜜桃视频| 亚洲女同ⅹxx女同tv| 激情久久五月天| 欧美亚洲愉拍一区二区| 欧美国产97人人爽人人喊| 亚洲小少妇裸体bbw| 成人免费黄色在线| 欧美成人伊人久久综合网| 一区二区三区鲁丝不卡| 成人免费毛片高清视频| 日韩一区二区三区观看| 亚洲一区二区三区自拍| 成人av在线播放网址| 2020国产精品| 免费在线视频一区| 欧美网站大全在线观看| 国产精品久久久久久久久久免费看 | 精品一区二区免费视频| 欧美视频在线不卡| 综合久久一区二区三区| 国产剧情在线观看一区二区| 日韩三级中文字幕| 午夜精品福利视频网站| 色婷婷综合中文久久一本| 中文字幕乱码亚洲精品一区| 国产一区二区三区在线观看免费| 欧美一区二区福利在线| 丝袜a∨在线一区二区三区不卡 | 亚洲精品一二三区| eeuss鲁一区二区三区| 国产日韩亚洲欧美综合| 国产老肥熟一区二区三区| 欧美精品一区二区三区视频| 老色鬼精品视频在线观看播放| 欧美乱妇20p|