[haiku-commits] haiku: hrev53015 - src/system/boot/loader src/kits/debug/arch/sparc src/system/boot/platform/openfirmware headers/private/kernel/arch/sparc headers/private/system/arch/sparc

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 30 Mar 2019 11:23:18 -0400 (EDT)

hrev53015 adds 5 changesets to branch 'master'
old head: 633fbcf42380fc2134895fa2dd6d731ff0926ff7
new head: 8ff82ee2d475da38fde655341aa98f9cf7f9d474
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=8ff82ee2d475+%5E633fbcf42380

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

f23db0edb5fb: sparc: add to known architectures in configure script
  
  Change-Id: Ic6cfdd2a94c8d6c0a7f4963fe892f8dc73e97afd
  Reviewed-on: https://review.haiku-os.org/c/1323
  Reviewed-by: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>

ddf7e72f86a6: loader: Do not assume ELF32 for any non-EFI target.
  
  sparc is 64bit even at the bootloader stage.
  
  Change-Id: Idbf39497503aac08e72c691cf655e97f95347784
  Reviewed-on: https://review.haiku-os.org/c/1324
  Reviewed-by: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>

5ef707395a16: sparc: fix some 64bit intolerant code
  
  Change-Id: I90bea483d7cf18696a6d5d2f18e8cada409884a2
  Reviewed-on: https://review.haiku-os.org/c/1325
  Reviewed-by: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>

3bfbec83363e: sparc: More missing defines in platform headers
  
  * Kernel is 64 bit, and we won't need a 32bit load base.
  
  Change-Id: I729bab01c8f71083002db061e153b0e5052b9a1c
  Reviewed-on: https://review.haiku-os.org/c/1326
  Reviewed-by: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>

8ff82ee2d475: sparc: fix debug support
  
  Declare and use the correct registers to define a stack frame.
  
  Change-Id: Ice3ba8f8715313a715f6b1cb553a6883541f5cc4
  Reviewed-on: https://review.haiku-os.org/c/1327
  Reviewed-by: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>

                                   [ PulkoMandy <pulkomandy@xxxxxxxxxxxxx> ]

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

8 files changed, 39 insertions(+), 11 deletions(-)
configure                                        |  1 +
headers/os/arch/sparc/arch_debugger.h            |  3 +-
headers/private/kernel/arch/sparc/arch_kernel.h  |  4 ++-
headers/private/system/arch/sparc/arch_config.h  |  1 +
src/kits/debug/arch/sparc/arch_debug_support.cpp |  6 ++--
src/system/boot/loader/Jamfile                   | 31 +++++++++++++++++---
.../boot/platform/openfirmware/devices.cpp       |  2 +-
src/system/boot/platform/openfirmware/start.cpp  |  2 +-

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

Commit:      f23db0edb5fb974caeee8ff59597bf2d5d2ab927
URL:         https://git.haiku-os.org/haiku/commit/?id=f23db0edb5fb
Author:      PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date:        Mon Mar 25 18:43:08 2019 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Sat Mar 30 15:23:15 2019 UTC

sparc: add to known architectures in configure script

Change-Id: Ic6cfdd2a94c8d6c0a7f4963fe892f8dc73e97afd
Reviewed-on: https://review.haiku-os.org/c/1323
Reviewed-by: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>

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

diff --git a/configure b/configure
index e022f2ad16..13ac710317 100755
--- a/configure
+++ b/configure
@@ -633,6 +633,7 @@ supportedTargetArchs="
        ppc
        riscv32
        riscv64
+       sparc
        x86
        x86_64
        x86_gcc2

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

Commit:      ddf7e72f86a6fc8b64c3e4e7fbca3fd2dc7fcf7a
URL:         https://git.haiku-os.org/haiku/commit/?id=ddf7e72f86a6
Author:      PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date:        Mon Mar 25 18:43:39 2019 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Sat Mar 30 15:23:15 2019 UTC

loader: Do not assume ELF32 for any non-EFI target.

sparc is 64bit even at the bootloader stage.

Change-Id: Idbf39497503aac08e72c691cf655e97f95347784
Reviewed-on: https://review.haiku-os.org/c/1324
Reviewed-by: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>

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

