summaryrefslogtreecommitdiff
path: root/src/refresh/sw/x86/protect.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/refresh/sw/x86/protect.c')
-rw-r--r--src/refresh/sw/x86/protect.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/refresh/sw/x86/protect.c b/src/refresh/sw/x86/protect.c
deleted file mode 100644
index 969f2be..0000000
--- a/src/refresh/sw/x86/protect.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include "shared/shared.h"
-
-#ifdef _WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#else
-#include <unistd.h>
-#include <sys/mman.h>
-#endif
-
-/*
-================
-Sys_MakeCodeWriteable
-================
-*/
-void Sys_MakeCodeWriteable(uintptr_t start, size_t length)
-{
-#ifdef _WIN32
- DWORD unused;
-
- if (!VirtualProtect((LPVOID)start, length, PAGE_EXECUTE_READWRITE, &unused))
- Com_Error(ERR_FATAL, "Protection change failed");
-#else
- int psize = getpagesize();
- uintptr_t addr = (start & ~(psize - 1)) - psize;
-
- if (mprotect((void *)addr, length + start - addr + psize, PROT_READ | PROT_WRITE | PROT_EXEC))
- Com_Error(ERR_FATAL, "Protection change failed");
-#endif
-}
-