Port-powerpc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Heads up, changes to modules/exec/etc, note for portmasters/developers

[[ Moved to port-powerpc from current-users ]]

> NOTE TO PORTMASTERS: to make the compat stuff loadable as modules, COMPAT_
> ifdefs have to be purged from arch/${port}. Generally speaking, if the
> compat ifdef is in a file that is to be loaded as part of a compat module,
> say compat_16_machdep.c then it's ok. If it's elsewhere, like vm_machdep.c,
> then it needs to be neutralized - either removed or moved or replaced with a
> hook. I have done this for x86 and touched on the other ports but have not
> completely verified any ports other than the x86 ones. If you plan to
> support only !modular kernels there is no need to do anything.

I'm looking at possibly committing this to fix the build breakage for
powerpc ports:

Index: compat_13_machdep.c
RCS file: /u/nb/src/sys/arch/powerpc/powerpc/compat_13_machdep.c,v
retrieving revision 1.14
diff -u -p -r1.14 compat_13_machdep.c
--- compat_13_machdep.c 24 Apr 2008 18:39:21 -0000      1.14
+++ compat_13_machdep.c 21 Nov 2008 15:18:34 -0000
@@ -34,7 +34,9 @@
 #include <sys/cdefs.h>
 __KERNEL_RCSID(0, "$NetBSD: compat_13_machdep.c,v 1.14 2008/04/24 18:39:21 ad E
xp $");
+#ifdef _KERNEL_OPT
 #include "opt_ppcarch.h"
 #include <sys/param.h>
 #include <sys/systm.h>
Index: compat_16_machdep.c
RCS file: /u/nb/src/sys/arch/powerpc/powerpc/compat_16_machdep.c,v
retrieving revision 1.11
diff -u -p -r1.11 compat_16_machdep.c
--- compat_16_machdep.c 24 Apr 2008 18:39:21 -0000      1.11
+++ compat_16_machdep.c 21 Nov 2008 15:19:17 -0000
@@ -34,9 +34,11 @@
 #include <sys/cdefs.h>
 __KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.11 2008/04/24 18:39:21 ad E
xp $");
+#ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
 #include "opt_altivec.h"
 #include "opt_ppcarch.h"
 #include <sys/param.h>
 #include <sys/mount.h>

as an immediate fix for build breakage uncovered by modularizing the
compat code.

However, the options defined in these option files are used elsewhere
in the compat source code, e.g.

        utf->srr1 |= l->l_addr->u_pcb.pcb_flags & (PCB_FE0|PCB_FE1);
#ifdef ALTIVEC
        utf->srr1 |= l->l_addr->u_pcb.pcb_flags & PCB_ALTIVEC ? PSL_VEC : 0;
#ifdef PPC_OEA
        utf->vrsave = tf->tf_xtra[TF_VRSAVE];
        utf->mq = tf->tf_xtra[TF_MQ];

Would not this make it essentially impossible to build a compat_16
module which is processor-variant-neutral?  Or... one that will work
at all on any of these variants by default...?

While on the subject of build-breakage for the powerpc ports, the
evbppc port is also in that group because it attempts to build modules
which end up including machine/intr.h (because _KERNEL is defined),
which contains

#include PPC_INTR_IMPL

and that macro is not defined in a module build.  This is yeat another
instance of the "there are many different processor variants in this
family" issue for the powerpc ports.

Your specific comments whether the _KERNEL_OPT diffs are semi-OK, and
the more general comments regarding how the powerpc ports should be
handled in this respect would be appreciated.


- Håvard

Home | Main Index | Thread Index | Old Index