Re: includes in sys/amd64/amd64/mem.c

From: Conrad J. Sabatier <conrads_at_cox.net>
Date: Sun, 01 Aug 2004 20:16:50 -0500 (CDT)
On 01-Aug-2004 Mark Murray wrote:
> "Conrad J. Sabatier" writes:
>> Curious.  I compared the includes in mem.c for each architecture and
>> found that amd64 is the only one that doesn't include <sys/kernel.h>.
>> Is this an oversight?
> 
> Could be. Could you try adding that and see if it fixes things? I
> don't have access to a working AMD64 right now.
> 
>> Still waiting for the kernel build breakage on amd64 to be fixed. 
>> I'm at a loss, myself.
> 
> Erm, could you post the errors you see?

Sorry.  They were posted in another thread, but I'll provide them
again.

Adding "#include <sys/kernel.h>" *almost* fixes things, but there are
still some missing defines (from sys/amd64/include/vmparam.h, which is
not being included either).

In /etc/make.conf:

COPTFLAGS= -O2 -pipe -march=athlon64 -m64

cc -c -O2 -pipe -march=athlon64 -m64 -fno-strict-aliasing  -Wall
-Wredundant-decls -Wnested-externs -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual 
-fformat-extensions -std=c99 -g -nostdinc -I-  -I. -I/usr/src/sys
-I/usr/src/sys/contrib/dev/acpica -I/usr/src/sys/contrib/altq
-I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/contrib/pf
-I/usr/src/sys/contrib/dev/ath -I/usr/src/sys/contrib/dev/ath/freebsd
-I/usr/src/sys/contrib/ngatm -D_KERNEL -include opt_global.h
-fno-common -finline-limit=8000 --param inline-unit-growth=100 --param
large-function-growth=1000 -fno-builtin -fno-omit-frame-pointer
-mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx
-mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding
-Werror  /usr/src/sys/amd64/amd64/mem.c
/usr/src/sys/amd64/amd64/mem.c: In function `memrw':
/usr/src/sys/amd64/amd64/mem.c:97: warning: implicit declaration of
function `PHYS_TO_DMAP'
/usr/src/sys/amd64/amd64/mem.c:97: warning: nested extern declaration
of `PHYS_TO_DMAP'
/usr/src/sys/amd64/amd64/mem.c:97: warning: cast to pointer from
integer of different size
/usr/src/sys/amd64/amd64/mem.c:103: error: `DMAP_MIN_ADDRESS'
undeclared (first use in this function)
/usr/src/sys/amd64/amd64/mem.c:103: error: (Each undeclared identifier
is reported only once
/usr/src/sys/amd64/amd64/mem.c:103: error: for each function it appears
in.)
/usr/src/sys/amd64/amd64/mem.c:103: error: `DMAP_MAX_ADDRESS'
undeclared (first use in this function)
/usr/src/sys/amd64/amd64/mem.c:104: warning: implicit declaration of
function `DMAP_TO_PHYS'
/usr/src/sys/amd64/amd64/mem.c:104: warning: nested extern declaration
of `DMAP_TO_PHYS'
/usr/src/sys/amd64/amd64/mem.c:118: error: `KERNBASE' undeclared (first
use in this function)
*** Error code 1

Stop in /usr/obj/usr/src/sys/CUSTOM.

Adding '#include "/usr/src/sys/amd64/include/vmparam.h"' to mem.c (I
know this is a hack) produces this:

linking kernel.debug
amd64_mem.o(.text+0xa7a): In function `amd64_mrinit':
/usr/src/sys/amd64/amd64/amd64_mem.c:562: undefined reference to
`M_MEMDESC'
mem.o(.text+0x30c): In function `memioctl':
/usr/src/sys/amd64/amd64/mem.c:185: undefined reference to `M_MEMDESC'
mem.o(.text+0x332):/usr/src/sys/amd64/amd64/mem.c:192: undefined
reference to `M_MEMDESC'
mem.o(.text+0x35a):/usr/src/sys/amd64/amd64/mem.c:200: undefined
reference to `M_MEMDESC'
mem.o(.text+0x38a):/usr/src/sys/amd64/amd64/mem.c:207: undefined
reference to `M_MEMDESC'
*** Error code 1

Stop in /usr/obj/usr/src/sys/CUSTOM.

-- 
Conrad J. Sabatier <conrads_at_cox.net> -- "In Unix veritas"
Received on Sun Aug 01 2004 - 23:16:56 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:04 UTC