PCICONFIG_READ
Section: Linux Programmer's Manual (2)
Updated: 2003-07-14
Index
JM Home Page
roff page
 
名前
pciconfig_read, pciconfig_write, pciconfig_iobase - pci デバイス情報を扱う
 
書式
#include <pci.h>
int pciconfig_read(unsigned long bus, unsigned long dfn,
          unsigned long off, unsigned long len, void *buf);
int pciconfig_write(unsigned long bus, unsigned long dfn,
          unsigned long off, unsigned long len, void *buf);
int pciconfig_iobase(long which, unsigned long bus,
          unsigned long devfn);
 
説明
PCI デバイスとのやり取り (interaction) は
カーネル PCI レイヤですでに処理されているので、
通常はこららの関数をユーザ空間からアクセスする必要はない。
- pciconfig_read()
- 
デバイス
dev
のオフセット
off
の値を
buf
に読み込む。
- pciconfig_write()
- 
デバイス
dev
のオフセット
off
に
buf
の値を書き込む。
- pciconfig_iobase()
- 
bus/devfn ペアをこの関数に渡し、
メモリオフセット (prep のようなものでは、この値は 0xc0000000 である) と
PIO サイクルの IO ベースの物理アドレスを取得する。
また、もしあるならば ISA hole の物理アドレスを取得する。
返り値
- pciconfig_read()
- 
成功した場合、0 が返される。
エラーの場合、-1 が返され、
errno
が適切に設定される。
- pciconfig_write()
- 
成功した場合、0 が返される。
エラーの場合、-1 が返され、
errno
が適切に設定される。
- pciconfig_iobase()
- 
which
の値に基づいて、物理メモリ内の様々な I/O 領域の位置情報が返される。
which
の値は、
IOBASE_BRIDGE_NUMBER,
IOBASE_MEMORY,
IOBASE_IO,
IOBASE_ISA_IO,
IOBASE_ISA_MEM
である。
エラー
- EINVAL
- 
len
の値が無効である。
このエラーは
pciconfig_iobase()
には適用されない。
- EIO
- 
I/O エラー。
- ENODEV
- 
pciconfig_iobase()
の場合、でホース (hose) の値が NULL である。
他の呼び出しの場合、スロット (slot) が見つからない。
- ENOSYS
- 
このシステムはこれらの呼び出しを実装していない。
(CONFIG_PCI
が定義されていない)。
- EOPNOTSUPP
- 
この返り値は
pciconfig_iobase()
でのみ有効である。
このエラーは
which
の値が無効であるときに返される。
- EPERM
- 
ユーザが
CAP_SYS_ADMIN
権限を持っていない。
このエラーは
pciconfig_iobase()
には適用されない。
準拠
これらの呼び出しは Linux 特有のものであり、
Linux 2.0.26/2.1.11 から使用可能である。
 
関連項目
capabilities(7)
 Index
- 名前
- 
- 書式
- 
- 説明
- 
- 返り値
- 
- エラー
- 
- 準拠
- 
- 関連項目
- 
This document was created by
man2html,
using the manual pages.
Time: 03:26:50 GMT, April 25, 2010