ref: e8d2400c5eec117be414d005dc0b034d0deaacbf
parent: f19a0e48cb42304dda1041fe5ea6d8bc0a127aab
parent: fad07efdc79e58cd02b6810fb4ff0003e1c97c82
author: cinap_lenrek <cinap_lenrek@localhost>
date: Sat Apr 16 22:15:24 EDT 2011
merge
--- a/sys/man/3/arch
+++ b/sys/man/3/arch
@@ -12,6 +12,7 @@
.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 @@
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
--- a/sys/src/9/pc/devarch.c
+++ b/sys/src/9/pc/devarch.c
@@ -987,6 +987,20 @@
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 @@
addarchfile("cputype", 0444, cputyperead, nil); addarchfile("archctl", 0664, archctlread, archctlwrite);+ addarchfile("mordor", 0666, mordorread, mordorwrite);}
/*
--
⑨