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.
This commit is contained in:
parent
c18decccef
commit
8194dcec36
@ -1,3 +1,30 @@
|
|||||||
|
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.
|
||||||
|
|
||||||
2014-03-21 Sabrini Ni <sabrinanitw@gmail.com>
|
2014-03-21 Sabrini Ni <sabrinanitw@gmail.com>
|
||||||
|
|
||||||
* nds32/crt0.S: Use pseudo-instruction "bal frame" to replace
|
* nds32/crt0.S: Use pseudo-instruction "bal frame" to replace
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _argv, SYS_argv
|
SYS_WRAPPER _argv, SYS_argv
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _argvlen, SYS_argvlen
|
SYS_WRAPPER _argvlen, SYS_argvlen
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _chdir, SYS_chdir
|
SYS_WRAPPER _chdir, SYS_chdir
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _chmod, SYS_chmod
|
SYS_WRAPPER _chmod, SYS_chmod
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _close, SYS_close
|
SYS_WRAPPER _close, SYS_close
|
||||||
|
@ -31,7 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
.extern _impure_ptr /* The first element is _errno. */
|
||||||
.text
|
.text
|
||||||
.global __syscall_error_handler
|
.global __syscall_error_handler
|
||||||
.type __syscall_error_handler, @function
|
.type __syscall_error_handler, @function
|
||||||
@ -41,7 +41,8 @@ __syscall_error_handler:
|
|||||||
addi $r1, $r0, 1
|
addi $r1, $r0, 1
|
||||||
bnez $r1, 1f /* Branch if success. */
|
bnez $r1, 1f /* Branch if success. */
|
||||||
syscall SYS_geterr /* There is something wrong. */
|
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
|
move $r0, -1
|
||||||
1:
|
1:
|
||||||
ret
|
ret
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _fstat, SYS_fstat
|
SYS_WRAPPER _fstat, SYS_fstat
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _getpid, SYS_getpid
|
SYS_WRAPPER _getpid, SYS_getpid
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _gettimeofday, SYS_gettimeofday
|
SYS_WRAPPER _gettimeofday, SYS_gettimeofday
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _isatty, SYS_isatty
|
SYS_WRAPPER _isatty, SYS_isatty
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _kill, SYS_kill
|
SYS_WRAPPER _kill, SYS_kill
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _link, SYS_link
|
SYS_WRAPPER _link, SYS_link
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _lseek, SYS_lseek
|
SYS_WRAPPER _lseek, SYS_lseek
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _open, SYS_open
|
SYS_WRAPPER _open, SYS_open
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _read, SYS_read
|
SYS_WRAPPER _read, SYS_read
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _rename, SYS_rename
|
SYS_WRAPPER _rename, SYS_rename
|
||||||
|
@ -30,6 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "../syscall.h"
|
#include "../syscall.h"
|
||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
.extern _impure_ptr /* The first element is _errno. */
|
||||||
.extern _end
|
.extern _end
|
||||||
.global _sbrk
|
.global _sbrk
|
||||||
|
|
||||||
@ -66,7 +67,8 @@ _sbrk:
|
|||||||
|
|
||||||
.Lerror:
|
.Lerror:
|
||||||
movi $r0, 12
|
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. */
|
movi $r0, -1 /* Reture value is -1. */
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _stat, SYS_stat
|
SYS_WRAPPER _stat, SYS_stat
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _system, SYS_system
|
SYS_WRAPPER _system, SYS_system
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _time, SYS_time
|
SYS_WRAPPER _time, SYS_time
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _times, SYS_times
|
SYS_WRAPPER _times, SYS_times
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _unlink, SYS_unlink
|
SYS_WRAPPER _unlink, SYS_unlink
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _utime, SYS_utime
|
SYS_WRAPPER _utime, SYS_utime
|
||||||
|
@ -31,5 +31,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "syscall_extra.h"
|
#include "syscall_extra.h"
|
||||||
|
|
||||||
|
|
||||||
.extern errno
|
|
||||||
SYS_WRAPPER _write, SYS_write
|
SYS_WRAPPER _write, SYS_write
|
||||||
|
Loading…
x
Reference in New Issue
Block a user