scm: only use '.arch_extension sec' if the compiler is newer than gcc4.4

This fixes broken pre gcc4.6 compilation.
This commit is contained in:
showp1984
2012-01-23 09:20:57 +01:00
committed by James Sullins
parent cd2df4074a
commit 12b475923b

View File

@@ -29,6 +29,10 @@
#define SCM_ERROR -1
#define SCM_INTERRUPTED 1
#define GCC_VERSION (__GNUC__ * 10000 \
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
static DEFINE_MUTEX(scm_lock);
/**
@@ -173,7 +177,9 @@ static u32 smc(u32 cmd_addr)
__asmeq("%1", "r0")
__asmeq("%2", "r1")
__asmeq("%3", "r2")
#if GCC_VERSION > 40400
".arch_extension sec\n"
#endif
"smc #0 @ switch to secure world\n"
: "=r" (r0)
: "r" (r0), "r" (r1), "r" (r2)
@@ -295,7 +301,9 @@ s32 scm_call_atomic1(u32 svc, u32 cmd, u32 arg1)
__asmeq("%1", "r0")
__asmeq("%2", "r1")
__asmeq("%3", "r2")
#if GCC_VERSION > 40400
".arch_extension sec\n"
#endif
"smc #0 @ switch to secure world\n"
: "=r" (r0)
: "r" (r0), "r" (r1), "r" (r2)
@@ -328,7 +336,9 @@ s32 scm_call_atomic2(u32 svc, u32 cmd, u32 arg1, u32 arg2)
__asmeq("%2", "r1")
__asmeq("%3", "r2")
__asmeq("%4", "r3")
#if GCC_VERSION > 40400
".arch_extension sec\n"
#endif
"smc #0 @ switch to secure world\n"
: "=r" (r0)
: "r" (r0), "r" (r1), "r" (r2), "r" (r3));
@@ -356,7 +366,9 @@ u32 scm_get_version(void)
__asmeq("%1", "r1")
__asmeq("%2", "r0")
__asmeq("%3", "r1")
#if GCC_VERSION > 40400
".arch_extension sec\n"
#endif
"smc #0 @ switch to secure world\n"
: "=r" (r0), "=r" (r1)
: "r" (r0), "r" (r1)