Last change
on this file since 9 was 4, checked in by Mattia Monga, 14 years ago |
Importazione sorgenti libro
|
File size:
1020 bytes
|
Line | |
---|
1 | /* This file provides basic types and some constants for the
|
---|
2 | * SYS_DEVIO and SYS_VDEVIO system calls, which allow user-level
|
---|
3 | * processes to perform device I/O.
|
---|
4 | *
|
---|
5 | * Created:
|
---|
6 | * Apr 08, 2004 by Jorrit N. Herder
|
---|
7 | */
|
---|
8 |
|
---|
9 | #ifndef _DEVIO_H
|
---|
10 | #define _DEVIO_H
|
---|
11 |
|
---|
12 | #include <minix/sys_config.h> /* needed to include <minix/type.h> */
|
---|
13 | #include <sys/types.h> /* u8_t, u16_t, u32_t needed */
|
---|
14 |
|
---|
15 | typedef u16_t port_t;
|
---|
16 | typedef U16_t Port_t;
|
---|
17 |
|
---|
18 | /* We have different granularities of port I/O: 8, 16, 32 bits.
|
---|
19 | * Also see <ibm/portio.h>, which has functions for bytes, words,
|
---|
20 | * and longs. Hence, we need different (port,value)-pair types.
|
---|
21 | */
|
---|
22 | typedef struct { u16_t port; u8_t value; } pvb_pair_t;
|
---|
23 | typedef struct { u16_t port; u16_t value; } pvw_pair_t;
|
---|
24 | typedef struct { u16_t port; u32_t value; } pvl_pair_t;
|
---|
25 |
|
---|
26 | /* Macro shorthand to set (port,value)-pair. */
|
---|
27 | #define pv_set(pv, p, v) ((pv).port = (p), (pv).value = (v))
|
---|
28 | #define pv_ptr_set(pv_ptr, p, v) ((pv_ptr)->port = (p), (pv_ptr)->value = (v))
|
---|
29 |
|
---|
30 | #endif /* _DEVIO_H */
|
---|
Note:
See
TracBrowser
for help on using the repository browser.