3 arch \- architecture-specific information and control
19 This device presents textual information about PC hardware and allows
20 user-level control of the I/O ports on x86-class and DEC Alpha machines.
24 recover the processor type and clock rate in MHz.
27 yield at least data of this form:
36 cache 0x0 1073741824 wb
37 cache 0x3ff00000 1048576 uc
42 is the processor type,
44 is the processor speed in MHz,
47 is present only if the `page global extension' capability is present;
48 the next line reflects its setting.
56 showing the form of memory barrier used by the kernel.
62 reflecting the form of `compare and swap' used by the kernel.
64 is a flag, indicating the need to explicitly set
65 the Intel 8253 or equivalent timer.
66 There may be lines starting with
68 that reflect the state of memory caching via MTRRs
69 (memory-type region registers).
70 The second word on the line is
72 or a C-style number which is the base physical address of the region;
73 the third is a C-style length of the region;
74 and the fourth is one of
86 A region may be a subset of another region, and the smaller region
88 This may be used to make I/O registers uncachable
89 in the midst of a write-combining region mostly used
90 for a video framebuffer, for example.
91 Control messages may be written to
93 and use the same syntax as the data read from
95 Known commands include
105 return I/O ranges used by each device, one line
107 Each line contains three fields separated by white space: first address
109 last address, name of device.
113 return the enabled interrupts, one line per
114 interrupt. Each line contains three fields separated by white space:
115 the trap number, the IRQ it is assigned to, and the name of
123 cause 8-bit wide, 16-bit wide, and 32-bit wide requests to
125 The port accessed is determined by the byte offset of the
130 go to the P4/P6/Core/Core2/AMD64 MSRs.
134 transfer bytes from and to the embedded controller.
138 return a concatenation of system ACPI tables. Each table
139 is prefixed with a fixed size header that gives the name
140 sigature and size of the table (see section
141 .IR "5.2.6 System Description Table Header"
142 in the ACPI specification).
144 The following code reads from an x86 byte I/O port.
148 inportb(unsigned port)
153 iobfd = open("#P/iob", ORDWR);
155 seek(iobfd, port, 0);
156 if(read(iobfd, &data, sizeof(data)) != sizeof(data))
157 sysfatal("inportb(0x%4.4ux): %r", port);
162 .B /sys/src/9/pc/devarch.c