uanme: extend the sysinfo block and add swap bits to it
authorAlan Cox <alan@linux.intel.com>
Thu, 28 Sep 2017 20:40:59 +0000 (21:40 +0100)
committerAlan Cox <alan@linux.intel.com>
Thu, 28 Sep 2017 20:40:59 +0000 (21:40 +0100)
Yes this breaks uname() calls so one or two things need recompiling but better
to do it now than later.

For the moment it adds the CPU identifier, more space for CPU info data,
space for some expansion and also gets ready to add the swap info so free
can show swap state.

Kernel/cpu-6502/cpu.h
Kernel/cpu-65c816/cpu.h
Kernel/cpu-68000/cpu.h
Kernel/cpu-6809/cpu.h
Kernel/cpu-68hc11/cpu.h
Kernel/cpu-8086/cpu.h
Kernel/cpu-msp430x/cpu.h
Kernel/cpu-pdp11/cpu.h
Kernel/cpu-z80/cpu.h
Kernel/tools/makeversion.c
Library/include/syscalls.h

index 974c634..009ad94 100644 (file)
@@ -60,3 +60,5 @@ typedef union {            /* this structure is endian dependent */
 #define inline
 
 #define ntohs(x)       ((((x) & 0xFF) << 8) | (((x) & 0xFF00) >> 8))
+
+#define CPUTYPE        CPUTYPE_6502
index 68e1720..de24ec4 100644 (file)
@@ -73,3 +73,5 @@ typedef union {            /* this structure is endian dependent */
 
 /* FIXME: should swap a/b inline ??? */
 #define ntohs(x)       ((((x) & 0xFF) << 8) | (((x) & 0xFF00) >> 8))
+
+#define CPUTYPE        CPUTYPE_65C816
index 644de6b..ef06b66 100644 (file)
@@ -75,3 +75,5 @@ register struct u_data *udata_ptr asm ("a5");
 #define BIG_ENDIAN
 
 #define CONFIG_STACKSIZE       1024
+
+#define CPUTYPE        CPUTYPE_68000
index 8e73a0f..7060588 100644 (file)
@@ -68,3 +68,5 @@ typedef union {            /* this structure is endian dependent */
 #define gcc_miscompile_workaround()    __asm("":::"memory")
 
 #define BIG_ENDIAN
+
+#define CPUTYPE        CPUTYPE_6809
index ec9fea3..47f022d 100644 (file)
@@ -66,3 +66,5 @@ typedef union {            /* this structure is endian dependent */
 #define used(x)
 
 #define BIG_ENDIAN
+
+#define CPUTYPE        CPUTYPE_68HC11
index b95da69..5e8fa98 100644 (file)
@@ -60,3 +60,5 @@ typedef union {            /* this structure is endian dependent */
 #define inline
 
 #define const
+
+#define CPUTYPE        CPU_8086
index 436433e..e6aae65 100644 (file)
@@ -117,3 +117,5 @@ typedef union {            /* this structure is endian dependent */
 #define EMAGIC_2 0x3c
 
 #define no_cache_udata()
+
+#define CPUTYPE        CPUTYPE_MSP340X
index c74d6a5..1d41704 100644 (file)
@@ -76,3 +76,5 @@ typedef union {            /* this structure is endian dependent */
 
 #define BIG_ENDIAN
 #define PDP_ENDIAN
+
+#define CPUTYPE        CPUTYPE_PDP11
index 37987d4..6279ea6 100644 (file)
@@ -82,3 +82,5 @@ typedef union {            /* this structure is endian dependent */
 #define ntohs(x)       ((((x) & 0xFF) << 8) | (((x) & 0xFF00) >> 8))
 #define ntohl(x)       ((((x) & 0xFF) << 24) | (((x) & 0xFF00) << 8) | \
                          (((x) & 0xFF0000) >> 8) | (((x >> 24) & 0xFF)))
+
+#define CPUTYPE        CPUTYPE_Z80
index 81af7d7..d7011d0 100644 (file)
@@ -23,10 +23,12 @@ struct sysinfoblk sysinfo = {\n\
 #ifdef CONFIG_LEVEL_2\n\
        CONF_LEVEL_2 |\n\
 #endif\n\
-       0,\n\
        {0, 0, 0},\n\
        0,\n\
        0,\n\
+       CPUTYPE,\n\
+       {0, 0, 0},\n\
+       {0, 0, 0, 0, 0, 0, 0, 0},\n\
        /* Quoting to work around cc65 bug */\n\
        \"%s\\0\"\"Fuzix\\0\"\"%s\\0\"\"%s\"\n\
 };\n\n",
@@ -54,6 +56,9 @@ struct sysinfoblk {\n\
   uint16_t loadavg[3];\n\
   uint16_t swapk;\n\
   uint16_t swapusedk;\n\
+  uint8_t cputype;             /* CPU type information */\n\
+  uint8_t cpu[3];              /* CPU type specific data */\n\
+  uint16_t spare[8];\n\
   char uname[%d];\n\
 };\n\
 \n", (int)(strlen(v) + strlen(sv) + strlen(p) + 9));
index 7d99faf..f41564e 100644 (file)
@@ -25,6 +25,11 @@ struct _uzisysinfoblk {
   uint16_t config;             /* Config flag mask */
   uint16_t loadavg[3];
   uint32_t spare;
+  uint16_t swapk;
+  uint16_t swapusedk;
+  uint8_t cputype;             /* CPU type information */
+  uint8_t cpu[3];              /* CPU type specific data */
+  uint16_t spare[8];
 };
 
 /*