[haiku-commits] haiku: hrev46864 - headers/private/kernel/arch/arm src/system/kernel/arch/arm src/system/kernel/arch/arm/paging/32bit src/system/kernel/arch/arm/paging

  • From: kallisti5@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 13 Feb 2014 06:33:14 +0100 (CET)

hrev46864 adds 2 changesets to branch 'master'
old head: 92b2e03d0d922d77ce59c677f010ff94772489bc
new head: 35171b073dc15f5d6a487135787f82a8484ab0ed
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=35171b0+%5E92b2e03

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

8018e8f: arm: Rework hrev46863 to use gcc built-in
  
  * Those calls were indeed v7+ only, and our toolchain
    is v6.

35171b0: arm: Miscellaneous build fixes
  
  * Use atomic_get_and_set for return value
  * Atomics are no longer volatile
  * Add missing arch_cpu_pause stub
  * Move arch_cpu_idle to arch_cpu header to match
    other architectures

                          [ Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> ]

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

5 files changed, 22 insertions(+), 16 deletions(-)
headers/private/kernel/arch/arm/arch_atomic.h       |  9 +++------
headers/private/kernel/arch/arm/arch_cpu.h          | 17 +++++++++++++++++
src/system/kernel/arch/arm/arch_cpu.cpp             |  8 --------
.../arch/arm/paging/32bit/ARMPagingMethod32Bit.h    |  2 +-
.../kernel/arch/arm/paging/ARMPagingStructures.h    |  2 +-

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

Commit:      8018e8fa9152d2cc3571db57a370ab171238508e
URL:         http://cgit.haiku-os.org/haiku/commit/?id=8018e8f
Author:      Alexander von Gluck IV <kallisti5@xxxxxxxxxxx>
Date:        Thu Feb 13 05:34:08 2014 UTC

arm: Rework hrev46863 to use gcc built-in

* Those calls were indeed v7+ only, and our toolchain
  is v6.

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

diff --git a/headers/private/kernel/arch/arm/arch_atomic.h 
b/headers/private/kernel/arch/arm/arch_atomic.h
index 5d1005e..d893bbc 100644
--- a/headers/private/kernel/arch/arm/arch_atomic.h
+++ b/headers/private/kernel/arch/arm/arch_atomic.h
@@ -12,24 +12,21 @@
 static inline void
 memory_read_barrier_inline(void)
 {
-       // TODO Only ArmV7+?
-       asm volatile("dsb sy" : : : "memory");
+       __sync_synchronize();
 }
 
 
 static inline void
 memory_write_barrier_inline(void)
 {
-       // TODO Only ArmV7+?
-       asm volatile("dsb sy" : : : "memory");
+       __sync_synchronize();
 }
 
 
 static inline void
 memory_full_barrier_inline(void)
 {
-       // TODO Only ArmV7+?
-       asm volatile("dsb sy" : : : "memory");
+       __sync_synchronize();
 }
 
 

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

Revision:    hrev46864
Commit:      35171b073dc15f5d6a487135787f82a8484ab0ed
URL:         http://cgit.haiku-os.org/haiku/commit/?id=35171b0
Author:      Alexander von Gluck IV <kallisti5@xxxxxxxxxxx>
Date:        Thu Feb 13 05:37:15 2014 UTC

arm: Miscellaneous build fixes

* Use atomic_get_and_set for return value
* Atomics are no longer volatile
* Add missing arch_cpu_pause stub
* Move arch_cpu_idle to arch_cpu header to match
  other architectures

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

diff --git a/headers/private/kernel/arch/arm/arch_cpu.h 
b/headers/private/kernel/arch/arm/arch_cpu.h
index aa7bfd9..f63e79d 100644
--- a/headers/private/kernel/arch/arm/arch_cpu.h
+++ b/headers/private/kernel/arch/arm/arch_cpu.h
@@ -75,6 +75,23 @@ extern addr_t arm_get_fp(void);
 extern int mmu_read_c1(void);
 extern int mmu_write_c1(int val);
 
+
+static inline void
+arch_cpu_pause(void)
+{
+       // TODO: ARM Priority pause call
+}
+
+
+static inline void
+arch_cpu_idle(void)
+{
+       uint32 Rd = 0;
+       asm volatile("mcr p15, 0, %[c7format], c7, c0, 4"
+               : : [c7format] "r" (Rd) );
+}
+
+
 #ifdef __cplusplus
 };
 #endif
diff --git a/src/system/kernel/arch/arm/arch_cpu.cpp 
b/src/system/kernel/arch/arm/arch_cpu.cpp
index 7021427..afe8455 100644
--- a/src/system/kernel/arch/arm/arch_cpu.cpp
+++ b/src/system/kernel/arch/arm/arch_cpu.cpp
@@ -77,14 +77,6 @@ arch_cpu_init_post_modules(kernel_args *args)
 }
 
 
-void
-arch_cpu_idle(void)
-{
-       uint32 Rd = 0;
-       asm volatile("mcr p15, 0, %[c7format], c7, c0, 4" : : [c7format] "r" 
(Rd) );
-}
-
-
 status_t
 arch_cpu_shutdown(bool reboot)
 {
diff --git a/src/system/kernel/arch/arm/paging/32bit/ARMPagingMethod32Bit.h 
b/src/system/kernel/arch/arm/paging/32bit/ARMPagingMethod32Bit.h
index 7efbd82..4b66504 100644
--- a/src/system/kernel/arch/arm/paging/32bit/ARMPagingMethod32Bit.h
+++ b/src/system/kernel/arch/arm/paging/32bit/ARMPagingMethod32Bit.h
@@ -103,7 +103,7 @@ ARMPagingMethod32Bit::Method()
 ARMPagingMethod32Bit::SetPageTableEntry(page_table_entry* entry,
        page_table_entry newEntry)
 {
-       return atomic_set((int32*)entry, newEntry);
+       return atomic_get_and_set((int32*)entry, newEntry);
 }
 
 
diff --git a/src/system/kernel/arch/arm/paging/ARMPagingStructures.h 
b/src/system/kernel/arch/arm/paging/ARMPagingStructures.h
index c370bac..61887b0 100644
--- a/src/system/kernel/arch/arm/paging/ARMPagingStructures.h
+++ b/src/system/kernel/arch/arm/paging/ARMPagingStructures.h
@@ -17,7 +17,7 @@
 
 struct ARMPagingStructures : DeferredDeletable {
        uint32                                          pgdir_phys;
-       vint32                                          ref_count;
+       int32                                           ref_count;
        vint32                                          active_on_cpus;
                // mask indicating on which CPUs the map is currently used
 


Other related posts: