summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-04-17 02:15:24 +0000
committercinap_lenrek <cinap_lenrek@localhost>2011-04-17 02:15:24 +0000
commit049c2c3434ed71b62bdf06b2a8214ddfe529796e (patch)
tree50d4e8b15074a4d2e0c9f99a484e2f80f8d0a90a /sys
parent11f3fac32cc34ae2b0dd7d12ef6e0ab59690cc4e (diff)
parent6ca93675ed11b7eb2615a4e5d005bfc18496d32a (diff)
merge
Diffstat (limited to 'sys')
-rw-r--r--sys/man/3/arch5
-rw-r--r--sys/src/9/pc/devarch.c15
2 files changed, 20 insertions, 0 deletions
diff --git a/sys/man/3/arch b/sys/man/3/arch
index 7cd5e82fb..77ef0276f 100644
--- a/sys/man/3/arch
+++ b/sys/man/3/arch
@@ -12,6 +12,7 @@ arch \- architecture-specific information and control
.B /dev/iol
.B /dev/iow
.B /dev/irqalloc
+.B /dev/mordor
.SH DESCRIPTION
This device presents textual information about PC hardware and allows
user-level control of the I/O ports on x86-class and DEC Alpha machines.
@@ -121,6 +122,10 @@ cause 8-bit wide, 16-bit wide, and 32-bit wide requests to
I/O ports.
The port accessed is determined by the byte offset of the
file descriptor.
+.PP
+Reads and writes to
+.IR mordor
+will inevitably cause the front to fall off.
.SH EXAMPLE
The following code reads from an x86 byte I/O port.
.IP
diff --git a/sys/src/9/pc/devarch.c b/sys/src/9/pc/devarch.c
index 3228736ee..c45271682 100644
--- a/sys/src/9/pc/devarch.c
+++ b/sys/src/9/pc/devarch.c
@@ -987,6 +987,20 @@ archctlwrite(Chan*, void *a, long n, vlong)
return n;
}
+static long
+mordorread(Chan*, void*, long, vlong)
+{
+ error("one does not simply read from mordor");
+ return 0;
+}
+
+static long
+mordorwrite(Chan*, void*, long, vlong)
+{
+ error("one does not simply write into mordor");
+ return 0;
+}
+
void
archinit(void)
{
@@ -1035,6 +1049,7 @@ archinit(void)
addarchfile("cputype", 0444, cputyperead, nil);
addarchfile("archctl", 0664, archctlread, archctlwrite);
+ addarchfile("mordor", 0666, mordorread, mordorwrite);
}
/*