[haiku-commits] haiku: hrev47797 - src/system/kernel/arch/arm headers/private/kernel/arch/arm src/system/boot/arch/arm

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 2 Sep 2014 17:11:38 +0200 (CEST)

hrev47797 adds 2 changesets to branch 'master'
old head: 23b891504c606f02a411ae97b58ac456f6e1f402
new head: 83f5e2a258afeadc132a59c1723821bfffba62a7
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=83f5e2a+%5E23b8915

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

3fbb246: Added check to ensure KDL does not include frames beyond kernel entry 
in the backtrace. This prevents KDL from faulting when printing backtrace on 
ARM.

                                    [ Arvind S Raj <sraj.arvind@xxxxxxxxx> ]

83f5e2a: Fix stack alignment for bootloader.
  
  The ARM SP is pointing to the top item of the stack, not the first free
  byte. This was confusing dprintf making it fail to print 64bit integers.

                                   [ PulkoMandy <pulkomandy@xxxxxxxxxxxxx> ]

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

4 files changed, 12 insertions(+), 13 deletions(-)
headers/private/kernel/arch/arm/arch_kernel.h |  2 +-
headers/private/kernel/arch/arm/omap3.h       |  2 +-
src/system/boot/arch/arm/arch_mmu.cpp         |  2 +-
src/system/kernel/arch/arm/arch_debug.cpp     | 19 +++++++++----------

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

Commit:      3fbb24680c819d0819f4f876fe6565c336a19139
URL:         http://cgit.haiku-os.org/haiku/commit/?id=3fbb246
Author:      Arvind S Raj <sraj.arvind@xxxxxxxxx>
Date:        Thu Aug 14 18:57:39 2014 UTC
Committer:   PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Commit-Date: Tue Sep  2 11:39:57 2014 UTC

Added check to ensure KDL does not include frames beyond kernel entry in the 
backtrace. This prevents KDL from faulting when printing backtrace on ARM.

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

diff --git a/headers/private/kernel/arch/arm/arch_kernel.h 
b/headers/private/kernel/arch/arm/arch_kernel.h
index 766ab42..9c8723b 100644
--- a/headers/private/kernel/arch/arm/arch_kernel.h
+++ b/headers/private/kernel/arch/arm/arch_kernel.h
@@ -9,7 +9,7 @@
 
 // memory layout
 #define KERNEL_BASE    0x80000000
-#define KERNEL_SIZE    0x80000000
+#define KERNEL_SIZE    0x800000
 #define KERNEL_TOP     (KERNEL_BASE + (KERNEL_SIZE - 1))
 
 /*
diff --git a/src/system/boot/arch/arm/arch_mmu.cpp 
b/src/system/boot/arch/arm/arch_mmu.cpp
index 758a1f3..7e2f44a 100644
--- a/src/system/boot/arch/arm/arch_mmu.cpp
+++ b/src/system/boot/arch/arm/arch_mmu.cpp
@@ -59,7 +59,7 @@ TODO:
 
 
 // 8 MB for the kernel, kernel args, modules, driver settings, ...
-static const size_t kMaxKernelSize = 0x800000;
+static const size_t kMaxKernelSize = KERNEL_SIZE;
 
 // Base address for loader
 static const size_t kLoaderBaseAddress = KERNEL_LOAD_BASE + kMaxKernelSize;
diff --git a/src/system/kernel/arch/arm/arch_debug.cpp 
b/src/system/kernel/arch/arm/arch_debug.cpp
index 1832ca2..985ce7c 100644
--- a/src/system/kernel/arch/arm/arch_debug.cpp
+++ b/src/system/kernel/arch/arm/arch_debug.cpp
@@ -56,19 +56,18 @@ already_visited(uint32 *visited, int32 *_last, int32 *_num, 
uint32 fp)
 static status_t
 get_next_frame(addr_t fp, addr_t *next, addr_t *ip)
 {
-       if (fp != 0) {
-               addr_t _fp = *(((addr_t*)fp) -3);
-               addr_t _sp = *(((addr_t*)fp) -2);
-               addr_t _lr = *(((addr_t*)fp) -1);
-               addr_t _pc = *(((addr_t*)fp) -0);
+       addr_t _fp = *(((addr_t*)fp) -3);
+       addr_t _sp = *(((addr_t*)fp) -2);
+       addr_t _lr = *(((addr_t*)fp) -1);
+       addr_t _pc = *(((addr_t*)fp) -0);
 
-               *ip = (_fp != 0) ? _lr : _pc;
-               *next = _fp;
-
-               return B_OK;
+       if (_lr > KERNEL_TOP) {
+               return B_BAD_ADDRESS;
        }
+       *ip = (_fp != 0) ? _lr : _pc;
+       *next = _fp;
 
-       return B_BAD_VALUE;
+       return B_OK;
 }
 
 

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

Revision:    hrev47797
Commit:      83f5e2a258afeadc132a59c1723821bfffba62a7
URL:         http://cgit.haiku-os.org/haiku/commit/?id=83f5e2a
Author:      PulkoMandy <pulkomandy@xxxxxxxxxxxxx>
Date:        Tue Sep  2 15:01:27 2014 UTC

Fix stack alignment for bootloader.

The ARM SP is pointing to the top item of the stack, not the first free
byte. This was confusing dprintf making it fail to print 64bit integers.

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

diff --git a/headers/private/kernel/arch/arm/omap3.h 
b/headers/private/kernel/arch/arm/omap3.h
index 44a8325..8e44035 100644
--- a/headers/private/kernel/arch/arm/omap3.h
+++ b/headers/private/kernel/arch/arm/omap3.h
@@ -25,7 +25,7 @@
 
 #define SDRAM_BASE 0x80000000
 // Offset of stack top defined with respect to SDRAM_BASE
-#define KSTACK_TOP 0x27fffff
+#define KSTACK_TOP 0x2800000
 
 #define VECT_BASE 0x00000000
 #define VECT_SIZE 0x1000


Other related posts:

  • » [haiku-commits] haiku: hrev47797 - src/system/kernel/arch/arm headers/private/kernel/arch/arm src/system/boot/arch/arm - pulkomandy