Browse Source

Plan 9 from Bell Labs 2003-06-25

David du Colombier 19 years ago
parent
commit
87b53eb4cb
7 changed files with 253 additions and 19 deletions
  1. 5 3
      dist/replica/plan9.db
  2. 5 0
      dist/replica/plan9.log
  3. 1 1
      sys/src/9/alphapc/fns.h
  4. 24 15
      sys/src/9/alphapc/trap.c
  5. 84 0
      sys/src/9/pc/pccpuf
  6. 116 0
      sys/src/9/pc/pcf
  7. 18 0
      sys/src/9/pc/sdata.c

+ 5 - 3
dist/replica/plan9.db

@@ -4942,7 +4942,7 @@ sys/src/9/alphapc/etherif.h - 664 sys sys 1045063621 1025
 sys/src/9/alphapc/faultalpha.c - 664 sys sys 1015012784 1257
 sys/src/9/alphapc/fdc37c93x.c - 664 sys sys 1015012785 1110
 sys/src/9/alphapc/floppy.h - 664 sys sys 1015012785 3783
-sys/src/9/alphapc/fns.h - 664 sys sys 1039794342 3889
+sys/src/9/alphapc/fns.h - 664 sys sys 1056503356 3888
 sys/src/9/alphapc/fptrap.c - 664 sys sys 1015012785 707
 sys/src/9/alphapc/i8259.c - 664 sys sys 1015012785 3409
 sys/src/9/alphapc/initcode - 664 sys sys 1039753419 779
@@ -4964,7 +4964,7 @@ sys/src/9/alphapc/sd53c8xx.c - 664 sys sys 1015012787 51009
 sys/src/9/alphapc/sdata.c - 664 sys sys 1015012787 25
 sys/src/9/alphapc/sdscsi.c - 664 sys sys 1015012787 26
 sys/src/9/alphapc/sio.c - 664 sys sys 1015012787 293
-sys/src/9/alphapc/trap.c - 664 sys sys 1047261658 17822
+sys/src/9/alphapc/trap.c - 664 sys sys 1056503355 17893
 sys/src/9/alphapc/uarti8250.c - 664 sys sys 1015012788 29
 sys/src/9/alphapc/vga.c - 664 sys sys 1015012788 23
 sys/src/9/alphapc/vgargb524.c - 664 sys sys 1015012788 29
@@ -5169,7 +5169,9 @@ sys/src/9/pc/pc - 664 sys sys 1055700612 1360
 sys/src/9/pc/pcauth - 664 sys sys 1055700612 609
 sys/src/9/pc/pccd - 664 sys sys 1055090302 1302
 sys/src/9/pc/pccpu - 664 sys sys 1055090302 803
+sys/src/9/pc/pccpuf - 664 sys sys 1056503364 909
 sys/src/9/pc/pcdisk - 664 sys sys 1055700613 1432
+sys/src/9/pc/pcf - 664 sys sys 1056503364 1457
 sys/src/9/pc/pcfl - 664 sys sys 1042004821 1563
 sys/src/9/pc/pcflop - 664 sys sys 1055700671 1410
 sys/src/9/pc/pci.c - 664 sys sys 1032052921 23359
@@ -5186,7 +5188,7 @@ sys/src/9/pc/screen.h - 664 sys sys 1048644129 3760
 sys/src/9/pc/sd53c8xx.c - 664 sys sys 1055689891 52089
 sys/src/9/pc/sd53c8xx.i - 664 sys sys 1045063730 27355
 sys/src/9/pc/sd53c8xx.n - 664 sys sys 1032059019 12455
-sys/src/9/pc/sdata.c - 664 sys sys 1055087706 49704
+sys/src/9/pc/sdata.c - 664 sys sys 1056475678 50230
 sys/src/9/pc/sdmylex.c - 664 sys sys 1015014523 27750
 sys/src/9/pc/sdscsi.c - 664 sys sys 1055689892 7406
 sys/src/9/pc/trap.c - 664 sys sys 1056299507 19012

+ 5 - 0
dist/replica/plan9.log

@@ -12725,3 +12725,8 @@
 1056366156 85 c sys/man/3/usb - 664 sys sys 1056364534 6670
 1056391380 0 c sys/src/9/port/devsdp.c - 664 sys sys 1055688405 0
 1056398466 0 c 386/bin/upas/deliver - 775 sys sys 1056397816 98261
+1056475879 0 c sys/src/9/pc/sdata.c - 664 sys sys 1056475678 50230
+1056504706 0 c sys/src/9/alphapc/fns.h - 664 sys sys 1056503356 3888
+1056504706 1 c sys/src/9/alphapc/trap.c - 664 sys sys 1056503355 17893
+1056504706 2 a sys/src/9/pc/pcf - 664 sys sys 1056503364 1457
+1056504706 3 a sys/src/9/pc/pccpuf - 664 sys sys 1056503364 909

