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

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

?? pciregions.c

?? linux device driver源碼
?? 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一区二区三区免费野_久草精品视频
日本道色综合久久| 久草在线在线精品观看| 久久综合999| 欧美一级午夜免费电影| 69堂成人精品免费视频| 欧美精品 国产精品| 欧美放荡的少妇| 日韩欧美一卡二卡| 日韩欧美精品在线| 久久综合色播五月| 国产欧美日韩卡一| 国产精品福利电影一区二区三区四区| 中文字幕欧美区| 亚洲欧美日韩一区二区 | 天天综合网天天综合色| 婷婷一区二区三区| 麻豆国产精品视频| 成人a级免费电影| 在线精品观看国产| 日韩欧美久久一区| 中文字幕欧美激情一区| 亚洲影院免费观看| 久久99精品久久久| 99精品黄色片免费大全| 欧美美女直播网站| 久久精品无码一区二区三区| 国产精品你懂的在线| 亚洲最大的成人av| 国产真实乱子伦精品视频| 99久久免费国产| 日韩精品一区二区三区swag| 国产亚洲一区二区在线观看| 亚洲永久免费视频| 岛国一区二区三区| 在线电影院国产精品| 久久人人97超碰com| 伊人婷婷欧美激情| 国产电影一区在线| 欧美高清视频在线高清观看mv色露露十八 | 亚洲欧美一区二区三区久本道91| 亚洲va天堂va国产va久| 成人精品电影在线观看| 日韩一级高清毛片| 亚洲综合成人在线| 成人国产精品免费观看| 日韩精品一区二区三区在线 | 成人福利视频在线看| 欧美日韩和欧美的一区二区| 欧美经典三级视频一区二区三区| 日韩精品五月天| 91视频国产观看| 精品国内二区三区| 五月综合激情婷婷六月色窝| 99免费精品在线观看| www国产精品av| 奇米亚洲午夜久久精品| 日本韩国欧美三级| 中文字幕精品一区| 国产成人综合在线播放| 91精品国产aⅴ一区二区| 亚洲欧洲av另类| 国产东北露脸精品视频| 精品国产免费人成在线观看| 天使萌一区二区三区免费观看| 91亚洲永久精品| 欧美国产日韩一二三区| 国产美女娇喘av呻吟久久| 日韩一区二区免费电影| 日韩精品一卡二卡三卡四卡无卡| 欧美日韩精品欧美日韩精品| 一区二区理论电影在线观看| 在线免费亚洲电影| 亚洲一区影音先锋| 欧美日韩中文另类| 亚洲国产精品一区二区www| 在线中文字幕不卡| 亚洲一区二区影院| 欧美狂野另类xxxxoooo| 天堂一区二区在线免费观看| 欧美酷刑日本凌虐凌虐| 偷拍一区二区三区四区| 91精品国产丝袜白色高跟鞋| 日本不卡视频在线| wwwwww.欧美系列| 国产不卡视频在线播放| 中文av一区特黄| 91一区二区三区在线播放| 尤物视频一区二区| 91精品免费在线观看| 免费在线欧美视频| 欧美激情综合五月色丁香小说| 成人av电影免费在线播放| **网站欧美大片在线观看| 一本色道久久综合精品竹菊| 午夜久久久久久电影| 亚洲精品在线电影| 91视频免费播放| 日韩电影在线免费观看| 久久久久久久久久久黄色| 色呦呦一区二区三区| 日韩国产成人精品| 中文字幕av在线一区二区三区| 欧美在线短视频| 国产综合成人久久大片91| 国产精品伦理一区二区| 欧美高清视频一二三区 | 国产色91在线| 欧美三级蜜桃2在线观看| 九九热在线视频观看这里只有精品| 中文字幕+乱码+中文字幕一区| 在线观看视频91| 国产乱人伦偷精品视频免下载| 一区二区三区在线不卡| 久久精品一区二区| 欧美精品vⅰdeose4hd| 成人app网站| 精品一区二区三区不卡| 亚洲精品写真福利| 国产欧美一区二区精品性色超碰| 色av综合在线| 国产精品白丝av| 五月天一区二区三区| 中文字幕中文字幕中文字幕亚洲无线| 欧美一区午夜精品| 欧美性生活影院| 风间由美一区二区av101| 蜜臀91精品一区二区三区| 一区二区三区免费看视频| 国产三级三级三级精品8ⅰ区| 欧美日韩国产精品自在自线| 99久久精品国产麻豆演员表| 国产尤物一区二区| 日本伊人午夜精品| 亚洲大片一区二区三区| 亚洲精品国久久99热| 国产精品三级电影| 国产日韩欧美高清在线| 亚洲精品一区二区三区影院 | 国产麻豆精品在线观看| 男人的天堂久久精品| 亚洲高清免费一级二级三级| 亚洲欧美日韩久久| 亚洲精品第1页| 亚洲人成人一区二区在线观看 | 欧美日韩国产在线观看| 91丝袜美腿高跟国产极品老师| 风间由美中文字幕在线看视频国产欧美 | 自拍偷拍亚洲欧美日韩| 国产精品第一页第二页第三页| 国产欧美一区二区精品久导航 | 欧美亚洲另类激情小说| 91在线精品秘密一区二区| 成人美女视频在线观看18| 国产激情91久久精品导航| 国产成人在线色| 99久久精品免费看国产| 色婷婷激情一区二区三区| 91福利社在线观看| 欧美精品一级二级| 日韩午夜在线影院| xfplay精品久久| 国产精品青草综合久久久久99| 综合电影一区二区三区| 一区二区日韩av| 日韩精品亚洲专区| 久久国产成人午夜av影院| 国产在线精品视频| 99re视频精品| 91精品中文字幕一区二区三区| 日韩欧美不卡在线观看视频| 国产天堂亚洲国产碰碰| 1024精品合集| 日韩国产欧美三级| 成人h动漫精品一区二| 在线看日韩精品电影| 日韩一卡二卡三卡四卡| 中文幕一区二区三区久久蜜桃| 亚洲欧美日韩成人高清在线一区| 午夜电影网亚洲视频| 国产乱人伦精品一区二区在线观看| 99久久er热在这里只有精品15| 欧美精品aⅴ在线视频| 亚洲国产高清在线| 日韩有码一区二区三区| 国产91精品一区二区麻豆网站| 欧美亚洲高清一区| 国产女同性恋一区二区| 一区二区三区久久| 国产一区二区三区av电影| 色屁屁一区二区| 26uuu亚洲综合色欧美| 亚洲精品第一国产综合野| 精品一区二区三区视频| 精品视频一区二区三区免费| 久久久国产精品麻豆| 日韩精品欧美精品| 色丁香久综合在线久综合在线观看| 精品国一区二区三区| 亚洲超碰97人人做人人爱| 成人午夜私人影院|