diff --git a/src/system/boot/loader/Jamfile b/src/system/boot/loader/Jamfile
index 0f4917369a..eab74569a0 100644
--- a/src/system/boot/loader/Jamfile
+++ b/src/system/boot/loader/Jamfile
@@ -52,16 +52,39 @@ for platform in [ MultiBootSubDirSetup ] {
 
                                                #BOOT_SUPPORT_FILE_SYSTEM_FAT
                                        ;
+                                       if $(TARGET_BOOT_PLATFORM) = efi {
+                                               DEFINES +=
+                                                       _BOOT_PLATFORM_EFI
+                                               ;
+                                       } else {
+                                               DEFINES += BOOT_SUPPORT_ELF32 ;
+                                       }
+                               }
+                               case "sparc" :
+                               {
+                                       DEFINES +=
+                                               BOOT_SUPPORT_ELF64
+                                       ;
+                               }
+                               case "risc-v" :
+                               {
+                                       DEFINES +=
+                                               BOOT_SUPPORT_ELF64
+                                       ;
+                               }
+                               case "m68k" :
+                               {
+                                       DEFINES += BOOT_SUPPORT_ELF32 ;
+                               }
+                               case "arm" :
+                               {
+                                       DEFINES += BOOT_SUPPORT_ELF32 ;
                                        if $(TARGET_BOOT_PLATFORM) = efi {
                                                DEFINES +=
                                                        _BOOT_PLATFORM_EFI
                                                ;
                                        }
                                }
