pciconfig_read
Section: System Calls (2)
Updated: 2026-02-08
Index
JM Home Page
roff page
名前
pciconfig_read, pciconfig_write, pciconfig_iobase - pci デバイス情報を扱う
ライブラリ
標準 C ライブラリ (libc,~-lc)
書式
#include <pci.h>
int pciconfig_read(unsigned long bus, unsigned long dfn,
unsigned long off, unsigned long size,
unsigned char *buf);
int pciconfig_write(unsigned long bus, unsigned long dfn,
unsigned long off, unsigned long size,
unsigned char *buf);
int pciconfig_iobase(int 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()
-
On success, zero is returned. On error, -1 is returned and errno is set
to indicate the error.
- pciconfig_write()
-
On success, zero is returned. On error, -1 is returned and errno is set
to indicate the error.
- pciconfig_iobase()
-
which の値に基づいて、物理メモリー内の様々な I/O 領域の位置情報が返される。 which の値は、
IOBASE_BRIDGE_NUMBER, IOBASE_MEMORY, IOBASE_IO, IOBASE_ISA_IO,
IOBASE_ISA_MEM である。
エラー
- EINVAL
-
size value is invalid. This does not apply to 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.