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
This commit is contained in:
Alexander von Gluck IV
2014-02-12 23:37:15 -06:00
parent 8018e8fa91
commit 35171b073d
4 changed files with 19 additions and 10 deletions
@@ -75,6 +75,23 @@ extern addr_t arm_get_fp(void);
extern int mmu_read_c1(void); extern int mmu_read_c1(void);
extern int mmu_write_c1(int val); 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 #ifdef __cplusplus
}; };
#endif #endif
-8
View File
@@ -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 status_t
arch_cpu_shutdown(bool reboot) arch_cpu_shutdown(bool reboot)
{ {
@@ -103,7 +103,7 @@ ARMPagingMethod32Bit::Method()
ARMPagingMethod32Bit::SetPageTableEntry(page_table_entry* entry, ARMPagingMethod32Bit::SetPageTableEntry(page_table_entry* entry,
page_table_entry newEntry) page_table_entry newEntry)
{ {
return atomic_set((int32*)entry, newEntry); return atomic_get_and_set((int32*)entry, newEntry);
} }
@@ -17,7 +17,7 @@
struct ARMPagingStructures : DeferredDeletable { struct ARMPagingStructures : DeferredDeletable {
uint32 pgdir_phys; uint32 pgdir_phys;
vint32 ref_count; int32 ref_count;
vint32 active_on_cpus; vint32 active_on_cpus;
// mask indicating on which CPUs the map is currently used // mask indicating on which CPUs the map is currently used