.\" Copyright (c) 1995 Paul Gortmaker .\" (gpg109@rsphy1.anu.edu.au) .\" Wed Nov 29 10:58:54 EST 1995 .\" .\" %%%LICENSE_START(GPLv2+_DOC_FULL) .\" This is free documentation; 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. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual 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 manual; if not, see .\" . .\" %%%LICENSE_END .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1996 HANATAKA Shinya .\" all rights reserved. .\" Translated Wed Dec 4 15:19:14 JST 1996 .\" by HANATAKA Shinya .\" Updated Fri Dec 14 JST 2001 by Kentaro Shirakata .\" Updated Sun May 23 JST 2004 by Kentaro Shirakata .\" Updated Thu Mar 24 JST 2005 by Kentaro Shirakata .\" Updated Thu Oct 9 JST 2005 by Kentaro Shirakata .\" .TH OUTB 2 2012\-12\-31 Linux "Linux Programmer's Manual" .SH 名前 outb, outw, outl, outsb, outsw, outsl, inb, inw, inl, insb, insw, insl, outb_p, outw_p, outl_p, inb_p, inw_p, inl_p \- ポート入出力 .SH 書式 .nf \fB#include \fP \fBunsigned char inb(unsigned short int \fP\fIport\fP\fB);\fP \fBunsigned char inb_p(unsigned short int \fP\fIport\fP\fB);\fP \fBunsigned short int inw(unsigned short int \fP\fIport\fP\fB);\fP \fBunsigned short int inw_p(unsigned short int \fP\fIport\fP\fB);\fP \fBunsigned int inl(unsigned short int \fP\fIport\fP\fB);\fP \fBunsigned int inl_p(unsigned short int \fP\fIport\fP\fB);\fP \fBvoid outb(unsigned char \fP\fIvalue\fP\fB, unsigned short int \fP\fIport\fP\fB);\fP \fBvoid outb_p(unsigned char \fP\fIvalue\fP\fB, unsigned short int \fP\fIport\fP\fB);\fP \fBvoid outw(unsigned short int \fP\fIvalue\fP\fB, unsigned short int \fP\fIport\fP\fB);\fP \fBvoid outw_p(unsigned short int \fP\fIvalue\fP\fB, unsigned short int \fP\fIport\fP\fB);\fP \fBvoid outl(unsigned int \fP\fIvalue\fP\fB, unsigned short int \fP\fIport\fP\fB);\fP \fBvoid outl_p(unsigned int \fP\fIvalue\fP\fB, unsigned short int \fP\fIport\fP\fB);\fP \fBvoid insb(unsigned short int \fP\fIport\fP\fB, void *\fP\fIaddr\fP\fB,\fP \fB unsigned long int \fP\fIcount\fP\fB);\fP \fBvoid insw(unsigned short int \fP\fIport\fP\fB, void *\fP\fIaddr\fP\fB,\fP \fB unsigned long int \fP\fIcount\fP\fB);\fP \fBvoid insl(unsigned short int \fP\fIport\fP\fB, void *\fP\fIaddr\fP\fB,\fP \fB unsigned long int \fP\fIcount\fP\fB);\fP \fBvoid outsb(unsigned short int \fP\fIport\fP\fB, const void *\fP\fIaddr\fP\fB,\fP \fB unsigned long int \fP\fIcount\fP\fB);\fP \fBvoid outsw(unsigned short int \fP\fIport\fP\fB, const void *\fP\fIaddr\fP\fB,\fP \fB unsigned long int \fP\fIcount\fP\fB);\fP \fBvoid outsl(unsigned short int \fP\fIport\fP\fB, const void *\fP\fIaddr\fP\fB,\fP \fB unsigned long int \fP\fIcount\fP\fB);\fP .fi .SH 説明 この一連の関数はポートに対する低レベルの入出力に使用する。 out* 関数はポート出力、in* 関数はポート入力を行う。 語尾に b がついている関数はバイト単位、w がついている関数はワード単位である。 _p がついている関数は I/O が終了するまで待つ。 .LP .\" , given the following information .\" in addition to that given in .\" .BR outb (9). これらの関数はもともとカーネル内部での使用を想定して設計されているが、 ユーザー空間からでも使用できる。 \fB\-O\fP や \fB\-O2\fP などを指定してコンパイルしなければならない。 これらの関数はインライン・マクロとして定義されており、 最適化を行わないと関数の展開が行われず、 リンクの時に「解決できない参照(unresolved reference)」が発生する。 ユーザー空間のアプリケーションが I/O ポートにアクセスすることを カーネルに教えるために \fBioperm\fP(2) もしくは \fBiopl\fP(2) を使用すること。これを忘れるとアプリケーションはセグメンテーション違反 (segmentation fault) を受けとることになる。 .SH 準拠 \fBoutb\fP() とその仲間はハードウェア特有である。 \fIvalue\fP 引数が最初に渡され、 \fIport\fP 引数が二番目に渡される。 この順序はほとんどの DOS での実装とは逆である。 .SH 関連項目 \fBioperm\fP(2), \fBiopl\fP(2) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.65 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。