[haiku-commits] haiku: hrev53921 - in src/system/boot: arch/arm platform/u-boot platform/efi/arch/arm64 platform/efi/arch/arm platform/u-boot/arch/ppc

  • From: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 27 Feb 2020 11:04:29 -0500 (EST)

hrev53921 adds 1 changeset to branch 'master'
old head: fa60e7a684543a192f8e7475464880037c7298c4
new head: 48064fbc413adae0844b9199cc9e89a0086bb0bb
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=48064fbc413a+%5Efa60e7a68454

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

48064fbc413a: system/boot: Unify spin design, add missing symbols to asm/ld
  
  Change-Id: I1dd98a2243d498ec1c827f7a60385237d12a0d39
  Reviewed-on: https://review.haiku-os.org/c/haiku/+/2283
  Reviewed-by: Alex von Gluck IV <kallisti5@xxxxxxxxxxx>
  Reviewed-by: Adrien Destugues <pulkomandy@xxxxxxxxx>

                          [ Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> ]

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

Revision:    hrev53921
Commit:      48064fbc413adae0844b9199cc9e89a0086bb0bb
URL:         https://git.haiku-os.org/haiku/commit/?id=48064fbc413a
Author:      Alexander von Gluck IV <kallisti5@xxxxxxxxxxx>
Date:        Wed Feb 26 18:53:28 2020 UTC
Committer:   Alex von Gluck IV <kallisti5@xxxxxxxxxxx>
Commit-Date: Thu Feb 27 16:04:23 2020 UTC

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

9 files changed, 28 insertions(+), 23 deletions(-)
src/system/boot/arch/arm/arch_cpu.cpp            | 25 ++++++++++++++------
src/system/boot/arch/arm/arch_cpu.h              |  1 -
.../boot/platform/efi/arch/arm/crt0-efi-arm.S    |  3 ++-
.../platform/efi/arch/arm64/crt0-efi-arm64.S     |  4 +++-
.../boot/platform/u-boot/arch/ppc/arch_cpu.cpp   |  2 +-
src/system/boot/platform/u-boot/cpu.cpp          | 11 ---------
src/system/boot/platform/u-boot/cpu.h            |  1 -
src/system/ldscripts/arm/boot_loader_efi.ld      |  2 ++
src/system/ldscripts/riscv64/boot_loader_efi.ld  |  2 ++

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

diff --git a/src/system/boot/arch/arm/arch_cpu.cpp 
b/src/system/boot/arch/arm/arch_cpu.cpp
index 5bb64e59ab..fdd6d07297 100644
--- a/src/system/boot/arch/arm/arch_cpu.cpp
+++ b/src/system/boot/arch/arm/arch_cpu.cpp
@@ -123,13 +123,6 @@ arch_cpu_memory_write_barrier(void)
 }
 
 
-extern "C" void
-arch_spin(bigtime_t microseconds)
-{
-       panic("No timing support in bootloader yet!");
-}
-
-
 extern "C" status_t
 boot_arch_cpu_init(void)
 {
@@ -144,3 +137,21 @@ boot_arch_cpu_init(void)
 
        return B_OK;
 }
