merge
This commit is contained in:
commit
049c2c3434
2 changed files with 20 additions and 0 deletions
|
@ -12,6 +12,7 @@ arch \- architecture-specific information and control
|
||||||
.B /dev/iol
|
.B /dev/iol
|
||||||
.B /dev/iow
|
.B /dev/iow
|
||||||
.B /dev/irqalloc
|
.B /dev/irqalloc
|
||||||
|
.B /dev/mordor
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
This device presents textual information about PC hardware and allows
|
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.
|
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.
|
I/O ports.
|
||||||
The port accessed is determined by the byte offset of the
|
The port accessed is determined by the byte offset of the
|
||||||
file descriptor.
|
file descriptor.
|
||||||
|
.PP
|
||||||
|
Reads and writes to
|
||||||
|
.IR mordor
|
||||||
|
will inevitably cause the front to fall off.
|
||||||
.SH EXAMPLE
|
.SH EXAMPLE
|
||||||
The following code reads from an x86 byte I/O port.
|
The following code reads from an x86 byte I/O port.
|
||||||
.IP
|
.IP
|
||||||
|
|
|
@ -987,6 +987,20 @@ archctlwrite(Chan*, void *a, long n, vlong)
|
||||||
return n;
|
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
|
void
|
||||||
archinit(void)
|
archinit(void)
|
||||||
{
|
{
|
||||||
|
@ -1035,6 +1049,7 @@ archinit(void)
|
||||||
|
|
||||||
addarchfile("cputype", 0444, cputyperead, nil);
|
addarchfile("cputype", 0444, cputyperead, nil);
|
||||||
addarchfile("archctl", 0664, archctlread, archctlwrite);
|
addarchfile("archctl", 0664, archctlread, archctlwrite);
|
||||||
|
addarchfile("mordor", 0666, mordorread, mordorwrite);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue