source: branches/minix3-book/include/minix/devio.h@ 11

Last change on this file since 11 was 4, checked in by Mattia Monga, 14 years ago

Importazione sorgenti libro

File size: 1020 bytes
RevLine 
[4]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
15typedef u16_t port_t;
16typedef 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 */
22typedef struct { u16_t port; u8_t value; } pvb_pair_t;
23typedef struct { u16_t port; u16_t value; } pvw_pair_t;
24typedef 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.