+
+
+extern "C" bigtime_t
+system_time()
+{
+       #warning Implement system_time in ARM bootloader!
+       return 0;
+}
+
+
+extern "C" void
+spin(bigtime_t microseconds)
+{
+       #warning Implment spin in ARM bootloader!
+       //bigtime_t time = system_time();
+       //while ((system_time() - time) < microseconds)
+       //      asm volatile ("nop;");
+}
diff --git a/src/system/boot/arch/arm/arch_cpu.h 
b/src/system/boot/arch/arm/arch_cpu.h
index beebacb359..f904cf2e01 100644
--- a/src/system/boot/arch/arm/arch_cpu.h
+++ b/src/system/boot/arch/arm/arch_cpu.h
@@ -13,7 +13,6 @@
 extern "C" {
 #endif
 
-extern void arch_spin(bigtime_t microseconds);
 extern void arch_cpu_memory_read_barrier(void);
 extern void arch_cpu_memory_write_barrier(void);
 extern status_t boot_arch_cpu_init(void);
diff --git a/src/system/boot/platform/efi/arch/arm/crt0-efi-arm.S 
b/src/system/boot/platform/efi/arch/arm/crt0-efi-arm.S
index c5bb6d482d..817d8a775b 100644
--- a/src/system/boot/platform/efi/arch/arm/crt0-efi-arm.S
+++ b/src/system/boot/platform/efi/arch/arm/crt0-efi-arm.S
@@ -69,7 +69,7 @@ extra_header_fields:
        // Everything before the kernel image is considered part of the header
        .long   _start - ImageBase              // SizeOfHeaders
        .long   0                               // CheckSum
-       .short  EFI_SUBSYSTEM                   // Subsystem
+       .short  10                              // Subsystem (EFI)
        .short  0                               // DllCharacteristics
        .long   0                               // SizeOfStackReserve
        .long   0                               // SizeOfStackCommit
@@ -122,6 +122,7 @@ section_table:
        .short  0               // NumberOfLineNumbers  (0 for executables)
        .long   0xe0500020      // Characteristics (section flags)
 
+       .globl _start
 _start:
        stmfd           sp!, {r0-r2, lr}
 
diff --git a/src/system/boot/platform/efi/arch/arm64/crt0-efi-arm64.S 
b/src/system/boot/platform/efi/arch/arm64/crt0-efi-arm64.S
index c300d89bdf..481bdb40e1 100644
--- a/src/system/boot/platform/efi/arch/arm64/crt0-efi-arm64.S
+++ b/src/system/boot/platform/efi/arch/arm64/crt0-efi-arm64.S
@@ -67,7 +67,7 @@ extra_header_fields:
        // Everything before the kernel image is considered part of the header
        .long   _start - ImageBase              // SizeOfHeaders
        .long   0                               // CheckSum
-       .short  EFI_SUBSYSTEM                   // Subsystem
+       .short  10                              // Subsystem (EFI)
        .short  0                               // DllCharacteristics
        .quad   0                               // SizeOfStackReserve
        .quad   0                               // SizeOfStackCommit
@@ -110,6 +110,8 @@ section_table:
        .long   0xc0000040      // Characteristics (section flags)
 
        .align          12
+
+       .globl _start
 _start:
        stp             x29, x30, [sp, #-32]!
        mov             x29, sp
diff --git a/src/system/boot/platform/u-boot/arch/ppc/arch_cpu.cpp 
b/src/system/boot/platform/u-boot/arch/ppc/arch_cpu.cpp
index 68c338e8f5..dff416c268 100644
--- a/src/system/boot/platform/u-boot/arch/ppc/arch_cpu.cpp
+++ b/src/system/boot/platform/u-boot/arch/ppc/arch_cpu.cpp
@@ -257,7 +257,7 @@ check_cpu_features()
 
 
 extern "C" void
-arch_spin(bigtime_t microseconds)
+spin(bigtime_t microseconds)
 {
        for(bigtime_t i=0;i<microseconds;i=i+1)
        {
diff --git a/src/system/boot/platform/u-boot/cpu.cpp 
b/src/system/boot/platform/u-boot/cpu.cpp
index 96c4265552..a4e601e20b 100644
--- a/src/system/boot/platform/u-boot/cpu.cpp
+++ b/src/system/boot/platform/u-boot/cpu.cpp
@@ -26,17 +26,6 @@
 #endif
 
 
-extern "C" void
-spin(bigtime_t microseconds)
-{
-       #warning U-Boot:TODO!!
-       // TODO: use API if available
-
-       // fallback to arch-specific code
-       arch_spin(microseconds);
-}
-
-
 extern "C" void
 cpu_init()
 {
diff --git a/src/system/boot/platform/u-boot/cpu.h 
b/src/system/boot/platform/u-boot/cpu.h
index dd9de74e55..66523a6bec 100644
--- a/src/system/boot/platform/u-boot/cpu.h
+++ b/src/system/boot/platform/u-boot/cpu.h
@@ -13,7 +13,6 @@
 extern "C" {
 #endif
 
-extern void arch_spin(bigtime_t microseconds);
 extern status_t boot_arch_cpu_init(void);
 extern void cpu_init(void);
 
diff --git a/src/system/ldscripts/arm/boot_loader_efi.ld 
b/src/system/ldscripts/arm/boot_loader_efi.ld
index 6851c1f821..22a734a84a 100644
--- a/src/system/ldscripts/arm/boot_loader_efi.ld
+++ b/src/system/ldscripts/arm/boot_loader_efi.ld
@@ -55,6 +55,8 @@ SECTIONS
   . = ALIGN(4096);
   .dynstr   : { *(.dynstr) }
   . = ALIGN(4096);
+
+  _end = . ;
   .note.gnu.build-id : { *(.note.gnu.build-id) }
   /DISCARD/ :
   {
diff --git a/src/system/ldscripts/riscv64/boot_loader_efi.ld 
b/src/system/ldscripts/riscv64/boot_loader_efi.ld
index aece030c37..455ba0dff9 100644
--- a/src/system/ldscripts/riscv64/boot_loader_efi.ld
+++ b/src/system/ldscripts/riscv64/boot_loader_efi.ld
@@ -61,6 +61,8 @@ SECTIONS
        . = ALIGN(4096);
        .dynstr   : { *(.dynstr) }
        . = ALIGN(4096);
+
+       _end = . ;
        .note.gnu.build-id : { *(.note.gnu.build-id) }
        /DISCARD/ : {
                *(.rel.reloc)


Other related posts:

  • » [haiku-commits] haiku: hrev53921 - in src/system/boot: arch/arm platform/u-boot platform/efi/arch/arm64 platform/efi/arch/arm platform/u-boot/arch/ppc - Alex von Gluck IV