summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2024-08-08 12:59:49 +0100
committerTim-Philipp Müller <tim@centricular.com>2024-08-08 12:59:49 +0100
commit0dd9286b2a6a54b0b2ddde447181e24e534058df (patch)
tree27e0082fc6a13c99fd87c5823394206bcf94c1ac
parent15b940465362bd51f7fb3e721a57347e34d543ba (diff)
Revert "x86: Implement instruction cache flushing post-WX page protection"
This reverts commit ff6a3b9f53e643c9de74a8ad53b228c3c8120d6b. Part-of: <https://gitlab.freedesktop.org/gstreamer/orc/-/merge_requests/201>
-rw-r--r--orc/orcprogram-x86.c29
-rw-r--r--orc/orcutils.h4
2 files changed, 0 insertions, 33 deletions
diff --git a/orc/orcprogram-x86.c b/orc/orcprogram-x86.c
index 3aaf8d4..9e7242f 100644
--- a/orc/orcprogram-x86.c
+++ b/orc/orcprogram-x86.c
@@ -10,10 +10,6 @@
#include <orc/orcx86-private.h>
#include <orc/orcinternal.h>
-#if defined(_WIN32)
-#include <windows.h>
-#endif
-
#define ORC_X86_ALIGNED_DEST_CUTOFF 64
#define LABEL_REGION1_SKIP 1
#define LABEL_INNER_LOOP_START 2
@@ -1040,30 +1036,6 @@ orc_x86_compile (OrcCompiler *compiler)
orc_x86_do_fixups (compiler);
}
-static void
-orc_x86_flush_cache (OrcCode *code)
-{
-#if defined(__APPLE__)
- sys_dcache_flush(code->code, code->code_size);
- sys_icache_invalidate(code->exec, code->code_size);
-#elif defined (_WIN32)
- HANDLE h_proc = GetCurrentProcess();
-
- FlushInstructionCache(h_proc, code->code, code->code_size);
-
- if ((void *) code->exec != (void *) code->code)
- FlushInstructionCache(h_proc, code->exec, code->code_size);
-#elif __has_builtin(__builtin_clear_cache)
- __builtin_clear_cache (code->code, code->code + code->code_size);
- if ((void *) code->exec != (void *) code->code)
- __builtin_clear_cache (code->exec, code->exec + code->code_size);
-#else
- __clear_cache (code->code, code->code + code->code_size);
- if ((void *) code->exec != (void *) code->code)
- __clear_cache (code->exec, code->exec + code->code_size);
-#endif
-}
-
void
orc_x86_register_extension (OrcTarget *t, OrcX86Target *x86t)
{
@@ -1082,7 +1054,6 @@ orc_x86_register_extension (OrcTarget *t, OrcX86Target *x86t)
t->load_constant = orc_x86_load_constant;
t->get_flag_name = x86t->get_flag_name;
t->load_constant_long = x86t->load_constant_long;
- t->flush_cache = orc_x86_flush_cache;
t->target_data = x86t;
orc_target_register (t);
}
diff --git a/orc/orcutils.h b/orc/orcutils.h
index 7f8df35..f6c8a17 100644
--- a/orc/orcutils.h
+++ b/orc/orcutils.h
@@ -254,10 +254,6 @@ typedef unsigned int orc_bool;
#endif
#endif
-#ifndef __has_builtin
-#define __has_builtin(x) 0
-#endif
-
ORC_BEGIN_DECLS
#ifdef ORC_ENABLE_UNSTABLE_API