From: Vladimir Serbinenko Date: Wed, 13 Nov 2013 08:58:52 +0000 (+0100) Subject: * grub-core/kern/arm/cache.c (probe_caches): Move asm part to ... X-Git-Tag: grub-2.02-beta1~347 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bdd07195cd588ea011b8bb9b8374d9d6a6cba46;p=thirdparty%2Fgrub.git * grub-core/kern/arm/cache.c (probe_caches): Move asm part to ... * grub-core/kern/arm/cache_armv6.S: ... here. This allows this asm to stay in arm even if surrounding is thumb. --- diff --git a/ChangeLog b/ChangeLog index 6463c8521..a92251584 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-11-13 Vladimir Serbinenko + + * grub-core/kern/arm/cache.c (probe_caches): Move asm part to ... + * grub-core/kern/arm/cache_armv6.S: ... here. This allows this + asm to stay in arm even if surrounding is thumb. + 2013-11-13 Vladimir Serbinenko * grub-core/kern/arm/misc.S: Add __muldi3 and __aeabi_lmul. Those diff --git a/grub-core/kern/arm/cache.c b/grub-core/kern/arm/cache.c index e9271049b..f78d070a2 100644 --- a/grub-core/kern/arm/cache.c +++ b/grub-core/kern/arm/cache.c @@ -21,6 +21,8 @@ void grub_arch_sync_caches_armv6 (void *address, grub_size_t len); void grub_arch_sync_caches_armv7 (void *address, grub_size_t len); void grub_arm_disable_caches_mmu_armv6 (void); void grub_arm_disable_caches_mmu_armv7 (void); +grub_uint32_t grub_arm_main_id (void); +grub_uint32_t grub_arm_cache_type (void); static void probe_caches (void) @@ -28,7 +30,7 @@ probe_caches (void) grub_uint32_t main_id, cache_type; /* Read main ID Register */ - asm volatile ("mrc p15, 0, %0, c0, c0, 0": "=r"(main_id)); + main_id = grub_arm_main_id (); switch ((main_id >> 16) & 0xf) { @@ -44,7 +46,7 @@ probe_caches (void) } /* Read Cache Type Register */ - asm volatile ("mrc p15, 0, %0, c0, c0, 1": "=r"(cache_type)); + cache_type = grub_arm_cache_type (); switch (cache_type >> 24) { diff --git a/grub-core/kern/arm/cache_armv6.S b/grub-core/kern/arm/cache_armv6.S index 68d829826..52b81573d 100644 --- a/grub-core/kern/arm/cache_armv6.S +++ b/grub-core/kern/arm/cache_armv6.S @@ -34,4 +34,12 @@ clean_invalidate_dcache: mcr p15, 0, r0, c7, c14, 0 @ Clean/Invalidate D-cache bx lr -#include "cache.S" \ No newline at end of file +#include "cache.S" + +FUNCTION(grub_arm_main_id) + mrc p15, 0, r0, c0, c0, 0 + bx lr + +FUNCTION(grub_arm_cache_type) + mrc p15, 0, r0, c0, c0, 1 + bx lr \ No newline at end of file