Subject: kern/2875: sys/dev/isa/if_ed.c fails to compile if options ED_DEBUG is set.
To: None <gnats-bugs@gnats.netbsd.org>
From: Kouichi Matsuda <kmatsuda@pingu.math.hokudai.ac.jp>
List: netbsd-bugs
Date: 10/21/1996 14:11:13
>Number: 2875
>Category: kern
>Synopsis: sys/dev/isa/if_ed.c fails to compile if options ED_DEBUG is set.
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: kern-bug-people (Kernel Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Oct 20 22:20:00 1996
>Last-Modified:
>Originator: Kouichi Matsuda
>Organization:
Department of Mathematics, Faculty of Science, Hokkaido University
>Release: NetBSD 1.2
>Environment:
System: NetBSD pingu.math.hokudai.ac.jp 1.2 NetBSD 1.2 (Julia) #203: Mon Oct 21 13:26:25 JST 1996 kmatsuda@pingu.math.hokudai.ac.jp:/usr/src/sys/arch/i386/compile/Julia i386
>Description:
sys/dev/isa/if_ed.c fails to compile if kernel options ED_DEBUG
is set.
It is because NIC_GET (lines 1936, in edintr()) is used
without bus_chipset_tag (bc) and bus_io_handle (ioh).
>How-To-Repeat:
Build an i386 kernel with options ED_DEBUG. This yields
cc -O2 -Werror -I. -I../../../../arch -I../../../.. -DI386_CPU -DI486_CPU -DI586_CPU -DMATH_EMULATE -DXSERVER -DUCONSOLE -DINSECURE -DMACHINE_NONCONTIG -DTIMEZONE=0 -DDST=0 -DSWAPPAGER -DVNODEPAGER -DDEVPAGER -DDDB -DDIAGNOSTIC -DKTRACE -DSYSVMSG -DSYSVSEM -DSYSVSHM -DCOMPAT_NOMID -DCOMPAT_09 -DCOMPAT_10 -DCOMPAT_11 -DCOMPAT_43 -DTCP_COMPAT_42 -DCOMPAT_SVR4 -DCOMPAT_IBCS2 -DCOMPAT_LINUX -DCOMPAT_FREEBSD -DUSER_LDT -DLKM -DFFS -DQUOTA -DLFS -DMFS -DNFSCLIENT -DNFSSERVER -DCD9660 -DMSDOSFS -DFDESC -DFIFO -DKERNFS -DNULLFS -DPORTAL -DPROCFS -DUMAPFS -DUNION -DINET -DNS -DISO -DTPIP -DEON -DCCITT -DLLC -DHDLC -DED_DEBUG -DGENERIC -D_KERNEL -Di386 -c ../../../../dev/isa/if_ed.c
../../../../dev/isa/if_ed.c:1936: macro `NIC_GET' used with only 2 args
>Fix:
Add bus_chipset_tag and bus_io_handle as follows;
diff -cr src/sys/dev/isa/if_ed.c.orig src/sys/dev/isa/if_ed.c
*** src/sys/dev/isa/if_ed.c.orig Mon May 13 20:36:18 1996
--- src/sys/dev/isa/if_ed.c Mon Oct 21 13:36:02 1996
***************
*** 1933,1939 ****
#ifdef ED_DEBUG
printf("%s: receive error %x\n",
sc->sc_dev.dv_xname,
! NIC_GET(nicbase, ED_P0_RSR));
#endif
}
--- 1933,1939 ----
#ifdef ED_DEBUG
printf("%s: receive error %x\n",
sc->sc_dev.dv_xname,
! NIC_GET(bc, ioh, nicbase, ED_P0_RSR));
#endif
}
>Audit-Trail:
>Unformatted: