[haiku-commits] haiku: hrev46712 - headers/private/kernel/arch/ppc headers/private/kernel/arch/alpha headers/private/kernel/arch/arm src/tests/system/boot/loader headers/private/kernel/boot/platform/u-boot

  • From: kallisti5@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 19 Jan 2014 21:33:53 +0100 (CET)

hrev46712 adds 3 changesets to branch 'master'
old head: 9d80738d95a602d0291169f918b962a648573843
new head: fb8026e82b5d8b50e4702fa2bf0f5c833ff0d51b
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=fb8026e+%5E9d80738

----------------------------------------------------------------------------

6647d2c: kernel: fix missing SMP_MAX_CPUS on non-x86
  
  * Regression introduced due to scheduler change
  * Drop MAX_BOOT_CPUS as it is no longer used

524bea3: kernel: fix missing cpu cache defines non-x86
  
  * Regression introduced due to scheduler change
  * Other other non-x86, non-ppc, and non-arm platforms
    need evalulated for this metric

fb8026e: kernel: Add missing PPC CPU functions for idle / pause

                          [ Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> ]

----------------------------------------------------------------------------

12 files changed, 74 insertions(+), 28 deletions(-)
headers/private/kernel/arch/alpha/stage2.h       |  8 ++--
headers/private/kernel/arch/arm/arch_cpu.h       |  7 +++
headers/private/kernel/arch/ppc/arch_cpu.h       | 45 ++++++++++++++++----
.../platform/amiga_m68k/platform_kernel_args.h   |  5 ++-
.../platform/atari_m68k/platform_kernel_args.h   |  5 ++-
.../boot/platform/cfe/platform_kernel_args.h     |  5 ++-
.../platform/openfirmware/platform_kernel_args.h |  5 ++-
.../raspberrypi_arm/platform_kernel_args.h       |  5 ++-
.../routerboard_mipsel/platform_kernel_args.h    |  5 ++-
.../boot/platform/u-boot/platform_kernel_args.h  |  5 ++-
headers/private/kernel/cpu.h                     |  1 -
.../system/boot/loader/platform_kernel_args.h    |  6 ++-

############################################################################

Commit:      6647d2c95ace3dacd7641d727873bce0e5d9ec81
URL:         http://cgit.haiku-os.org/haiku/commit/?id=6647d2c
Author:      Alexander von Gluck IV <kallisti5@xxxxxxxxxxx>
Date:        Sun Jan 19 20:09:51 2014 UTC

kernel: fix missing SMP_MAX_CPUS on non-x86

* Regression introduced due to scheduler change
* Drop MAX_BOOT_CPUS as it is no longer used

----------------------------------------------------------------------------

diff --git a/headers/private/kernel/arch/alpha/stage2.h 
b/headers/private/kernel/arch/alpha/stage2.h
index bfaf9dd..2cc8e16 100644
--- a/headers/private/kernel/arch/alpha/stage2.h
+++ b/headers/private/kernel/arch/alpha/stage2.h
@@ -5,15 +5,17 @@
 #ifndef _STAGE2_H
 #define _STAGE2_H
 
+
 #include <boot.h>
 
-// must match SMP_MAX_CPUS in arch_smp.h
-#define MAX_BOOT_CPUS 1
+
+#define SMP_MAX_CPUS 1
 
 #define MAX_PHYS_MEM_ADDR_RANGE 4
 #define MAX_VIRT_ALLOC_ADDR_RANGE 4
 #define MAX_PHYS_ALLOC_ADDR_RANGE 4
 
