3 arch \- architecture-specific information and control
18 This device presents textual information about PC hardware and allows
19 user-level control of the I/O ports on x86-class and DEC Alpha machines.
23 recover the processor type and clock rate in MHz.
26 yield at least data of this form:
35 cache 0x0 1073741824 wb
36 cache 0x3ff00000 1048576 uc
41 is the processor type,
43 is the processor speed in MHz,
46 is present only if the `page global extension' capability is present;
47 the next line reflects its setting.
55 showing the form of memory barrier used by the kernel.
61 reflecting the form of `compare and swap' used by the kernel.
63 is a flag, indicating the need to explicitly set
64 the Intel 8253 or equivalent timer.
65 There may be lines starting with
67 that reflect the state of memory caching via MTRRs
68 (memory-type region registers).
69 The second word on the line is
71 or a C-style number which is the base physical address of the region;
72 the third is a C-style length of the region;
73 and the fourth is one of
85 A region may be a subset of another region, and the smaller region
87 This may be used to make I/O registers uncachable
88 in the midst of a write-combining region mostly used
89 for a video framebuffer, for example.
90 Control messages may be written to
92 and use the same syntax as the data read from
94 Known commands include
104 return I/O ranges used by each device, one line
106 Each line contains three fields separated by white space: first address
108 last address, name of device.
112 return the enabled interrupts, one line per
113 interrupt. Each line contains three fields separated by white space:
114 the trap number, the IRQ it is assigned to, and the name of
122 cause 8-bit wide, 16-bit wide, and 32-bit wide requests to
124 The port accessed is determined by the byte offset of the
129 go to the P4/P6/Core/Core2/AMD64 MSRs.
133 return a concatenation of system ACPI tables. Each table
134 is prefixed with a fixed size header that gives the name
135 sigature and size of the table (see section
136 .IR "5.2.6 System Description Table Header"
137 in the ACPI specification).
139 The following code reads from an x86 byte I/O port.
143 inportb(unsigned port)
148 iobfd = open("#P/iob", ORDWR);
150 seek(iobfd, port, 0);
151 if(read(iobfd, &data, sizeof(data)) != sizeof(data))
152 sysfatal("inportb(0x%4.4ux): %r", port);
157 .B /sys/src/9/pc/devarch.c