summaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux/tt.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/os-Linux/tt.c')
-rw-r--r--arch/um/os-Linux/tt.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/um/os-Linux/tt.c b/arch/um/os-Linux/tt.c
index 5b047ab8416a..a6db8877931a 100644
--- a/arch/um/os-Linux/tt.c
+++ b/arch/um/os-Linux/tt.c
@@ -36,6 +36,20 @@
#include "mode.h"
#include "tempfile.h"
+int protect_memory(unsigned long addr, unsigned long len, int r, int w, int x,
+ int must_succeed)
+{
+ int err;
+
+ err = os_protect_memory((void *) addr, len, r, w, x);
+ if(err < 0){
+ if(must_succeed)
+ panic("protect failed, err = %d", -err);
+ else return(err);
+ }
+ return(0);
+}
+
/*
*-------------------------
* only for tt mode (will be deleted in future...)