Skip to content
Unverified Commit 8eca2b7b authored by Chris Jones's avatar Chris Jones Committed by GitHub
Browse files

Add branch interception to VIXL simulator (#77)

* Add maybe_unused to runtime call arguments

Currently runtime calls cannot be done if the function to be called
has no parameters because the compiler will give a
"unused-but-set-parameter" warning which is treated as an error. Fix
this by always using the 'arguments' parameter.

Change-Id: I9f4b75ea8b6ae6fe03be33cefa45fa99f5485b7a

* Add branch interception to VIXL simulator

Simulated AARCH64 code, that is not written in using the
macroassembler, can branch (change the simulated PC) to arbitrary
function addresses. This works fine if that function is AARCH64
however if that function is a native (x86_64) C++ function then an
error (likely SIGILL) will be thrown. To handle this case we need to
"intercept" branches to these native (x86_64) C++ functions and
instead either perform a runtime call to the function or provide a
callback to manually handle the particular case.

Add a mechanism to intercept functions as they are branched to
within the VIXL simulator. This means that whenever a function X is
branched to (e.g: bl X) instead, if provided, a callback function Y
is called. If no callback is provided for the interception to
function X then a runtime call will be done on function X.

Branch interception objects consisting of the function to intercept:
X, and an optional callback function Y are stored within the
simulator and checked every unconditional branch to register.

Change-Id: I874a6fa5b8f0581fe930a7a98f762031bdb2f591
parent b13d3bf3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment