aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/os-Linux/util.c')
-rw-r--r--arch/um/os-Linux/util.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/arch/um/os-Linux/util.c b/arch/um/os-Linux/util.c
index c307a89ed259..7cbcf484e13d 100644
--- a/arch/um/os-Linux/util.c
+++ b/arch/um/os-Linux/util.c
@@ -33,25 +33,8 @@
33 33
34void stack_protections(unsigned long address) 34void stack_protections(unsigned long address)
35{ 35{
36 int prot = PROT_READ | PROT_WRITE | PROT_EXEC; 36 if(mprotect((void *) address, UM_THREAD_SIZE,
37 37 PROT_READ | PROT_WRITE | PROT_EXEC) < 0)
38 if(mprotect((void *) address, UM_KERN_PAGE_SIZE, prot) < 0)
39 panic("protecting stack failed, errno = %d", errno);
40}
41
42void task_protections(unsigned long address)
43{
44 unsigned long guard = address + UM_KERN_PAGE_SIZE;
45 unsigned long stack = guard + UM_KERN_PAGE_SIZE;
46 int prot = 0, pages;
47
48#ifdef notdef
49 if(mprotect((void *) stack, UM_KERN_PAGE_SIZE, prot) < 0)
50 panic("protecting guard page failed, errno = %d", errno);
51#endif
52 pages = (1 << UML_CONFIG_KERNEL_STACK_ORDER) - 2;
53 prot = PROT_READ | PROT_WRITE | PROT_EXEC;
54 if(mprotect((void *) stack, pages * UM_KERN_PAGE_SIZE, prot) < 0)
55 panic("protecting stack failed, errno = %d", errno); 38 panic("protecting stack failed, errno = %d", errno);
56} 39}
57 40
@@ -72,7 +55,7 @@ int raw(int fd)
72 55
73 /* XXX tcsetattr could have applied only some changes 56 /* XXX tcsetattr could have applied only some changes
74 * (and cfmakeraw() is a set of changes) */ 57 * (and cfmakeraw() is a set of changes) */
75 return(0); 58 return 0;
76} 59}
77 60
78void setup_machinename(char *machine_out) 61void setup_machinename(char *machine_out)