tech-kern archive

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

Re: _KMEMUSER and __HAVE_CPU_DATA_FIRST



matt wrote:

>> A few days ago I learned from Christos that the MI part of cpu_info, i.e.
>> ci_data, should be exposed when _KMEMUSER is defined, to make vmstat
>> compile again.
>
> PowerPC is nasty since it needs three different cpu_infos.  I think I'm
> going to move each variants stuff into its own structure and then add them
> via a union.  Not pretty but a bit better than what's there now.

Sounds good. Feel free to undo my temporary solution then. For the moment
I'm just exposing "struct cpu_data ci_info" to avoid problems.


> <sys/cpu.h> has never exposed things to userland before.  Now that kmem 
> grovelers need to do it, we are finding issues.

Yes, I also found lots of issues in the m68k ports, where machine/cpu.h is
usually more complex than a single #include <m68k/cpu.h>. I just
successfully compiled a port-amiga release with the following
modifications:

m68k/include/cpu.h:
--- cpu.h       22 Dec 2010 02:42:28 -0000      1.12
+++ cpu.h       24 Dec 2010 14:52:09 -0000
@@ -197,9 +197,10 @@
 #define        CACHE60_ON      (CACHE40_ON|IC60_CABC|IC60_EBC|DC60_ESB)
 #define        CACHE60_OFF     (CACHE40_OFF|IC60_CABC)
 
-#include <sys/cpu_data.h>
 
 #if defined(_KERNEL) || defined(_KMEMUSER)
+#include <sys/cpu_data.h>
+
 struct cpu_info {
        struct cpu_data ci_data;        /* MI per-cpu data */
        cpuid_t ci_cpuid;


amiga/include/cpu.h:
--- cpu.h       22 Dec 2010 02:42:27 -0000      1.76
+++ cpu.h       24 Dec 2010 14:50:54 -0000
@@ -78,12 +78,6 @@
 #ifndef _MACHINE_CPU_H_
 #define _MACHINE_CPU_H_
 
-#if defined(_KERNEL)
-
-/*
- * Exported definitions unique to amiga/68k cpu support.
- */
-
 #if defined(_KERNEL_OPT)
 #include "opt_lockdebug.h"
 #endif
@@ -92,6 +86,11 @@
  * Get common m68k CPU definitions.
  */
 #include <m68k/cpu.h>
+
+#if defined(_KERNEL)
+/*
+ * Exported definitions unique to amiga/68k cpu support.
+ */
 #define        M68K_MMU_MOTOROLA
 
 extern volatile unsigned int interrupt_depth;


Should I commit that and fix other m68k-ports accordingly, or should I wait
for a better solution?

-- 
Frank Wille



Home | Main Index | Thread Index | Old Index