aboutsummaryrefslogtreecommitdiff
path: root/lib/hook-functions.c
diff options
context:
space:
mode:
authorcomex2015-07-16 00:55:19 -0400
committercomex2015-07-16 00:55:19 -0400
commitdfd16cc1f759a103707ebd27743abc621486e131 (patch)
treee3ef16871039acb735bbf4179d299e8d8ea7d5a1 /lib/hook-functions.c
parentwork around (incorrect, since it's not code) alignment warning (diff)
downloadsubstitute-dfd16cc1f759a103707ebd27743abc621486e131.tar.gz
style police
Diffstat (limited to '')
-rw-r--r--lib/hook-functions.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/hook-functions.c b/lib/hook-functions.c
index ee3d049..fed9e3e 100644
--- a/lib/hook-functions.c
+++ b/lib/hook-functions.c
@@ -82,9 +82,11 @@ static int check_intro_trampoline(void **trampoline_ptr_p,
if (trampoline_ptr) {
/* Try existing trampoline */
- *patch_size_p = jump_patch_size(pc, (uintptr_t) trampoline_ptr, arch, false);
+ *patch_size_p = jump_patch_size(pc, (uintptr_t) trampoline_ptr, arch,
+ false);
- if (*patch_size_p != -1 && (size_t) *patch_size_p <= *trampoline_size_left_p)
+ if (*patch_size_p != -1 && (size_t) *patch_size_p
+ <= *trampoline_size_left_p)
return SUBSTITUTE_OK;
}
@@ -92,7 +94,8 @@ static int check_intro_trampoline(void **trampoline_ptr_p,
* before pc before giving up. */
int ret = execmem_alloc_unsealed(pc, &trampoline_ptr, &trampoline_size_left);
if (!ret) {
- *patch_size_p = jump_patch_size(pc, (uintptr_t) trampoline_ptr, arch, false);
+ *patch_size_p = jump_patch_size(pc, (uintptr_t) trampoline_ptr, arch,
+ false);
if (*patch_size_p != -1) {
ret = SUBSTITUTE_OK;
goto end;
@@ -103,9 +106,11 @@ static int check_intro_trampoline(void **trampoline_ptr_p,
/* Allocate new trampoline - try before pc (xxx only meaningful on arm64) */
uintptr_t start_address = pc - 0x80000000;
- ret = execmem_alloc_unsealed(start_address, &trampoline_ptr, &trampoline_size_left);
+ ret = execmem_alloc_unsealed(start_address,
+ &trampoline_ptr, &trampoline_size_left);
if (!ret) {
- *patch_size_p = jump_patch_size(pc, (uintptr_t) trampoline_ptr, arch, false);
+ *patch_size_p = jump_patch_size(pc, (uintptr_t) trampoline_ptr, arch,
+ false);
if (*patch_size_p != -1) {
*trampoline_ptr_p = trampoline_ptr;
*trampoline_size_left_p = trampoline_size_left;
@@ -172,7 +177,8 @@ int substitute_hook_functions(const struct substitute_function_hook *hooks,
int patch_size;
bool need_intro_trampoline;
if ((ret = check_intro_trampoline(&trampoline_ptr, &trampoline_size_left,
- pc_patch_start, (uintptr_t) hook->replacement,
+ pc_patch_start,
+ (uintptr_t) hook->replacement,
&patch_size, &need_intro_trampoline,
&hi->trampoline_page, arch)))
goto end;