nckernel  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions

Port In/Out 기능을 위한 함수 인터페이스를 정의한다. More...

Collaboration diagram for 입/출력 포트 제어:

Functions

unsigned char inb (unsigned short port)
 byte 크기의 데이터를 지정된 포트에서 읽는다. More...
 
unsigned long indw (unsigned short port)
 double word 크기의 데이트를 지정된 포트에서 읽는다. More...
 
unsigned short inw (unsigned short port)
 word 크기의 데이터를 지정된 포트에서 읽는다. More...
 
int ioperm (unsigned long from, unsigned long num, int turn_on)
 
int iopl (int level)
 
void outb (unsigned short port, unsigned char byte)
 byte 크기의 데이터를 지정도니 포트에 쓴다. More...
 
void outdw (unsigned short port, unsigned long dword)
 Double word 크기의 데이터를 지정된 포트에 쓴다. More...
 
void outw (unsigned short port, unsigned short word)
 Word 크기의 데이터를 지정된 포트에 쓴다. More...
 

Detailed Description

Port In/Out 기능을 위한 함수 인터페이스를 정의한다.

Author
Sung-jae Park nices.nosp@m.j@ni.nosp@m.cesj..nosp@m.com
Date
2011-7-20

CPU 의 In/Out 핀에 대한 접근을 위한 인터페이스를 정의하고, 구현은 각 architecture 에 맞게 구현한다.

Note
: 최근 GCC(버전 3 이상) 부터는 입력과 출력으로 사용된 레지스터 들은 모두 clobbered list 에 자동으로 포함되므로 clobber list에 명시해줄 필요는 없다. (inline assembly code 에서)

Function Documentation

unsigned char inb ( unsigned short  port)

byte 크기의 데이터를 지정된 포트에서 읽는다.

Parameters
[in]port포트번호
Returns
읽어온 byte 크기의 데이터

Definition at line 60 of file port.c.

Referenced by dma_is_done(), fdc_motor_off(), and fdc_motor_on().

Here is the caller graph for this function:

unsigned long indw ( unsigned short  port)

double word 크기의 데이트를 지정된 포트에서 읽는다.

Parameters
[in]port포트번호
Returns
읽어온 double word 크기의 데이터

Definition at line 34 of file port.c.

unsigned short inw ( unsigned short  port)

word 크기의 데이터를 지정된 포트에서 읽는다.

Parameters
[in]port포트번호
Returns
읽어온 word 크기의 데이터

Definition at line 47 of file port.c.

int ioperm ( unsigned long  from,
unsigned long  num,
int  turn_on 
)
Parameters
[in]from
[in]num
[in]turn_on
Returns
int

Definition at line 73 of file port.c.

References EFAULT.

int iopl ( int  level)
Parameters
[in]level
Returns
int

Definition at line 78 of file port.c.

References EFAULT.

void outb ( unsigned short  port,
unsigned char  byte 
)

byte 크기의 데이터를 지정도니 포트에 쓴다.

Parameters
[in]port포트번호
[in]bytebyte 크기의 데이터
Returns
없음

Definition at line 24 of file port.c.

Referenced by fdc_motor_off(), fdc_motor_on(), pic_init(), and timer_init().

Here is the caller graph for this function:

void outdw ( unsigned short  port,
unsigned long  dword 
)

Double word 크기의 데이터를 지정된 포트에 쓴다.

Parameters
[in]port포트번호
[in]dworddouble word 크기의 데이터
Returns
없음
See Also
indw()

Definition at line 4 of file port.c.

void outw ( unsigned short  port,
unsigned short  word 
)

Word 크기의 데이터를 지정된 포트에 쓴다.

Parameters
[in]port포트번호
[in]wordword 크기의 데이터
Returns
없음

Definition at line 14 of file port.c.