]> git.lizzy.rs Git - plan9front.git/commitdiff
moved /dev/mordor to devcons
authoraiju <devnull@localhost>
Sat, 16 Apr 2011 12:15:01 +0000 (14:15 +0200)
committeraiju <devnull@localhost>
Sat, 16 Apr 2011 12:15:01 +0000 (14:15 +0200)
sys/man/3/arch
sys/man/3/cons
sys/src/9/pc/devarch.c
sys/src/9/port/devcons.c

index 77ef0276f3ca7270b613e111613a5669425d4c1b..7cd5e82fb3a186c0cfbb3dde70fe7460fd32a5d2 100644 (file)
@@ -12,7 +12,6 @@ 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.
@@ -122,10 +121,6 @@ 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
index d877997169b10c3a57cc4516288a042c9c951b5d..c816e1b178bcea8e14f376df351552b0d06a8500 100755 (executable)
@@ -334,6 +334,10 @@ the textual file descriptor number of a file or device on which to swap.
 See
 .IR swap (8).
 .PP
+Reads and writes to
+.IR mordor
+will inevitably cause the front to fall off.
+.PP
 The other files served by the
 .I cons
 device are all single numbers:
index c4527168267e121a84b815649af346c1331362f8..3228736ee1d92a83028128c700888a15ad2cb0c9 100644 (file)
@@ -987,20 +987,6 @@ 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)
 {
@@ -1049,7 +1035,6 @@ archinit(void)
 
        addarchfile("cputype", 0444, cputyperead, nil);
        addarchfile("archctl", 0664, archctlread, archctlwrite);
-       addarchfile("mordor", 0666, mordorread, mordorwrite);
 }
 
 /*
index 6666f01b5adbf765d2865f78734cb5575b0fc816..93ddef29d54fd389b8ab377a9e0c8eb13c3168cf 100644 (file)
@@ -594,6 +594,7 @@ enum{
        Qtime,
        Quser,
        Qzero,
+       Qmordor,
        Qconfig,
 };
 
@@ -627,6 +628,7 @@ static Dirtab consdir[]={
        "user",         {Quser},        0,              0666,
        "zero",         {Qzero},        0,              0444,
        "config",       {Qconfig},      0,              0444,
+       "mordor",       {Qmordor},      0,              0666,
 };
 
 int
@@ -958,6 +960,10 @@ consread(Chan *c, void *buf, long n, vlong off)
        case Qzero:
                memset(buf, 0, n);
                return n;
+       
+       case Qmordor:
+               error("one does not simply read from mordor");
+               return 0;
 
        case Qosversion:
                snprint(tmp, sizeof tmp, "2000");
@@ -1122,6 +1128,10 @@ conswrite(Chan *c, void *va, long n, vlong off)
                        buf[n-1] = 0;
                kstrdup(&sysname, buf);
                break;
+       
+       case Qmordor:
+               error("one does not simply write to mordor");
+               return 0;
 
        default:
                print("conswrite: %#llux\n", c->qid.path);