zoukankan      html  css  js  c++  java
  • essential linux device drivers ch10

    Accessing PCI Regions

    PCI devices contain three addressable regions: configuration space, I/O ports, and device memory

    Configuration Space

    pci_read_config_[byte|word|dword](struct pci_dev *pdev, int offset, int *value);

    and

    pci_write_config_[byte|word|dword](struct pci_dev *pdev, int offset, int value);

    Only the first 64 bytes of the configuration space are standardized. The device manufacturer defines desired semantics to the rest.

    I/O and Memory

    PCI cards have up to six I/O or memory regions. I/O regions contain registers, and memory regions hold data. Video cards, for example, have I/O spaces that accommodate control registers and memory regions that map to frame buffers.

    unsigned long pci_resource_[start|len|end|flags] (struct pci_dev *pdev, int bar);

    1. Get the I/O base address from the appropriate base address register (bar) in the configuration space:

    unsigned long io_base = pci_resource_start(pdev, bar);
  • 相关阅读:
    UIView添加手势
    UIView常见属性设置汇总
    关于页面传值
    有关segue的简介
    alloc
    如何定义静态方法
    一座小城
    清明
    开通博客
    iOS学习之界面间传值
  • 原文地址:https://www.cnblogs.com/cute/p/2089402.html
Copyright © 2011-2022 走看看