+
 typedef struct {
        unsigned int start;
        unsigned int size;
@@ -33,7 +35,7 @@ typedef struct {
        unsigned int num_virt_alloc_ranges;
        addr_range virt_alloc_range[MAX_VIRT_ALLOC_ADDR_RANGE];
        unsigned int num_cpus;
-       addr_range cpu_kstack[MAX_BOOT_CPUS];
+       addr_range cpu_kstack[SMP_MAX_CPUS];
        // architecture specific
 } kernel_args;
 
diff --git 
a/headers/private/kernel/boot/platform/amiga_m68k/platform_kernel_args.h 
b/headers/private/kernel/boot/platform/amiga_m68k/platform_kernel_args.h
index 812db4e..6490cbc 100644
--- a/headers/private/kernel/boot/platform/amiga_m68k/platform_kernel_args.h
+++ b/headers/private/kernel/boot/platform/amiga_m68k/platform_kernel_args.h
@@ -5,12 +5,13 @@
 #ifndef KERNEL_BOOT_PLATFORM_AMIGA_KERNEL_ARGS_H
 #define KERNEL_BOOT_PLATFORM_AMIGA_KERNEL_ARGS_H
 
+
 #ifndef KERNEL_BOOT_KERNEL_ARGS_H
 #      error This file is included from <boot/kernel_args.h> only
 #endif
 
-// must match SMP_MAX_CPUS in arch_smp.h
-#define MAX_BOOT_CPUS 1
+#define SMP_MAX_CPUS 1
+
 #define MAX_PHYSICAL_MEMORY_RANGE 4
 #define MAX_PHYSICAL_ALLOCATED_RANGE 8
 #define MAX_VIRTUAL_ALLOCATED_RANGE 32
diff --git 
a/headers/private/kernel/boot/platform/atari_m68k/platform_kernel_args.h 
b/headers/private/kernel/boot/platform/atari_m68k/platform_kernel_args.h
index 2e2d38c..73f8313 100644
--- a/headers/private/kernel/boot/platform/atari_m68k/platform_kernel_args.h
+++ b/headers/private/kernel/boot/platform/atari_m68k/platform_kernel_args.h
@@ -5,12 +5,13 @@
 #ifndef KERNEL_BOOT_PLATFORM_ATARI_KERNEL_ARGS_H
 #define KERNEL_BOOT_PLATFORM_ATARI_KERNEL_ARGS_H
 
+
 #ifndef KERNEL_BOOT_KERNEL_ARGS_H
 #      error This file is included from <boot/kernel_args.h> only
 #endif
 
-// must match SMP_MAX_CPUS in arch_smp.h
-#define MAX_BOOT_CPUS 1
+#define SMP_MAX_CPUS 1
+
 #define MAX_PHYSICAL_MEMORY_RANGE 4
 #define MAX_PHYSICAL_ALLOCATED_RANGE 8
 #define MAX_VIRTUAL_ALLOCATED_RANGE 32
diff --git a/headers/private/kernel/boot/platform/cfe/platform_kernel_args.h 
b/headers/private/kernel/boot/platform/cfe/platform_kernel_args.h
index 8cf75e8..774ee8a 100644
--- a/headers/private/kernel/boot/platform/cfe/platform_kernel_args.h
+++ b/headers/private/kernel/boot/platform/cfe/platform_kernel_args.h
@@ -5,12 +5,13 @@
 #ifndef KERNEL_BOOT_PLATFORM_CFE_KERNEL_ARGS_H
 #define KERNEL_BOOT_PLATFORM_CFE_KERNEL_ARGS_H
 
+
 #ifndef KERNEL_BOOT_KERNEL_ARGS_H
 #      error This file is included from <boot/kernel_args.h> only
 #endif
 
-// must match SMP_MAX_CPUS in arch_smp.h
-#define MAX_BOOT_CPUS 4
+#define SMP_MAX_CPUS 4
+
 #define MAX_PHYSICAL_MEMORY_RANGE 4
 #define MAX_PHYSICAL_ALLOCATED_RANGE 8
 #define MAX_VIRTUAL_ALLOCATED_RANGE 32
diff --git 
a/headers/private/kernel/boot/platform/openfirmware/platform_kernel_args.h 
b/headers/private/kernel/boot/platform/openfirmware/platform_kernel_args.h
index 150afe2..86da607 100644
--- a/headers/private/kernel/boot/platform/openfirmware/platform_kernel_args.h
+++ b/headers/private/kernel/boot/platform/openfirmware/platform_kernel_args.h
@@ -5,12 +5,13 @@
 #ifndef KERNEL_BOOT_PLATFORM_OPENFIRMWARE_KERNEL_ARGS_H
 #define KERNEL_BOOT_PLATFORM_OPENFIRMWARE_KERNEL_ARGS_H
 
+
 #ifndef KERNEL_BOOT_KERNEL_ARGS_H
 #      error This file is included from <boot/kernel_args.h> only
 #endif
 
-// must match SMP_MAX_CPUS in arch_smp.h
-#define MAX_BOOT_CPUS 4
+#define SMP_MAX_CPUS 16
+
 #define MAX_PHYSICAL_MEMORY_RANGE 4
 #define MAX_PHYSICAL_ALLOCATED_RANGE 8
 #define MAX_VIRTUAL_ALLOCATED_RANGE 32
diff --git 
a/headers/private/kernel/boot/platform/raspberrypi_arm/platform_kernel_args.h 
b/headers/private/kernel/boot/platform/raspberrypi_arm/platform_kernel_args.h
index ff7a8e2..3248974 100644
--- 
a/headers/private/kernel/boot/platform/raspberrypi_arm/platform_kernel_args.h
+++ 
b/headers/private/kernel/boot/platform/raspberrypi_arm/platform_kernel_args.h
@@ -5,12 +5,13 @@
 #ifndef KERNEL_BOOT_PLATFORM_PI_KERNEL_ARGS_H
 #define KERNEL_BOOT_PLATFORM_PI_KERNEL_ARGS_H
 
+
 #ifndef KERNEL_BOOT_KERNEL_ARGS_H
 #      error This file is included from <boot/kernel_args.h> only
 #endif
 
-// must match SMP_MAX_CPUS in arch_smp.h
-#define MAX_BOOT_CPUS 1
+#define SMP_MAX_CPUS 1
+
 #define MAX_PHYSICAL_MEMORY_RANGE 4
 #define MAX_PHYSICAL_ALLOCATED_RANGE 8
 #define MAX_VIRTUAL_ALLOCATED_RANGE 32
diff --git 
a/headers/private/kernel/boot/platform/routerboard_mipsel/platform_kernel_args.h
 
b/headers/private/kernel/boot/platform/routerboard_mipsel/platform_kernel_args.h
index d45e5d4..725e9ec 100644
--- 
a/headers/private/kernel/boot/platform/routerboard_mipsel/platform_kernel_args.h
+++ 
b/headers/private/kernel/boot/platform/routerboard_mipsel/platform_kernel_args.h
@@ -5,14 +5,15 @@
 #ifndef _KERNEL_BOOT_PLATFORM_ROUTERBOARD_MIPSEL_KERNEL_ARGS_H
 #define _KERNEL_BOOT_PLATFORM_ROUTERBOARD_MIPSEL_KERNEL_ARGS_H
 
+
 #ifndef KERNEL_BOOT_KERNEL_ARGS_H
 #      error This file is included from <boot/kernel_args.h> only
 #endif
 
 #warning IMPLEMENT platform_kernel_args.h
 
-// must match SMP_MAX_CPUS in arch_smp.h
-#define MAX_BOOT_CPUS 1
+#define SMP_MAX_CPUS 1
+
 #define MAX_PHYSICAL_MEMORY_RANGE 4
 #define MAX_PHYSICAL_ALLOCATED_RANGE 8
 #define MAX_VIRTUAL_ALLOCATED_RANGE 32
diff --git a/headers/private/kernel/boot/platform/u-boot/platform_kernel_args.h 
b/headers/private/kernel/boot/platform/u-boot/platform_kernel_args.h
index 8a78bc6..ac1c9b8 100644
--- a/headers/private/kernel/boot/platform/u-boot/platform_kernel_args.h
+++ b/headers/private/kernel/boot/platform/u-boot/platform_kernel_args.h
@@ -5,12 +5,13 @@
 #ifndef KERNEL_BOOT_PLATFORM_UBOOT_KERNEL_ARGS_H
 #define KERNEL_BOOT_PLATFORM_UBOOT_KERNEL_ARGS_H
 
+
 #ifndef KERNEL_BOOT_KERNEL_ARGS_H
 #      error This file is included from <boot/kernel_args.h> only
 #endif
 
-// must match SMP_MAX_CPUS in arch_smp.h
-#define MAX_BOOT_CPUS 1
+#define SMP_MAX_CPUS 1
+
 #define MAX_PHYSICAL_MEMORY_RANGE 4
 #define MAX_PHYSICAL_ALLOCATED_RANGE 8
 #define MAX_VIRTUAL_ALLOCATED_RANGE 32
diff --git a/headers/private/kernel/cpu.h b/headers/private/kernel/cpu.h
index dad23c6..5c0f09c 100644
--- a/headers/private/kernel/cpu.h
+++ b/headers/private/kernel/cpu.h
@@ -88,7 +88,6 @@ typedef struct cpu_ent {
 } cpu_ent CACHE_LINE_ALIGN;
 
 
-//extern cpu_ent gCPU[MAX_BOOT_CPUS];
 extern cpu_ent gCPU[];
 extern uint32 gCPUCacheLevelCount;
 
diff --git a/src/tests/system/boot/loader/platform_kernel_args.h 
b/src/tests/system/boot/loader/platform_kernel_args.h
index 6e2e141..f670a36 100644
--- a/src/tests/system/boot/loader/platform_kernel_args.h
+++ b/src/tests/system/boot/loader/platform_kernel_args.h
@@ -5,12 +5,14 @@
 #ifndef PLATFORM_KERNEL_ARGS_H
 #define PLATFORM_KERNEL_ARGS_H
 
-// must match SMP_MAX_CPUS in arch_smp.h
-#define MAX_BOOT_CPUS 4
+
+#define SMP_MAX_CPUS 4
+
 #define MAX_PHYSICAL_MEMORY_RANGE 4
 #define MAX_PHYSICAL_ALLOCATED_RANGE 4
 #define MAX_VIRTUAL_ALLOCATED_RANGE 4
 
+
 struct platform_kernel_args {
        /* they are just empty! */
 };

############################################################################

Commit:      524bea3553f914523ef7bbf4bbb66ef85a3336fc
URL:         http://cgit.haiku-os.org/haiku/commit/?id=524bea3
Author:      Alexander von Gluck IV <kallisti5@xxxxxxxxxxx>
Date:        Sun Jan 19 20:27:09 2014 UTC

kernel: fix missing cpu cache defines non-x86

* Regression introduced due to scheduler change
* Other other non-x86, non-ppc, and non-arm platforms
  need evalulated for this metric

----------------------------------------------------------------------------

diff --git a/headers/private/kernel/arch/arm/arch_cpu.h 
b/headers/private/kernel/arch/arm/arch_cpu.h
index fea6c68..aa7bfd9 100644
--- a/headers/private/kernel/arch/arm/arch_cpu.h
+++ b/headers/private/kernel/arch/arm/arch_cpu.h
@@ -5,11 +5,18 @@
 #ifndef _KERNEL_ARCH_ARM_CPU_H
 #define _KERNEL_ARCH_ARM_CPU_H
 
+
+#define CPU_MAX_CACHE_LEVEL 8
+#define CACHE_LINE_SIZE 64
+       // TODO: Could be 32-bits sometimes?
+
+
 #ifndef _ASSEMBLER
 
 #include <arch/arm/arch_thread_types.h>
 #include <kernel.h>
 
+
 /* raw exception frames */
 struct iframe {
        uint32 spsr;
diff --git a/headers/private/kernel/arch/ppc/arch_cpu.h 
b/headers/private/kernel/arch/ppc/arch_cpu.h
index b48adf1..7195a71 100644
--- a/headers/private/kernel/arch/ppc/arch_cpu.h
+++ b/headers/private/kernel/arch/ppc/arch_cpu.h
@@ -10,6 +10,11 @@
 #include <kernel.h>
 
 
+#define CPU_MAX_CACHE_LEVEL    8
+#define CACHE_LINE_SIZE                128
+       // 128 Byte lines on PPC970
+
+
 struct iframe {
        uint32 vector;
        uint32 srr0;

############################################################################

Revision:    hrev46712
Commit:      fb8026e82b5d8b50e4702fa2bf0f5c833ff0d51b
URL:         http://cgit.haiku-os.org/haiku/commit/?id=fb8026e
Author:      Alexander von Gluck IV <kallisti5@xxxxxxxxxxx>
Date:        Sun Jan 19 20:38:01 2014 UTC

kernel: Add missing PPC CPU functions for idle / pause

----------------------------------------------------------------------------

diff --git a/headers/private/kernel/arch/ppc/arch_cpu.h 
b/headers/private/kernel/arch/ppc/arch_cpu.h
index 7195a71..1f3257f 100644
--- a/headers/private/kernel/arch/ppc/arch_cpu.h
+++ b/headers/private/kernel/arch/ppc/arch_cpu.h
@@ -109,6 +109,22 @@ typedef struct arch_cpu_info {
 } arch_cpu_info;
 
 
+#define eieio()        asm volatile("eieio")
+#define isync() asm volatile("isync")
+#define tlbsync() asm volatile("tlbsync")
+#define ppc_sync() asm volatile("sync")
+#define tlbia() asm volatile("tlbia")
+#define tlbie(addr) asm volatile("tlbie %0" :: "r" (addr))
+
+// adjust thread priority on PowerPC (Shared resource hints)
+#define SRH_very_low() asm volatile("or 31,31,31")
+#define SRH_low() asm volatile("or 1,1,1")
+#define SRH_medium_low() asm volatile("or 6,6,6")
+#define SRH_medium() asm volatile("or 2,2,2")
+#define SRH_medium_high() asm volatile("or 5,5,5")
+#define SRH_high() asm volatile("or 3,3,3")
+
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -157,17 +173,25 @@ extern void ppc_context_switch(void **_oldStackPointer, 
void *newStackPointer);
 extern bool ppc_set_fault_handler(addr_t *handlerLocation, addr_t handler)
        __attribute__((noinline));
 
-#ifdef __cplusplus
+
+static inline void
+arch_cpu_pause(void)
+{
+       // TODO: PowerPC review logic of setting very low for pause
+       SRH_very_low();
 }
-#endif
 
-#define eieio()        asm volatile("eieio")
-#define isync() asm volatile("isync")
-#define tlbsync() asm volatile("tlbsync")
-#define ppc_sync() asm volatile("sync")
-#define tlbia() asm volatile("tlbia")
-#define tlbie(addr) asm volatile("tlbie %0" :: "r" (addr))
 
+static inline void
+arch_cpu_idle(void)
+{
+       // TODO: PowerPC CPU idle call
+}
+
+
+#ifdef __cplusplus
+}
+#endif
 
 // PowerPC processor version (the upper 16 bits of the PVR).
 enum ppc_processor_version {


Other related posts:

  • » [haiku-commits] haiku: hrev46712 - headers/private/kernel/arch/ppc headers/private/kernel/arch/alpha headers/private/kernel/arch/arm src/tests/system/boot/loader headers/private/kernel/boot/platform/u-boot - kallisti5