xtensa_sim_console: fix simcall
simcall must be in the volatile asm so that gcc does not optimize it out. It also needs "memory" clobber to make sure data passed through memory buffer is actually written back before the simcall. Change-Id: I410b7348bf605d0d08f81ec5395f6cb144f33a43 Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
This commit is contained in:
parent
ed3d7c1de5
commit
0ad868a58c
1 changed files with 3 additions and 2 deletions
|
@ -25,9 +25,10 @@ static int console_out(int c)
|
||||||
register int ret_err __asm__ ("a3");
|
register int ret_err __asm__ ("a3");
|
||||||
|
|
||||||
buf[0] = (char)c;
|
buf[0] = (char)c;
|
||||||
__asm__ ("simcall"
|
__asm__ volatile ("simcall"
|
||||||
: "=a" (ret_val), "=a" (ret_err)
|
: "=a" (ret_val), "=a" (ret_err)
|
||||||
: "a" (a2), "a" (a3), "a" (a4), "a" (a5));
|
: "a" (a2), "a" (a3), "a" (a4), "a" (a5)
|
||||||
|
: "memory");
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue