From 28a21c135e70d1df3e857b59396413d5b734d40e Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 26 Jul 1995 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1995-07-26 --- pc/devastar.c | 3 +-- pc/devata.c | 3 +-- pc/devconfig.c | 3 +-- pc/devether.c | 3 +-- pc/devfloppy.c | 3 +-- pc/devhard.c | 3 +-- pc/devi82365.c | 9 +++------ pc/devlpt.c | 3 +-- pc/devrtc.c | 3 +-- pc/devvga.c | 3 +-- pc/io.h | 4 ++-- pc/mem.h | 2 +- pc/pci.c | 11 +++++++++++ pc/scsi.c | 2 +- port/devenv.c | 3 +-- port/devpipe.c | 6 ++---- 16 files changed, 30 insertions(+), 34 deletions(-) diff --git a/pc/devastar.c b/pc/devastar.c index 648177e0c23ba9876312f7ddd6f471e50fb10952..d503b895bdf5545518ec9678a31064dbbbc66b28 100644 --- a/pc/devastar.c +++ b/pc/devastar.c @@ -1214,9 +1214,8 @@ astarbwrite(Chan *c, Block *bp, ulong offset) } void -astarcreate(Chan *c, char *name, int omode, ulong perm) +astarcreate(Chan*, char*, int, ulong) { - USED(c, name, omode, perm); error(Eperm); } diff --git a/pc/devata.c b/pc/devata.c index effcad0e3bb36729e460a8118ec5847d65627863..e41271b2fa1f14eae5dea82957bea32129ed99f0 100644 --- a/pc/devata.c +++ b/pc/devata.c @@ -290,9 +290,8 @@ ataopen(Chan *c, int omode) } void -atacreate(Chan *c, char *name, int omode, ulong perm) +atacreate(Chan*, char*, int, ulong) { - USED(c, name, omode, perm); error(Eperm); } diff --git a/pc/devconfig.c b/pc/devconfig.c index 7257d37a73e5ead960b2653ac941af90f3d13a01..6a5ae6edcd71cdd0ba86f5f70dfeb4485202ff40 100644 --- a/pc/devconfig.c +++ b/pc/devconfig.c @@ -87,9 +87,8 @@ configopen(Chan *c, int omode) } void -configcreate(Chan *c, char *name, int omode, ulong perm) +configcreate(Chan*, char*, int, ulong) { - USED(c, name, omode, perm); error(Eperm); } diff --git a/pc/devether.c b/pc/devether.c index a7bc7414c6d789a5c0d3a78fedbcbf82d91aa87d..bc412778a1e4eb12deb450b7dc7f1dcfa2d79741 100644 --- a/pc/devether.c +++ b/pc/devether.c @@ -65,9 +65,8 @@ etheropen(Chan *c, int omode) } void -ethercreate(Chan *c, char *name, int omode, ulong perm) +ethercreate(Chan*, char*, int, ulong) { - USED(c, name, omode, perm); } void diff --git a/pc/devfloppy.c b/pc/devfloppy.c index add118080dc4b6497335777b9505632878125f22..88f7b86684691ce2bf109fb378ce5ed275ad396d 100644 --- a/pc/devfloppy.c +++ b/pc/devfloppy.c @@ -353,9 +353,8 @@ floppyopen(Chan *c, int omode) } void -floppycreate(Chan *c, char *name, int omode, ulong perm) +floppycreate(Chan*, char*, int, ulong) { - USED(c, name, omode, perm); error(Eperm); } diff --git a/pc/devhard.c b/pc/devhard.c index 66deedf441450a1ae499571bf391aebebe967c7d..0f484075ca0751b201fd04c5e16e52033fd3990c 100644 --- a/pc/devhard.c +++ b/pc/devhard.c @@ -287,9 +287,8 @@ hardopen(Chan *c, int omode) } void -hardcreate(Chan *c, char *name, int omode, ulong perm) +hardcreate(Chan*, char*, int, ulong) { - USED(c, name, omode, perm); error(Eperm); } diff --git a/pc/devi82365.c b/pc/devi82365.c index 456e68ebc9ce397948346ceec3f89ec24e5fb50e..6fc7f9230d3ba15d86c4b3f283cceb433d73b354 100644 --- a/pc/devi82365.c +++ b/pc/devi82365.c @@ -665,23 +665,20 @@ i82365open(Chan *c, int omode) } void -i82365create(Chan *c, char *name, int omode, ulong perm) +i82365create(Chan*, char*, int, ulong) { - USED(c, name, omode, perm); error(Eperm); } void -i82365remove(Chan *c) +i82365remove(Chan*) { - USED(c); error(Eperm); } void -i82365wstat(Chan *c, char *dp) +i82365wstat(Chan*, char*) { - USED(c, dp); error(Eperm); } diff --git a/pc/devlpt.c b/pc/devlpt.c index 523e12e1cc93f6bc6943359b05e302d785537baa..c0d9d3100f3d4a8ae6a68b50bc34d03a73ffe14f 100644 --- a/pc/devlpt.c +++ b/pc/devlpt.c @@ -124,9 +124,8 @@ lptopen(Chan *c, int omode) } void -lptcreate(Chan *c, char *name, int omode, ulong perm) +lptcreate(Chan*, char*, int, ulong) { - USED(c, name, omode, perm); error(Eperm); } diff --git a/pc/devrtc.c b/pc/devrtc.c index 746b49e925d142a7e0a8fa082f6eeceda9255da5..b010d4aaddcfffe05e2f2ceeb8b3afb2bb3c36ce 100644 --- a/pc/devrtc.c +++ b/pc/devrtc.c @@ -107,9 +107,8 @@ rtcopen(Chan *c, int omode) } void -rtccreate(Chan *c, char *name, int omode, ulong perm) +rtccreate(Chan*, char*, int, ulong) { - USED(c, name, omode, perm); error(Eperm); } diff --git a/pc/devvga.c b/pc/devvga.c index 60bc8c617a407b3585b0ef9df23d228d74d84b11..e6d96f3a65b031222ebee4226c6ab649623030c1 100644 --- a/pc/devvga.c +++ b/pc/devvga.c @@ -152,9 +152,8 @@ vgaopen(Chan *c, int omode) } void -vgacreate(Chan *c, char *name, int omode, ulong perm) +vgacreate(Chan*, char*, int, ulong) { - USED(c, name, omode, perm); error(Eperm); } diff --git a/pc/io.h b/pc/io.h index abb7bab8469ddca35c2cd37362847bedf30c6583..e31b6c634936743ccc39828db72e3aca801133c7 100644 --- a/pc/io.h +++ b/pc/io.h @@ -46,8 +46,8 @@ enum { /* configuration mechanism #1 */ /* configuration mechanism #2 */ PCIcse = 0xCF8, /* configuration space enable */ PCIforward = 0xCFA, /* which bus */ - - MaxPCI = 16, + + MaxPCI = 32, /* 16 for mechanism #2 */ }; typedef struct PCIcfg { diff --git a/pc/mem.h b/pc/mem.h index a829ab1ad884b039140be694860506c4881dd46e..9cbeaf27e6c105cd6eaccbb542f081215f96c0d6 100644 --- a/pc/mem.h +++ b/pc/mem.h @@ -43,7 +43,7 @@ #define UZERO 0 /* base of user address space */ #define UTZERO (UZERO+BY2PG) /* first address in user text */ #define KZERO 0x80000000 /* base of kernel address space */ -#define KTZERO KZERO /* first address in kernel text */ +#define KTZERO 0x80100000 /* first address in kernel text */ #define TSTKTOP 0xC0000000 /* end of new stack in sysexec */ #define TSTKSIZ 10 #define USTKTOP (TSTKTOP-TSTKSIZ*BY2PG) /* byte just beyond user stack */ diff --git a/pc/pci.c b/pc/pci.c index 6a2bec5043f3b1b018ac517dbfa638c1fb82f8e5..08c9e329fd8b90926c878d0fdcf426691cdf6be1 100644 --- a/pc/pci.c +++ b/pc/pci.c @@ -71,6 +71,8 @@ pcicfgr(int busno, int devno, int funcno, int regno, void* data, int nbytes) break; case 2: + if(devno >= 16) + break; outb(PCIcse, 0x80|((funcno & 0x07)<<1)); outb(PCIforward, busno); @@ -115,6 +117,8 @@ pcicfgw(int busno, int devno, int funcno, int regno, void* data, int nbytes) break; case 2: + if(devno >= 16) + break; outb(PCIcse, 0x80|((funcno & 0x07)<<1)); outb(PCIforward, busno); @@ -137,7 +141,14 @@ pcimatch(int busno, int devno, PCIcfg* pcicfg) { ulong l; + lock(&pcicfglock); + if(pcicfgmode == -1) + pcicfginit(busno); + unlock(&pcicfglock); + while(devno < MaxPCI){ + if(pcicfgmode == 2 && devno >= 16) + break; l = 0; pcicfgr(busno, devno, 0, 0, &l, sizeof(ulong)); devno++; diff --git a/pc/scsi.c b/pc/scsi.c index 03bac1dde09bdfee958d92e9d09d44e5bfe1e6d3..867e1b5c97d639fee3b66f472928ad556d454800 100644 --- a/pc/scsi.c +++ b/pc/scsi.c @@ -466,7 +466,7 @@ scsibufsize(Target *t, char lun, int size) } int -scsireadcdda(Target *t, char lun, void *b, long n, long bsize, long bno) +scsireadcdda(Target *t, char lun, int dir, void *b, long n, long bsize, long bno) { uchar cmd[10]; int s, nbytes; diff --git a/port/devenv.c b/port/devenv.c index 0bd9b76115cb2a3d7a957340efd1558f1c12028b..077421bce3312ef7631b9a6760632cb7d3ba9525 100644 --- a/port/devenv.c +++ b/port/devenv.c @@ -106,12 +106,11 @@ envopen(Chan *c, int omode) } void -envcreate(Chan *c, char *name, int omode, ulong perm) +envcreate(Chan *c, char *name, int omode, ulong) { Egrp *eg; Evalue *e; - USED(perm); if(c->qid.path != CHDIR) error(Eperm); diff --git a/port/devpipe.c b/port/devpipe.c index 496416fce6b6b3ccbc44659a33d5e388a9544a75..5ba9b7e0d941d82fabfbd22a6b9dba15ad6645a8 100644 --- a/port/devpipe.c +++ b/port/devpipe.c @@ -197,16 +197,14 @@ pipeopen(Chan *c, int omode) } void -pipecreate(Chan *c, char *name, int omode, ulong perm) +pipecreate(Chan*, char*, int, ulong) { - USED(c, name, omode, perm); error(Egreg); } void -piperemove(Chan *c) +piperemove(Chan*) { - USED(c); error(Egreg); }