trouble porting pci kld
Chuck Tuffli
chuck_tuffli at agilent.com
Sun Jul 18 18:05:29 PDT 2004
Hi. I have a KLD that works under the FreeBSD 4.x and am in the
process of porting it to DFly, but am running into some basic compile
problems. If I have something that built under 4.x, should typing
'make' just work? Two notes: 1) the build is using code just cvs up'd
today, and 2) the build directory isn't in the /usr/src hierarchy.
On my first build attempt, I got errors about stdint.h
. ..
cc -O -pipe -O2 -D_KERNEL -Wall -Wredundant-decls -Wnested-externs
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline
-Wcast-qual -fformat-extensions -ansi -DKLD_MODULE -nostdinc -I. -I@
-I/ctuffli/dev/dfbsd/obj/usr/include -mpreferred-stack-boundary=2
-fno-common -ffreestanding -Wall -Wredundant-decls -Wnested-externs
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline
-Wcast-qual -fformat-extensions -ansi -c /ctuffli/dev/dfbsd/mch_pci.c
In file included from @/sys/param.h:72,
from /ctuffli/dev/dfbsd/mch_pci.c:28:
@/sys/types.h:47: stdint.h: No such file or directory
Changing
#include <stdint.h>
to
#include <sys/stdint.h>
in src/sys/sys/types.h makes this problem go away. The next problem
seems to be that typedefs are missing for uint32_t
. ..
In file included from /ctuffli/dev/dfbsd/mch_pci.c:29:
@/sys/systm.h:134: syntax error before `crc32_tab'
@/sys/systm.h:134: warning: type defaults to `int' in declaration of `crc32_tab'
@/sys/systm.h:134: warning: data definition has no type or storage class
@/sys/systm.h:135: syntax error before `crc32'
@/sys/systm.h:135: warning: type defaults to `int' in declaration of `crc32'
@/sys/systm.h:135: warning: data definition has no type or storage class
This is the order of the #includes in the file which was modeled after
the aic7xxx driver
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <machine/bus_memio.h>
#include <machine/bus.h>
#include <machine/resource.h>
#include <sys/rman.h>
#include <bus/pci/pcireg.h>
#include <bus/pci/pcivar.h>
Any ideas?
--
Chuck Tuffli
Agilent Technologies, Storage Area Networking
More information about the Kernel
mailing list