diff options
author | Emanuele Giuseppe Esposito | 2020-10-15 11:51:47 +0200 |
---|---|---|
committer | Peter Maydell | 2020-10-20 17:12:00 +0200 |
commit | a0c0c9f8b4093bf1564d705d8977b6ba46cd2f5a (patch) | |
tree | a7e5cbea2f94a3bc042c77a09816509f4a5093cf /docs | |
parent | tests/qtest: Add npcm7xx timer test (diff) | |
download | qemu-a0c0c9f8b4093bf1564d705d8977b6ba46cd2f5a.tar.gz qemu-a0c0c9f8b4093bf1564d705d8977b6ba46cd2f5a.tar.xz qemu-a0c0c9f8b4093bf1564d705d8977b6ba46cd2f5a.zip |
loads-stores.rst: add footnote that clarifies GETPC usage
Current documentation is not too clear on the GETPC usage.
In particular, when used outside the top level helper function
it causes unexpected behavior.
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Message-id: 20201015095147.1691-1-e.emanuelegiuseppe@gmail.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/devel/loads-stores.rst | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/docs/devel/loads-stores.rst b/docs/devel/loads-stores.rst index 9a944ef1af..59c1225391 100644 --- a/docs/devel/loads-stores.rst +++ b/docs/devel/loads-stores.rst @@ -93,7 +93,13 @@ guest CPU state in case of a guest CPU exception. This is passed to ``cpu_restore_state()``. Therefore the value should either be 0, to indicate that the guest CPU state is already synchronized, or the result of ``GETPC()`` from the top level ``HELPER(foo)`` -function, which is a return address into the generated code. +function, which is a return address into the generated code [#gpc]_. + +.. [#gpc] Note that ``GETPC()`` should be used with great care: calling + it in other functions that are *not* the top level + ``HELPER(foo)`` will cause unexpected behavior. Instead, the + value of ``GETPC()`` should be read from the helper and passed + if needed to the functions that the helper calls. Function names follow the pattern: |