summaryrefslogtreecommitdiff
path: root/sys/src/libc/amd64
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-02-17 13:25:24 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2014-02-17 13:25:24 +0100
commit2c5c78425516590e894c9c334182073fcc56a10b (patch)
treeec4c8b58ec1d8144936bf8111382a6e7141d55c0 /sys/src/libc/amd64
parent87fcb107ef333f5dce7618e0f4c73d69ebc75eb5 (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/amd64')
-rw-r--r--sys/src/libc/amd64/main9p.s3
1 files changed, 0 insertions, 3 deletions
diff --git a/sys/src/libc/amd64/main9p.s b/sys/src/libc/amd64/main9p.s
index 353b18088..c1a8fac2b 100644
--- a/sys/src/libc/amd64/main9p.s
+++ b/sys/src/libc/amd64/main9p.s
@@ -28,9 +28,6 @@ TEXT _savearg(SB), 1, $0
RET
TEXT _saveret(SB), 1, $0
- RET
-
-TEXT _restorearg(SB), 1, $0
RET /* we want RARG in RARG */
TEXT _callpc(SB), 1, $0