+ 1 - 1
sys/src/9/alphapc/fns.h

@@ -48,7 +48,7 @@ void		icflush(void);
 void		illegal0(void);
 void		intr0(void);
 void		intrenable(int, void (*)(Ureg*, void*), void*, int, char*);
-void		intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
+int		intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
 int		ioalloc(int, int, int, char*);
 void		iofree(int);
 void		ioinit(void);

+ 24 - 15
sys/src/9/alphapc/trap.c

@@ -36,7 +36,13 @@ void
 intrenable(int irq, void (*f)(Ureg*, void*), void* a, int tbdf, char *name)
 {
 	int vno;
-	Vctl *v, *p;
+	Vctl *v;
+
+	if(f == nil){
+		print("intrenable: nil handler for %d, tbdf 0x%uX for %s\n",
+			irq, tbdf, name);
+		return;
+	}
 
 	v = xalloc(sizeof(Vctl));
 	v->isintr = 1;
@@ -53,12 +59,6 @@ intrenable(int irq, void (*f)(Ureg*, void*), void* a, int tbdf, char *name)
 		iunlock(&vctllock);
 		print("intrenable: couldn't enable irq %d, tbdf 0x%uX for %s\n",
 			irq, tbdf, v->name);
-		if(p=vctl[vno]){
-			print("intrenable: irq %d is already used by", irq);
-			for(; p; p=p->next)
-				print(" %s", p->name);
-			print("\n");
-		}
 		xfree(v);
 		return;
 	}
@@ -73,7 +73,7 @@ intrenable(int irq, void (*f)(Ureg*, void*), void* a, int tbdf, char *name)
 	iunlock(&vctllock);
 }
 
-void
+int
 intrdisable(int irq, void (*f)(Ureg *, void *), void *a, int tbdf, char *name)
 {
 	Vctl **pv, *v;
@@ -85,15 +85,23 @@ intrdisable(int irq, void (*f)(Ureg *, void *), void *a, int tbdf, char *name)
 	 * is pretty meaningless.
 	 */
 	if(arch->intrvecno == nil)
-		return;
+		return -1;
 	vno = arch->intrvecno(irq);
 	ilock(&vctllock);
-	pv = &vctl[vno];
-	while (*pv && 
-		  ((*pv)->irq != irq || (*pv)->tbdf != tbdf || (*pv)->f != f || (*pv)->a != a ||
-		   strcmp((*pv)->name, name)))
-		pv = &((*pv)->next);
-	assert(*pv);
+	for(pv = &vctl[vno]; *pv != nil; pv = &((*pv)->next)){
+		if((*pv)->irq != irq)
+			continue;
+		if((*pv)->tbdf != tbdf)
+			continue;
+		if((*pv)->f != f)
+			continue;
+		if((*pv)->a != a)
+			continue;
+		if(strcmp((*pv)->name, name) != 0)
+			continue;
+		break;
+	}
+	assert(*pv != nil);
 
 	v = *pv;
 	*pv = (*pv)->next;	/* Link out the entry */
@@ -102,6 +110,7 @@ intrdisable(int irq, void (*f)(Ureg *, void *), void *a, int tbdf, char *name)
 		arch->intrdisable(irq);
 	iunlock(&vctllock);
 	xfree(v);
+	return 0;
 }
 
 int

+ 84 - 0
sys/src/9/pc/pccpuf

@@ -0,0 +1,84 @@
+dev
+	root
+	cons
+	arch
+	pnp		pci
+	env
+	pipe
+	proc
+	mnt
+	srv
+	dup
+	rtc
+	ssl
+	tls
+	bridge		log
+	sdp		thwack unthwack
+	cap
+	kprof
+	realtime	realtimesub edf
+
+	ether		netif
+	ip		arp chandial ip ipv6 ipaux iproute netlog nullmedium pktmedium ptclbsum386 inferno
+
+	sd
+	floppy		dma
+
+	uart
+	usb
+
+link
+	ether2000	ether8390
+	ether2114x	pci
+	ether79c970	pci
+	ether8003	ether8390
+	ether8139	pci
+	ether82543gc	pci
+	ether82557	pci
+	ether83815	pci
+	etherelnk3	pci
+	etherga620	pci
+	etherigbe	pci ethermii
+	ethersink
+	ethermedium
+	netdevmedium
+	loopbackmedium
+	usbuhci
+
+misc
+	archmp		mp apic
+
+	uarti8250
+	uartpci		pci
+
+	sdata		pci sdscsi
+	sd53c8xx	pci sdscsi
+
+
+ip
+	il
+	tcp
+	udp
+	ipifc
+	icmp
+	icmp6
+	gre
+	ipmux
+	esp
+	rudp
+
+port
+	int cpuserver = 1;
+
+boot cpu boot #S/sdC0/
+	il
+	tcp
+	local
+
+bootdir
+	bootpccpuf.out boot
+	/386/bin/ip/ipconfig
+	/386/bin/auth/factotum
+	/386/bin/disk/kfs
+	/386/bin/fossil/fossil
+	/386/bin/venti/venti

+ 116 - 0
sys/src/9/pc/pcf

@@ -0,0 +1,116 @@
+dev
+	root
+	cons
+	arch
+	pnp		pci
+	env
+	pipe
+	proc
+	mnt
+	srv
+	dup
+	rtc
+	ssl
+	tls
+	cap
+	kprof
+	realtime	realtimesub edf
+
+	ether		netif
+	ip		arp chandial ip ipv6 ipaux iproute netlog nullmedium pktmedium ptclbsum386 inferno
+
+	draw		screen vga vgax
+	mouse		mouse
+	vga
+
+	sd
+	floppy		dma
+	lpt
+
+	audio		dma
+	pccard
+	i82365		cis
+	uart
+	usb
+
+link
+	devpccard
+	devi82365
+	apm		apmjump
+	ether2000	ether8390
+	ether2114x	pci
+	ether589	etherelnk3
+	ether79c970	pci
+	ether8003	ether8390
+	ether8139
+	ether82543gc	pci
+	ether82557	pci
+	ether83815	pci
+	etherec2t	ether8390
+	etherelnk3	pci
+	etherga620	pci
+	etherigbe	pci ethermii
+	ethersink
+	ethersmc	devi82365 cis
+	etherwavelan	wavelan devi82365 cis pci
+	ethermedium
+	pcmciamodem
+	netdevmedium
+	loopbackmedium
+	usbuhci
+
+misc
+	archmp		mp apic
+
+	sdata		pci sdscsi
+	sd53c8xx		pci sdscsi
+	sdmylex		pci sdscsi
+
+	uarti8250
+	uartpci		pci
+
+	vga3dfx		+cur
+	vgaark2000pv	+cur
+	vgabt485	=cur
+	vgaclgd542x	+cur
+	vgaclgd546x	+cur
+	vgact65545	+cur
+	vgacyber938x	+cur
+	vgaet4000	+cur
+	vgahiqvideo	+cur
+	vgai81x	+cur
+	vgamach64xx	+cur
+	vgamga2164w	+cur
+	vgamga4xx	+cur
+	vganeomagic	+cur
+	vganvidia	+cur
+	vgargb524	=cur
+	vgas3		+cur vgasavage
+	vgat2r4		+cur
+	vgatvp3020	=cur
+	vgatvp3026	=cur
+	vgavmware	+cur
+
+ip
+	il
+	tcp
+	udp
+	ipifc
+	icmp
+	icmp6
+
+port
+	int cpuserver = 0;
+
+boot boot #S/sdC0/
+	il
+	tcp
+	local
+
+bootdir
+	bootpcf.out boot
+	/386/bin/ip/ipconfig
+	/386/bin/auth/factotum
+	/386/bin/disk/kfs
+	/386/bin/fossil/fossil
+	/386/bin/venti/venti

+ 18 - 0
sys/src/9/pc/sdata.c

@@ -1869,6 +1869,23 @@ atapnp(void)
 			 * Bugfix code here...
 			 */
 			break;
+		case (0x7441<<16)|0x1022:	/* AMD 768 */
+			/*
+			 * Set:
+			 *	0x41	prefetch, postwrite;
+			 *	0x43	FIFO configuration 1/2 and 1/2;
+			 *	0x44	status register read retry;
+			 *	0x46	DMA read and end of sector flush.
+			 */
+			r = pcicfgr8(p, 0x41);
+			pcicfgw8(p, 0x41, r|0xF0);
+			r = pcicfgr8(p, 0x43);
+			pcicfgw8(p, 0x43, (r & 0x90)|0x2A);
+			r = pcicfgr8(p, 0x44);
+			pcicfgw8(p, 0x44, r|0x08);
+			r = pcicfgr8(p, 0x46);
+			pcicfgw8(p, 0x46, (r & 0x0C)|0xF0);
+			break;
 		case (0x0646<<16)|0x1095:	/* CMD 646 */
 		case (0x0571<<16)|0x1106:	/* VIA 82C686 */
 		case (0x0211<<16)|0x1166:	/* ServerWorks IB6566 */
@@ -1882,6 +1899,7 @@ atapnp(void)
 		case (0x248A<<16)|0x8086:	/* 82801CA (ICH3, Mobile) */
 		case (0x248B<<16)|0x8086:	/* 82801CA (ICH3, High-End) */
 		case (0x24CB<<16)|0x8086:	/* 82801DB (ICH4, High-End) */
+		case (0x24DB<<16)|0x8086:	/* 82801EB (ICH5) */
 			break;
 		}