io: add -E flag to access embedded controller space

This commit is contained in:
cinap_lenrek 2014-11-10 00:35:07 +01:00
parent ee05bbccbc
commit 95dbc72801
2 changed files with 8 additions and 3 deletions

View file

@ -4,7 +4,7 @@ io \- access PC I/O registers
.SH SYNOPSIS
.B io
[
.B -WLMrw
.B -WLMErw
]
.I address
[
@ -38,7 +38,11 @@ Perform a long / double word (32 bit) operation.
.TP
.B -M
Access a 64 bit wide machine specific register (MSR).
.TP
.B -E
Access embedded controller space.
.SH SOURCE
.B /sys/src/cmd/io.c
.SH SEE ALSO
.IR seg (1)
.IR seg (1),
.IR arch (3)

View file

@ -1,7 +1,7 @@
#include <u.h>
#include <libc.h>
const char const * datac[] = {0,"#P/iob","#P/iow",0,"#P/iol",0,0,0,"#P/msr"};
char *datac[] = {0,"#P/iob","#P/iow",0,"#P/iol",0,0,0,"#P/msr"};
void
main(int argc, char** argv) {
@ -17,6 +17,7 @@ main(int argc, char** argv) {
case 'W': size = 2; break;
case 'L': size = 4; break;
case 'M': size = 8; break;
case 'E': datac[1] = datac[2] = datac[4] = datac[8] = "#P/ec"; break;
case 'r': op = OREAD; break;
case 'w': op = OWRITE; break;
default: sysfatal("bad flag %c", ARGC());