mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
arm: smh: Fix uninitialized parameters with newer GCCs
Newer versions of GCC won't initialize parts of structures which don't appear to be used. This results in uninitialized semihosting parameters passed via R1. Fix this by marking the inline assembly as clobbering memory. Signed-off-by: Sean Anderson <sean.anderson@seco.com>
This commit is contained in:
parent
1a4af2d950
commit
f4b540e25c
1 changed files with 3 additions and 3 deletions
|
@ -32,12 +32,12 @@ static noinline long smh_trap(unsigned int sysnum, void *addr)
|
|||
{
|
||||
register long result asm("r0");
|
||||
#if defined(CONFIG_ARM64)
|
||||
asm volatile ("hlt #0xf000" : "=r" (result) : "0"(sysnum), "r"(addr));
|
||||
asm volatile ("hlt #0xf000" : "=r" (result) : "0"(sysnum), "r"(addr) : "memory");
|
||||
#elif defined(CONFIG_CPU_V7M)
|
||||
asm volatile ("bkpt #0xAB" : "=r" (result) : "0"(sysnum), "r"(addr));
|
||||
asm volatile ("bkpt #0xAB" : "=r" (result) : "0"(sysnum), "r"(addr) : "memory");
|
||||
#else
|
||||
/* Note - untested placeholder */
|
||||
asm volatile ("svc #0x123456" : "=r" (result) : "0"(sysnum), "r"(addr));
|
||||
asm volatile ("svc #0x123456" : "=r" (result) : "0"(sysnum), "r"(addr) : "memory");
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue