diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-02-17 13:25:24 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-02-17 13:25:24 +0100 |
commit | 2c5c78425516590e894c9c334182073fcc56a10b (patch) | |
tree | ec4c8b58ec1d8144936bf8111382a6e7141d55c0 /sys/src/libc/arm | |
parent | 87fcb107ef333f5dce7618e0f4c73d69ebc75eb5 (diff) |
prof: properly save and restore RARG for amd64
amd64 passes first argument in RARG (BP) register
which has the be preserved duing _profin() and
_profout() calls. to handle this we introduce
_saveret() and _savearg(). _saveret() returns
AX, _savearg() returns RARG (BP). for archs other
and amd64, _saveret() and _savearg() are the
same function, doing nothing.
restoing works with dummy function:
uintptr
_restore(uintptr, uintptr ret)
{
return ret;
}
...
ret = _saveret();
arg = _savearg();
...
return _restore(arg, ret);
as we pass arg as the first argument, RARG (BP) is
restored.
Diffstat (limited to 'sys/src/libc/arm')
-rw-r--r-- | sys/src/libc/arm/main9p.s | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/src/libc/arm/main9p.s b/sys/src/libc/arm/main9p.s index cb51a4379..db98d6827 100644 --- a/sys/src/libc/arm/main9p.s +++ b/sys/src/libc/arm/main9p.s @@ -31,6 +31,7 @@ loop: MOVW $_profin(SB), R(arg) /* force loading of profile */ B loop +TEXT _saveret(SB), 1, $0 TEXT _savearg(SB), 1, $0 RET |