From 8194dcec36afbfb8ceab9409605d72eba5f773ea Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Fri, 21 Mar 2014 20:34:46 +0000 Subject: 2014-03-21 Sabrini Ni * nds32/syscall_argv.S: Correct the method to set errno. * nds32/syscall_argvlen.S: Ditto. * nds32/syscall_chdir.S: Ditto. * nds32/syscall_chmod.S: Ditto. * nds32/syscall_close.S: Ditto. * nds32/syscall_error_handler.S: Ditto. * nds32/syscall_fstat.S: Ditto. * nds32/syscall_getpid.S: Ditto. * nds32/syscall_gettimeofday.S: Ditto. * nds32/syscall_isatty.S: Ditto. * nds32/syscall_kill.S: Ditto. * nds32/syscall_link.S: Ditto. * nds32/syscall_lseek.S: Ditto. * nds32/syscall_open.S: Ditto. * nds32/syscall_read.S: Ditto. * nds32/syscall_rename.S: Ditto. * nds32/syscall_sbrk.S: Ditto. * nds32/syscall_stat.S: Ditto. * nds32/syscall_system.S: Ditto. * nds32/syscall_time.S: Ditto. * nds32/syscall_times.S: Ditto. * nds32/syscall_unlink.S: Ditto. * nds32/syscall_utime.S: Ditto. * nds32/syscall_write.S: Ditto. --- libgloss/nds32/syscall_error_handler.S | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libgloss/nds32/syscall_error_handler.S') diff --git a/libgloss/nds32/syscall_error_handler.S b/libgloss/nds32/syscall_error_handler.S index dbb5f6856..9398c5171 100644 --- a/libgloss/nds32/syscall_error_handler.S +++ b/libgloss/nds32/syscall_error_handler.S @@ -31,7 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "syscall_extra.h" - .extern errno + .extern _impure_ptr /* The first element is _errno. */ .text .global __syscall_error_handler .type __syscall_error_handler, @function @@ -41,7 +41,8 @@ __syscall_error_handler: addi $r1, $r0, 1 bnez $r1, 1f /* Branch if success. */ syscall SYS_geterr /* There is something wrong. */ - s.w $r0, errno /* Store error code into errno. */ + l.w $r15, _impure_ptr + swi $r0, [$r15] /* Set errno. */ move $r0, -1 1: ret -- cgit v1.2.3