Subject: port-sparc/10616: sparc/cpu.h includes non-installed kernel includes
To: None <gnats-bugs@gnats.netbsd.org>
From: John Hawkinson <jhawk@mit.edu>
List: netbsd-bugs
Date: 07/17/2000 18:01:45
>Number:         10616
>Category:       port-sparc
>Synopsis:       sparc/cpu.h includes non-installed kernel includes
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-sparc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 17 08:26:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     John Hawkinson
>Release:        1.4.2, and -current of 16 July 2000
>Organization:
MIT
>Environment:
	
System: NetBSD 1.5B NetBSD 1.5B sparc

>Description:
	/usr/include/sparc/cpu.h includes <sparc/sparc/cpuvar.h> and
<sparc/sparc/intreg.h> when _KERNEL is defined, as it must
be by LKMs that need kernel data structures.

	This was noticed under 1.4.2, so I'd like the fix pulled up
to netbsd-1-4 and netbsd-1-5 both.

>How-To-Repeat:
	Try to build arla on the sparc port without a kernel tree in
/sys.
>Fix:
	Is this as simple as moving sys/arch/sparc/sparc/{cpuvar.h,intreg.h}
into sys/arch/sparc/include? Or should their inclusion simply be
removed?

	I suppose it's not "as simple" as the former, as cpuvar.h
includes sparc/sparc/cache.h, and intreg.h includes sparc/sparc/vaddrs.h,
though there are no further levels of inclusion.

	Workaround is to populate /sys/arch/sparc/sparc/*.h and
build with "-I /sys/arch/".
>Release-Note:
>Audit-Trail:
>Unformatted: