On Sun, 3 Dec 2017, Warner Losh wrote:

Log:
 Include machine/md_var to pick up __syncicache prototype.

This is nonsense.  machine/md_var.h is kernel-only, but on powerpc
it declares __syncicache() which also exists in userland.  This include
is like including the kernel-only header sys/systm.h to declare printf()
in userland.

It is also an error to include machine/md_var.h in MI files in the
kernel.  Approx. 72 of the 305 includes of it in -current have this
bug.  The worst one is probably the one in altq_subr.c.  altq_subr.c
abuses the MD variable cpu_feature to test for CPUID_TSC.  That is just
the start of it layering violations and other bugs.

Modified: head/stand/ofw/libofw/elf_freebsd.c
==============================================================================
--- head/stand/ofw/libofw/elf_freebsd.c Sun Dec  3 04:54:49 2017        
(r326485)
+++ head/stand/ofw/libofw/elf_freebsd.c Sun Dec  3 04:54:54 2017        
(r326486)
@@ -32,6 +32,9 @@ __FBSDID("$FreeBSD$");

#include <machine/metadata.h>
#include <machine/elf.h>
+#if defined(__powerpc__)
+#include <machine/md_var.h>
+#endif

Style bug (verbose spelling of 'ifdef').

Bruce
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to