[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

hz!=100 and ehci.c



hello,

In sys/arch/i386/i386/machdep.c it seems that if HZ is defined
then we use a simple microtime() instead of i8254_microtime().
However microtime is a macro defined in sys/arch/i386/include/cpu.h, 
this makes machdep.c impossible to compile in this case.

i don't know the right way to fix this, but the attached patch
works for me (at HZ=1024). "sysctl kern.clockrate" returns:

kern.clockrate=tick = 976, tickadj = 3, hz = 1024, profhz = 1024, stathz = 128

===

also, sys/dev/usb/ehci.c does not compile if USB_DEBUG or
OHCI_DEBUG is defined but EHCI_DEBUG is not defined, attached
a patch.

-- 
Alexandre
Index: i386/machdep.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/i386/machdep.c,v
retrieving revision 1.299
diff -u -r1.299 machdep.c
--- i386/machdep.c	2004/06/15 23:36:55	1.299
+++ i386/machdep.c	2004/06/19 21:01:55
@@ -250,7 +250,11 @@
 int setperf_prio = 0;		/* for concurrent handlers */
 
 void (*delay_func)(int) = i8254_delay;
+#ifndef HZ
 void (*microtime_func)(struct timeval *) = i8254_microtime;
+#else
+void (*microtime_func)(struct timeval *) = default_microtime;
+#endif
 void (*initclock_func)(void) = i8254_initclocks;
 void (*update_cpuspeed)(void) = NULL;
 
@@ -2676,7 +2680,7 @@
  * for HZ=100.
  */
 void
-microtime(tvp)
+default_microtime(tvp)
 	register struct timeval *tvp;
 {
 	int s = splhigh();
Index: include/cpu.h
===================================================================
RCS file: /cvs/src/sys/arch/i386/include/cpu.h,v
retrieving revision 1.61
diff -u -r1.61 cpu.h
--- include/cpu.h	2004/06/13 21:49:16	1.61
+++ include/cpu.h	2004/06/19 21:01:58
@@ -348,6 +348,7 @@
 void	i8254_delay(int);
 void	i8254_microtime(struct timeval *);
 void	i8254_initclocks(void);
+void	default_microtime(struct timeval *);
 
 /* est.c */
 #if !defined(SMALL_KERNEL) && defined(I686_CPU)
Index: ehci.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/ehci.c,v
retrieving revision 1.5
diff -u -r1.5 ehci.c
--- ehci.c	2004/05/30 01:25:17	1.5
+++ ehci.c	2004/06/19 21:03:29
@@ -819,7 +819,7 @@
 		intrs = EHCI_STS_INTRS(EOREAD4(sc, EHCI_USBSTS)) &
 			sc->sc_eintrs;
 		DPRINTFN(15,("ehci_waitintr: 0x%04x\n", intrs));
-#ifdef OHCI_DEBUG
+#ifdef EHCI_DEBUG
 		if (ehcidebug > 15)
 			ehci_dump_regs(sc);
 #endif
@@ -1066,7 +1066,7 @@
 
 	DPRINTF(("ehci_device_clear_toggle: epipe=%p status=0x%x\n",
 		 epipe, epipe->sqh->qh.qh_qtd.qtd_status));
-#ifdef USB_DEBUG
+#if defined(USB_DEBUG) && defined(EHCI_DEBUG)
 	if (ehcidebug)
 		usbd_dump_pipe(pipe);
 #endif
@@ -2379,7 +2379,7 @@
 	ehci_softc_t *sc = (ehci_softc_t *)epipe->pipe.device->bus;
 
 	DPRINTF(("ehci_timeout: exfer=%p\n", exfer));
-#ifdef USB_DEBUG
+#if defined(USB_DEBUG) && defined(EHCI_DEBUG)
 	if (ehcidebug > 1)
 		usbd_dump_pipe(exfer->xfer.pipe);
 #endif
include		"arch/i386/conf/GENERIC"

option		HZ=1024
option		MIDI_DEBUG
option		AUDIO_DEBUG
option		USB_DEBUG
option		UMIDI_DEBUG
option		UHCI_DEBUG
OpenBSD 3.5-current (POULPE) #3: Sun Jun 20 00:31:04 CEST 2004
    alex_(_at_)_poulpe_(_dot_)_localdomain:/h4/compile/POULPE
cpu0: Intel Pentium (P54C) ("GenuineIntel" 586-class) 200 MHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,MCE,CX8
: F00F bug workaround installed
real mem  = 66691072 (65128K)
avail mem = 53288960 (52040K)
using 839 buffers containing 3436544 bytes (3356K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+(87) BIOS, date 03/31/98, BIOS32 rev. 0 @ 0xf6fd7
apm0 at bios0: Power Management spec V1.2
apm0: AC on, battery charge unknown
pcibios0 at bios0: rev. 2.1 @ 0xf6d70/0x910
pcibios0: PCI IRQ Routing Table rev. 1.0 @ 0xf75a0/128 (6 entries)
pcibios0: PCI Interrupt Router at 000:07:0 ("Intel 82371FB ISA" rev 0x00)
pcibios0: PCI bus #0 is the last bus
bios0: ROM list: 0xc0000/0x8000
cpu0 at mainbus0
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel 82439TX System" rev 0x01
pcib0 at pci0 dev 7 function 0 "Intel 82371AB PIIX4 ISA" rev 0x01
pciide0 at pci0 dev 7 function 1 "Intel 82371AB IDE" rev 0x01: DMA, channel 0 wired to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: <WDC AC21600L>
wd0: 16-sector PIO, LBA, 1549MB, 3173184 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2
atapiscsi0 at pciide0 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <MITSUMI, CD-ROM FX810T !B, U05> SCSI0 5/cdrom removable
cd0(pciide0:1:0): using PIO mode 0, DMA mode 2
uhci0 at pci0 dev 7 function 2 "Intel 82371AB USB" rev 0x01: irq 11
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
"Intel 82371AB Power Mgmt" rev 0x01 at pci0 dev 7 function 3 not configured
cmpci0 at pci0 dev 11 function 0 "C-Media Electronics CMI8738/C3DX Audio" rev 0x10: irq 10
audio0 at cmpci0
de0 at pci0 dev 13 function 0 "DEC 21140" rev 0x20: irq 9
de0: SMC 9332BDT 21140A [10-100Mb/s] pass 2.0 address 00:e0:29:00:2e:0d
vga1 at pci0 dev 17 function 0 "S3 Trio64V2/DX" rev 0x06
wsdisplay0 at vga1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
dc0 at pci0 dev 18 function 0 "DEC 21142/3" rev 0x30: irq 11, address 00:80:5a:15:20:f0
dcphy0 at dc0 phy 31: internal PHY
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
sysbeep0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
npx0 at isa0 port 0xf0/16: using exception 16
pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pccom1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
isapnp0 at isa0 port 0x279: read port 0x203
isapnp0: No current device for tag, card 1
sb1 at isapnp0 "Creative SB AWE64 PnP, CTL0045, , Audio" port 0x220/16,0x330/2,0x388/4 irq 5 drq 1,5: dsp v4.16
midi1 at sb1: <SB MPU-401 UART>
audio1 at sb1
opl0 at sb1: model OPL3
midi2 at opl0: <SB Yamaha OPL3>
joy0 at isapnp0 "Creative SB AWE64 PnP, CTL7002, PNPB02F, Game" port 0x200/8
"Creative SB AWE64 PnP, CTL0022, , WaveTable" at isapnp0 port 0x620/4 not configured
biomask f945 netmask fb45 ttymask fbc7
pctr: 586-class performance counters and user-level cycle counter enabled
dkcsum: wd0 matched BIOS disk 80
root on wd0a
rootdev=0x0 rrootdev=0x300 rawdev=0x302
umidi0 at uhub0 port 2 configuration 1 interface 0
umidi0: Roland Roland XV-2020, rev 1.10/1.00, addr 2
umidi0: (genuine USB-MIDI)
umidi0: out=1, in=1
midi3 at umidi0: <USB MIDI I/F>
de0: enabling Full Duplex 100baseTX port