-                       }
-
-                       if $(TARGET_BOOT_PLATFORM) != efi {
-                               DEFINES += BOOT_SUPPORT_ELF32 ;
                        }
 
                        local kernelC++Header = [ FDirName $(HAIKU_TOP) headers 
private kernel util

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

Commit:      5ef707395a16863dfdf5e50636aad0c40ace1de7
URL:         https://git.haiku-os.org/haiku/commit/?id=5ef707395a16
Author:      PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date:        Mon Mar 25 18:44:29 2019 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Sat Mar 30 15:23:15 2019 UTC

sparc: fix some 64bit intolerant code

Change-Id: I90bea483d7cf18696a6d5d2f18e8cada409884a2
Reviewed-on: https://review.haiku-os.org/c/1325
Reviewed-by: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>

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

diff --git a/src/system/boot/platform/openfirmware/devices.cpp 
b/src/system/boot/platform/openfirmware/devices.cpp
index acc57cb1b1..e21f9c759e 100644
--- a/src/system/boot/platform/openfirmware/devices.cpp
+++ b/src/system/boot/platform/openfirmware/devices.cpp
@@ -205,7 +205,7 @@ platform_add_block_devices(stage2_args *args, NodeList 
*devicesList)
 
                printf("\t%s\n", path);
 
-               int handle = of_open(path);
+               intptr_t handle = of_open(path);
                if (handle == OF_FAILED) {
                        puts("\t\t(failed)");
                        continue;
diff --git a/src/system/boot/platform/openfirmware/start.cpp 
b/src/system/boot/platform/openfirmware/start.cpp
index 2938db2373..c699823ecd 100644
--- a/src/system/boot/platform/openfirmware/start.cpp
+++ b/src/system/boot/platform/openfirmware/start.cpp
@@ -116,7 +116,7 @@ platform_start_kernel(void)
 
        status_t error = arch_start_kernel(&gKernelArgs, kernelEntry, stackTop);
 
-       panic("Kernel returned! Return value: %ld\n", error);
+       panic("Kernel returned! Return value: %" B_PRId32 "\n", error);
 }
 
 

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

Commit:      3bfbec83363ee955a2dc73b45ec71878c9fa8015
URL:         https://git.haiku-os.org/haiku/commit/?id=3bfbec83363e
Author:      PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date:        Thu Mar 28 07:04:29 2019 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Sat Mar 30 15:23:15 2019 UTC

sparc: More missing defines in platform headers

* Kernel is 64 bit, and we won't need a 32bit load base.

Change-Id: I729bab01c8f71083002db061e153b0e5052b9a1c
Reviewed-on: https://review.haiku-os.org/c/1326
Reviewed-by: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>

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

diff --git a/headers/private/kernel/arch/sparc/arch_kernel.h 
b/headers/private/kernel/arch/sparc/arch_kernel.h
index 44fa61d97b..5666fff6b5 100644
--- a/headers/private/kernel/arch/sparc/arch_kernel.h
+++ b/headers/private/kernel/arch/sparc/arch_kernel.h
@@ -8,6 +8,9 @@
 
 #include <arch/cpu.h>
 
+// memory layout
+#define KERNEL_LOAD_BASE_64_BIT 0xffffffff80000000ll
+
 // Base of the kernel address space.
 // KERNEL_BASE is the base of the kernel address space. This differs from the
 // address where the kernel is loaded to: the kernel is loaded in the top 2GB
@@ -16,7 +19,6 @@
 #define KERNEL_BASE                            0xffffff0000000000
 #define KERNEL_SIZE                            0x10000000000
 #define KERNEL_TOP                     (KERNEL_BASE + (KERNEL_SIZE - 1))
-#define KERNEL_LOAD_BASE               0xffffffff80000000
 
 
 // Userspace address space layout.
diff --git a/headers/private/system/arch/sparc/arch_config.h 
b/headers/private/system/arch/sparc/arch_config.h
index 3cdb67ea26..7e07a3e8ab 100644
--- a/headers/private/system/arch/sparc/arch_config.h
+++ b/headers/private/system/arch/sparc/arch_config.h
@@ -5,6 +5,7 @@
 #ifndef _KERNEL_ARCH_SPARC_CONFIG_H
 #define _KERNEL_ARCH_SPARC_CONFIG_H
 
+#define FUNCTION_CALL_PARAMETER_ALIGNMENT_TYPE  unsigned long
 
 #define STACK_GROWS_DOWNWARDS
 

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

Revision:    hrev53015
Commit:      8ff82ee2d475da38fde655341aa98f9cf7f9d474
URL:         https://git.haiku-os.org/haiku/commit/?id=8ff82ee2d475
Author:      PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date:        Thu Mar 28 07:04:58 2019 UTC
Committer:   waddlesplash <waddlesplash@xxxxxxxxx>
Commit-Date: Sat Mar 30 15:23:15 2019 UTC

sparc: fix debug support

Declare and use the correct registers to define a stack frame.

Change-Id: Ice3ba8f8715313a715f6b1cb553a6883541f5cc4
Reviewed-on: https://review.haiku-os.org/c/1327
Reviewed-by: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>

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

diff --git a/headers/os/arch/sparc/arch_debugger.h 
b/headers/os/arch/sparc/arch_debugger.h
index eaa14c0df9..2965882dba 100644
--- a/headers/os/arch/sparc/arch_debugger.h
+++ b/headers/os/arch/sparc/arch_debugger.h
@@ -7,7 +7,8 @@
 
 
 struct sparc_debug_cpu_state {
-       uint32  dummy;
+       uint64  pc;
+       uint64 i6; // frame pointer
 } __attribute__((aligned(8)));
 
 
diff --git a/src/kits/debug/arch/sparc/arch_debug_support.cpp 
b/src/kits/debug/arch/sparc/arch_debug_support.cpp
index 83f6b35cdf..553e72da27 100644
--- a/src/kits/debug/arch/sparc/arch_debug_support.cpp
+++ b/src/kits/debug/arch/sparc/arch_debug_support.cpp
@@ -18,7 +18,7 @@ struct stack_frame {
 
 status_t
 arch_debug_get_instruction_pointer(debug_context *context, thread_id thread,
-       void **ip, void **stackFrameAddress)
+       void **pc, void **stackFrameAddress)
 {
        // get the CPU state
        debug_cpu_state cpuState;
@@ -26,8 +26,8 @@ arch_debug_get_instruction_pointer(debug_context *context, 
thread_id thread,
        if (error != B_OK)
                return error;
 
-       *ip = (void*)cpuState.rip;
-       *stackFrameAddress = (void*)cpuState.rbp;
+       *pc = (void*)cpuState.pc;
+       *stackFrameAddress = (void*)cpuState.i6;
 
        return B_OK;
 }


Other related posts:

  • » [haiku-commits] haiku: hrev53015 - src/system/boot/loader src/kits/debug/arch/sparc src/system/boot/platform/openfirmware headers/private/kernel/arch/sparc headers/private/system/arch/sparc - waddlesplash