1inb(9F) Kernel Functions for Drivers inb(9F)
2
3
4
6 inb, inw, inl, repinsb, repinsw, repinsd - read from an I/O port
7
9 #include <sys/ddi.h>
10 #include <sys/sunddi.h>
11
12 unsigned char inb(int port);
13
14
15 unsigned short inw(int
16 port);
17
18
19 unsigned long inl(int port);
20
21
22 void repinsb(int port, unsigned char *addr, int
23 count);
24
25
26 void repinsw(int port, unsigned short *addr, int
27 count);
28
29
30 void repinsd(int port, unsigned long *addr, int
31 count);
32
33
35 The functions described here are obsolete. For the inb(), inw(), and
36 inl() functions, use, respectively, ddi_get8(9F), ddi_get8(9F), and
37 ddi_get8(9F) instead. For repinsb(), repinsw(), andrepinsl(), use,
38 respectively, ddi_rep_get8(9F), ddi_rep_get8(9F), and ddi_rep_get8(9F)
39 instead.
40
42 port A valid I/O port address.
43
44
45 addr The address of a buffer where the values will be stored.
46
47
48 count The number of values to be read from the I/O port.
49
50
52 These routines read data of various sizes from the I/O port with the
53 address specified by port.
54
55
56 The inb(), inw(), and inl() functions read 8 bits, 16 bits, and 32 bits
57 of data respectively, returning the resulting values.
58
59
60 The repinsb(), repinsw(), and repinsd() functions read multiple 8-bit,
61 16-bit, and 32-bit values, respectively. count specifies the number of
62 values to be read. A pointer to a buffer will receive the input data;
63 the buffer must be long enough to hold count values of the requested
64 size.
65
67 The inb(), inw(), and inl() functions return the value that was read
68 from the I/O port.
69
71 These functions may be called from user, interrupt, or kernel context.
72
74 See attributes(5) for descriptions of the following attributes:
75
76
77
78
79 ┌─────────────────────────────┬─────────────────────────────┐
80 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
81 ├─────────────────────────────┼─────────────────────────────┤
82 │Architecture │x86 │
83 ├─────────────────────────────┼─────────────────────────────┤
84 │Stability Level │ Obsolete │
85 └─────────────────────────────┴─────────────────────────────┘
86
88 isa(4), attributes(5), ddi_get8(9F), ddi_get8(9F), ddi_get8(9F),
89 ddi_rep_get8(9F), ddi_rep_get8(9F), ddi_rep_get8(9F), outb(9F)
90
91
92 Writing Device Drivers
93
94
95
96SunOS 5.11 16 Jan 2006 inb(9F)