summaryrefslogtreecommitdiffstats
path: root/libgloss/nds32/syscall_sbrk.S
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2014-03-21 20:34:46 +0000
committerJeff Johnston <jjohnstn@redhat.com>2014-03-21 20:34:46 +0000
commit8194dcec36afbfb8ceab9409605d72eba5f773ea (patch)
tree2001465d3dc19048e64b8f9c713a8f021854d13d /libgloss/nds32/syscall_sbrk.S
parentc18decccef958c6e37acc341391a6712d4570ade (diff)
downloadcygnal-8194dcec36afbfb8ceab9409605d72eba5f773ea.tar.gz
cygnal-8194dcec36afbfb8ceab9409605d72eba5f773ea.tar.bz2
cygnal-8194dcec36afbfb8ceab9409605d72eba5f773ea.zip
2014-03-21 Sabrini Ni <sabrinanitw@gmail.com>
* 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.
Diffstat (limited to 'libgloss/nds32/syscall_sbrk.S')
-rw-r--r--libgloss/nds32/syscall_sbrk.S4
1 files changed, 3 insertions, 1 deletions
diff --git a/libgloss/nds32/syscall_sbrk.S b/libgloss/nds32/syscall_sbrk.S
index 3c2d9d4f0..ae32e8dcd 100644
--- a/libgloss/nds32/syscall_sbrk.S
+++ b/libgloss/nds32/syscall_sbrk.S
@@ -30,6 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../syscall.h"
#include "syscall_extra.h"
+ .extern _impure_ptr /* The first element is _errno. */
.extern _end
.global _sbrk
@@ -66,7 +67,8 @@ _sbrk:
.Lerror:
movi $r0, 12
- s.w $r0, errno /* Set error code: 12 (ENOMEM) to errno. */
+ l.w $r15, _impure_ptr
+ swi $r0, [$r15] /* Set errno. */
movi $r0, -1 /* Reture value is -1. */
ret