diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-05-04 00:23:48 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-05-04 00:23:48 +0200 |
commit | 14685d65958bed4d68b9c60564fa8d09aa746462 (patch) | |
tree | f2480af19061f27c67a36a2bb8fd7f41d047732a /sys/src/ape/lib/ap/68020 | |
parent | 7657312dcf5b9435ff848b20dfc3a0546ab8a500 (diff) |
ape: return plan9 error strings from strerror()
when _syserrno() fails to map a plan9 error string to
a unix error number, we copy the plan9 error string
to the per process error buffer "plan9err" and set
errno = EPLAN9.
when strerror() is called with EPLAN9, it returns
a pointer to the plan9err buffer.
Diffstat (limited to 'sys/src/ape/lib/ap/68020')
-rw-r--r-- | sys/src/ape/lib/ap/68020/main9.s | 18 | ||||
-rw-r--r-- | sys/src/ape/lib/ap/68020/main9p.s | 12 |
2 files changed, 23 insertions, 7 deletions
diff --git a/sys/src/ape/lib/ap/68020/main9.s b/sys/src/ape/lib/ap/68020/main9.s index 6b80251b6..2639568f4 100644 --- a/sys/src/ape/lib/ap/68020/main9.s +++ b/sys/src/ape/lib/ap/68020/main9.s @@ -2,22 +2,32 @@ GLOBL _tos(SB), $4 GLOBL _errnoloc(SB), $4 +GLOBL _plan9err(SB), $4 GLOBL _privates(SB), $4 GLOBL _nprivates(SB), $4 -TEXT _main(SB), 1, $(16+NPRIVATES*4) +TEXT _main(SB), 1, $(4+128+NPRIVATES*4) MOVL $a6base(SB), A6 /* _tos = arg */ MOVL R0, _tos(SB) /* return value of sys exec!! */ - LEA errno+12(SB), _errnoloc(SB) - LEA private+16(SP), _privates(SB) + + MOVL A7, A1 + MOVL A1, _errnoloc(SB) + ADDL $4, A1 + MOVL A1, _plan9err(SB) + ADDL $128, A1 + MOVL A1, _privates(SB) MOVL $NPRIVATES, _nprivates(SB) + BSR _envsetup(SB) + + /* main(argc, argv, environ); */ + MOVL environ(SB), TOS PEA inargv+0(FP) MOVL inargc-4(FP), TOS - BSR _envsetup(SB) BSR main(SB) + MOVL R0,TOS BSR exit(SB) RTS diff --git a/sys/src/ape/lib/ap/68020/main9p.s b/sys/src/ape/lib/ap/68020/main9p.s index e24faeddc..8d5a5bc28 100644 --- a/sys/src/ape/lib/ap/68020/main9p.s +++ b/sys/src/ape/lib/ap/68020/main9p.s @@ -2,16 +2,22 @@ GLOBL _tos(SB), $4 GLOBL _errnoloc(SB), $4 +GLOBL _plan9err(SB), $4 GLOBL _privates(SB), $4 GLOBL _nprivates(SB), $4 -TEXT _mainp(SB), 1, $(16+NPRIVATES*4) +TEXT _mainp(SB), 1, $(4+128+NPRIVATES*4) MOVL $a6base(SB), A6 /* _tos = arg */ MOVL R0, _tos(SB) /* return value of sys exec!! */ - LEA errno+12(SP), _errnoloc(SB) - LEA private+16(SP), _privates(SB) + + MOVL A7, A1 + MOVL A1, _errnoloc(SB) + ADDL $4, A1 + MOVL A1, _plan9err(SB) + ADDL $128, A1 + MOVL A1, _privates(SB) MOVL $NPRIVATES, _nprivates(SB) /* _profmain(); */ |