aboutsummaryrefslogtreecommitdiff
path: root/lib/stop-other-threads.h
diff options
context:
space:
mode:
authorcomex2015-01-24 20:04:20 -0500
committercomex2015-01-24 20:06:46 -0500
commitd89af8f6d5f3b971dda663081c03d790437c2f03 (patch)
tree2c17f0247ff3eef7d4338cadb069b1334ba785c6 /lib/stop-other-threads.h
parentCurrent version of generic-dis-*, for posterity (I'm sure it'll need to be ch... (diff)
downloadsubstitute-d89af8f6d5f3b971dda663081c03d790437c2f03.tar.gz
Add function to deal with mprotecting RW and back. A bit more complex than the minimum would be...
(and minor build fixes)
Diffstat (limited to '')
-rw-r--r--lib/stop-other-threads.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/stop-other-threads.h b/lib/stop-other-threads.h
new file mode 100644
index 0000000..1f6e639
--- /dev/null
+++ b/lib/stop-other-threads.h
@@ -0,0 +1,9 @@
+#pragma once
+#include <stdint.h>
+
+/* Stop the world; return token to be used for applying PC patches and resuming. */
+int stop_other_threads(void **token_ptr);
+int apply_pc_patch_callback(void *token,
+ uintptr_t (*pc_patch_callback)(void *ctx, uintptr_t pc),
+ void *ctx);
+int resume_other_threads(void *token);