From f3bc9ef92a8bcd012c9eea30676eca19f567f0f7 Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 9 Sep 2018 18:57:12 +0200 Subject: [PATCH] Call proper Linux system calls proper-like. --- plat/linuxmips/libsys/_syscall.s | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plat/linuxmips/libsys/_syscall.s b/plat/linuxmips/libsys/_syscall.s index 75c551d20..8d5ecde90 100644 --- a/plat/linuxmips/libsys/_syscall.s +++ b/plat/linuxmips/libsys/_syscall.s @@ -14,5 +14,21 @@ .define __syscall __syscall: + lw r2, 0(sp) ! syscall number + addiu r2, r2, 4000 ! MIPS uses non-standard numbers + lw r4, 4(sp) + lw r5, 8(sp) + lw r6, 12(sp) syscall 0 + beq r7, zero, exit ! branch on success + nop + + /* The result (in r2) is the errno. */ + lui at, ha16[_errno] + sw r2, lo16[_errno] (at) + li r2, -1 +exit: + jr ra + nop +