ARM: Fix loads.

Follow-up to 7e40a92732c3035003ae779022e5beaf6562375f.

* lib/arm-mes-mescc/setjmp.c (longjmp): Disable.
* lib/linux/arm-mes-mescc/mini.c (_exit): Use ldr.
(_write): Use ldr.
* lib/linux/arm-mes-mescc/syscall.c (__sys_call): Use ldr.
(__sys_call1): Use ldr.
(__sys_call2): Use ldr.
(__sys_call3): Use ldr.
(__sys_call4): Use ldr.
This commit is contained in:
Danny Milosavljevic 2019-04-14 14:20:12 +02:00 committed by Jan Nieuwenhuizen
parent 6fbead7479
commit 20d0e0d950
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
3 changed files with 23 additions and 23 deletions

View File

@ -26,11 +26,11 @@ longjmp (jmp_buf env, int val)
{
val = val == 0 ? 1 : val;
///asm ("!0x0c mov____0x8(%ebp),%eax"); // val
asm ("!0x08 mov____0x8(%ebp),%ebp"); // env*
//asm ("!0x08 ldr____%fp,(%fp,+#$i8)");
asm ("!0x4 mov____0x8(%ebp),%r1"); // env.__pc
asm ("!0x8 mov____0x8(%ebp),%esp"); // env.__sp
asm ("!0x0 mov____0x8(%ebp),%ebp"); // env.__bp
//asm ("!0x4 ldr____%r1,(%fp,+#$i8)"); // env.__pc
//asm ("!0x8 ldr____%sp,(%fp,+#$i8)"); // env.__sp
//asm ("!0x0 ldr____%fp,(%fp,+#$i8)"); // env.__bp
asm ("jmp____*%r1");
// not reached
exit (42);

View File

@ -22,7 +22,7 @@ void
_exit ()
{
asm ("SYS_exit mov____$i8,%r7");
asm ("!8 mov____0x8(%ebp),%r0");
asm ("!8 ldr____%r0,(%fp,+#$i8)");
asm ("swi____$0");
}
@ -30,8 +30,8 @@ void
_write ()
{
asm ("SYS_write mov____$i8,%r7");
asm ("!8 mov____0x8(%ebp),%r0");
asm ("!12 mov____0x8(%ebp),%r1");
asm ("!16 mov____0x8(%ebp),%r2");
asm ("!8 ldr____%r0,(%fp,+#$i8)");
asm ("!12 ldr____%r1,(%fp,+#$i8)");
asm ("!16 ldr____%r2,(%fp,+#$i8)");
asm ("swi____$0");
}

View File

@ -24,45 +24,45 @@
int
__sys_call (int sys_call)
{
asm ("!8 mov____0x8(%ebp),%r7");
asm ("!8 ldr____%r7,(%fp,+#$i8)");
asm ("swi____$0");
}
int
__sys_call1 (int sys_call, int one)
{
asm ("!8 mov____0x8(%ebp),%r7");
asm ("!12 mov____0x8(%ebp),%r0");
asm ("!8 ldr____%r7,(%fp,+#$i8)");
asm ("!12 ldr____%r0,(%fp,+#$i8)");
asm ("swi____$0");
}
int
__sys_call2 (int sys_call, int one, int two)
{
asm ("!8 mov____0x8(%ebp),%r7");
asm ("!12 mov____0x8(%ebp),%r0");
asm ("!16 mov____0x8(%ebp),%r1");
asm ("!8 ldr____%r7,(%fp,+#$i8)");
asm ("!12 ldr____%r0,(%fp,+#$i8)");
asm ("!16 ldr____%r1,(%fp,+#$i8)");
asm ("swi____$0");
}
int
__sys_call3 (int sys_call, int one, int two, int three)
{
asm ("!8 mov____0x8(%ebp),%r7");
asm ("!12 mov____0x8(%ebp),%r0");
asm ("!16 mov____0x8(%ebp),%r1");
asm ("!20 mov____0x8(%ebp),%r2");
asm ("!8 ldr____%r7,(%fp,+#$i8)");
asm ("!12 ldr____%r0,(%fp,+#$i8)");
asm ("!16 ldr____%r1,(%fp,+#$i8)");
asm ("!20 ldr____%r2,(%fp,+#$i8)");
asm ("swi____$0");
}
int
__sys_call4 (int sys_call, int one, int two, int three, int four)
{
asm ("!8 mov____0x8(%ebp),%r7");
asm ("!12 mov____0x8(%ebp),%r0");
asm ("!16 mov____0x8(%ebp),%r1");
asm ("!20 mov____0x8(%ebp),%r2");
asm ("!24 mov____0x8(%ebp),%r3");
asm ("!8 ldr____%r7,(%fp,+#$i8)");
asm ("!12 ldr____%r0,(%fp,+#$i8)");
asm ("!16 ldr____%r1,(%fp,+#$i8)");
asm ("!20 ldr____%r2,(%fp,+#$i8)");
asm ("!24 ldr____%r3,(%fp,+#$i8)");
asm ("swi____$0");
}