aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/sys-i386
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-05-07 23:37:51 -0400
committerPaul Mackerras <paulus@samba.org>2007-05-07 23:37:51 -0400
commit02bbc0f09c90cefdb2837605c96a66c5ce4ba2e1 (patch)
tree04ef573cd4de095c500c9fc3477f4278c0b36300 /arch/um/sys-i386
parent7487a2245b8841c77ba9db406cf99a483b9334e9 (diff)
parent5b94f675f57e4ff16c8fda09088d7480a84dcd91 (diff)
Merge branch 'linux-2.6'
Diffstat (limited to 'arch/um/sys-i386')
-rw-r--r--arch/um/sys-i386/bugs.c78
-rw-r--r--arch/um/sys-i386/fault.c18
-rw-r--r--arch/um/sys-i386/ptrace_user.c17
-rw-r--r--arch/um/sys-i386/signal.c84
-rw-r--r--arch/um/sys-i386/tls.c11
-rw-r--r--arch/um/sys-i386/user-offsets.c10
6 files changed, 85 insertions, 133 deletions
diff --git a/arch/um/sys-i386/bugs.c b/arch/um/sys-i386/bugs.c
index f1bcd399ac90..0393e44813e7 100644
--- a/arch/um/sys-i386/bugs.c
+++ b/arch/um/sys-i386/bugs.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -13,7 +13,6 @@
13#include "sysdep/ptrace.h" 13#include "sysdep/ptrace.h"
14#include "task.h" 14#include "task.h"
15#include "os.h" 15#include "os.h"
16#include "user_util.h"
17 16
18#define MAXTOKEN 64 17#define MAXTOKEN 64
19 18
@@ -32,21 +31,21 @@ static char token(int fd, char *buf, int len, char stop)
32 n = os_read_file(fd, ptr, sizeof(*ptr)); 31 n = os_read_file(fd, ptr, sizeof(*ptr));
33 c = *ptr++; 32 c = *ptr++;
34 if(n != sizeof(*ptr)){ 33 if(n != sizeof(*ptr)){
35 if(n == 0) return(0); 34 if(n == 0)
35 return 0;
36 printk("Reading /proc/cpuinfo failed, err = %d\n", -n); 36 printk("Reading /proc/cpuinfo failed, err = %d\n", -n);
37 if(n < 0) 37 if(n < 0)
38 return(n); 38 return n;
39 else 39 else return -EIO;
40 return(-EIO);
41 } 40 }
42 } while((c != '\n') && (c != stop) && (ptr < end)); 41 } while((c != '\n') && (c != stop) && (ptr < end));
43 42
44 if(ptr == end){ 43 if(ptr == end){
45 printk("Failed to find '%c' in /proc/cpuinfo\n", stop); 44 printk("Failed to find '%c' in /proc/cpuinfo\n", stop);
46 return(-1); 45 return -1;
47 } 46 }
48 *(ptr - 1) = '\0'; 47 *(ptr - 1) = '\0';
49 return(c); 48 return c;
50} 49}
51 50
52static int find_cpuinfo_line(int fd, char *key, char *scratch, int len) 51static int find_cpuinfo_line(int fd, char *key, char *scratch, int len)
@@ -58,48 +57,25 @@ static int find_cpuinfo_line(int fd, char *key, char *scratch, int len)
58 while(1){ 57 while(1){
59 c = token(fd, scratch, len - 1, ':'); 58 c = token(fd, scratch, len - 1, ':');
60 if(c <= 0) 59 if(c <= 0)
61 return(0); 60 return 0;
62 else if(c != ':'){ 61 else if(c != ':'){
63 printk("Failed to find ':' in /proc/cpuinfo\n"); 62 printk("Failed to find ':' in /proc/cpuinfo\n");
64 return(0); 63 return 0;
65 } 64 }
66 65
67 if(!strncmp(scratch, key, strlen(key))) 66 if(!strncmp(scratch, key, strlen(key)))
68 return(1); 67 return 1;
69 68
70 do { 69 do {
71 n = os_read_file(fd, &c, sizeof(c)); 70 n = os_read_file(fd, &c, sizeof(c));
72 if(n != sizeof(c)){ 71 if(n != sizeof(c)){
73 printk("Failed to find newline in " 72 printk("Failed to find newline in "
74 "/proc/cpuinfo, err = %d\n", -n); 73 "/proc/cpuinfo, err = %d\n", -n);
75 return(0); 74 return 0;
76 } 75 }
77 } while(c != '\n'); 76 } while(c != '\n');
78 } 77 }
79 return(0); 78 return 0;
80}
81
82int cpu_feature(char *what, char *buf, int len)
83{
84 int fd, ret = 0;
85
86 fd = os_open_file("/proc/cpuinfo", of_read(OPENFLAGS()), 0);
87 if(fd < 0){
88 printk("Couldn't open /proc/cpuinfo, err = %d\n", -fd);
89 return(0);
90 }
91
92 if(!find_cpuinfo_line(fd, what, buf, len)){
93 printk("Couldn't find '%s' line in /proc/cpuinfo\n", what);
94 goto out_close;
95 }
96
97 token(fd, buf, len, '\n');
98 ret = 1;
99
100 out_close:
101 os_close_file(fd);
102 return(ret);
103} 79}
104 80
105static int check_cpu_flag(char *feature, int *have_it) 81static int check_cpu_flag(char *feature, int *have_it)
@@ -119,7 +95,8 @@ static int check_cpu_flag(char *feature, int *have_it)
119 goto out; 95 goto out;
120 96
121 c = token(fd, buf, len - 1, ' '); 97 c = token(fd, buf, len - 1, ' ');
122 if(c < 0) goto out; 98 if(c < 0)
99 goto out;
123 else if(c != ' '){ 100 else if(c != ' '){
124 printk("Failed to find ' ' in /proc/cpuinfo\n"); 101 printk("Failed to find ' ' in /proc/cpuinfo\n");
125 goto out; 102 goto out;
@@ -127,7 +104,8 @@ static int check_cpu_flag(char *feature, int *have_it)
127 104
128 while(1){ 105 while(1){
129 c = token(fd, buf, len - 1, ' '); 106 c = token(fd, buf, len - 1, ' ');
130 if(c < 0) goto out; 107 if(c < 0)
108 goto out;
131 else if(c == '\n') break; 109 else if(c == '\n') break;
132 110
133 if(!strcmp(buf, feature)){ 111 if(!strcmp(buf, feature)){
@@ -136,8 +114,10 @@ static int check_cpu_flag(char *feature, int *have_it)
136 } 114 }
137 } 115 }
138 out: 116 out:
139 if(*have_it == 0) printk("No\n"); 117 if(*have_it == 0)
140 else if(*have_it == 1) printk("Yes\n"); 118 printk("No\n");
119 else if(*have_it == 1)
120 printk("Yes\n");
141 os_close_file(fd); 121 os_close_file(fd);
142 return 1; 122 return 1;
143} 123}
@@ -189,12 +169,13 @@ int arch_handle_signal(int sig, union uml_pt_regs *regs)
189 /* This is testing for a cmov (0x0f 0x4x) instruction causing a 169 /* This is testing for a cmov (0x0f 0x4x) instruction causing a
190 * SIGILL in init. 170 * SIGILL in init.
191 */ 171 */
192 if((sig != SIGILL) || (TASK_PID(get_current()) != 1)) return(0); 172 if((sig != SIGILL) || (TASK_PID(get_current()) != 1))
173 return 0;
193 174
194 if (copy_from_user_proc(tmp, (void *) UPT_IP(regs), 2)) 175 if (copy_from_user_proc(tmp, (void *) UPT_IP(regs), 2))
195 panic("SIGILL in init, could not read instructions!\n"); 176 panic("SIGILL in init, could not read instructions!\n");
196 if((tmp[0] != 0x0f) || ((tmp[1] & 0xf0) != 0x40)) 177 if((tmp[0] != 0x0f) || ((tmp[1] & 0xf0) != 0x40))
197 return(0); 178 return 0;
198 179
199 if(host_has_cmov == 0) 180 if(host_has_cmov == 0)
200 panic("SIGILL caused by cmov, which this processor doesn't " 181 panic("SIGILL caused by cmov, which this processor doesn't "
@@ -208,16 +189,5 @@ int arch_handle_signal(int sig, union uml_pt_regs *regs)
208 "implements it, boot a filesystem compiled for older " 189 "implements it, boot a filesystem compiled for older "
209 "processors"); 190 "processors");
210 else panic("Bad value for host_has_cmov (%d)", host_has_cmov); 191 else panic("Bad value for host_has_cmov (%d)", host_has_cmov);
211 return(0); 192 return 0;
212} 193}
213
214/*
215 * Overrides for Emacs so that we follow Linus's tabbing style.
216 * Emacs will notice this stuff at the end of the file and automatically
217 * adjust the settings for this buffer only. This must remain at the end
218 * of the file.
219 * ---------------------------------------------------------------------------
220 * Local variables:
221 * c-file-style: "linux"
222 * End:
223 */
diff --git a/arch/um/sys-i386/fault.c b/arch/um/sys-i386/fault.c
index d0bbcdfdb53f..745b4fd49e9f 100644
--- a/arch/um/sys-i386/fault.c
+++ b/arch/um/sys-i386/fault.c
@@ -3,9 +3,7 @@
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#include <signal.h>
7#include "sysdep/ptrace.h" 6#include "sysdep/ptrace.h"
8#include "sysdep/sigcontext.h"
9 7
10/* These two are from asm-um/uaccess.h and linux/module.h, check them. */ 8/* These two are from asm-um/uaccess.h and linux/module.h, check them. */
11struct exception_table_entry 9struct exception_table_entry
@@ -17,26 +15,14 @@ struct exception_table_entry
17const struct exception_table_entry *search_exception_tables(unsigned long add); 15const struct exception_table_entry *search_exception_tables(unsigned long add);
18 16
19/* Compare this to arch/i386/mm/extable.c:fixup_exception() */ 17/* Compare this to arch/i386/mm/extable.c:fixup_exception() */
20int arch_fixup(unsigned long address, void *sc_ptr) 18int arch_fixup(unsigned long address, union uml_pt_regs *regs)
21{ 19{
22 struct sigcontext *sc = sc_ptr;
23 const struct exception_table_entry *fixup; 20 const struct exception_table_entry *fixup;
24 21
25 fixup = search_exception_tables(address); 22 fixup = search_exception_tables(address);
26 if(fixup != 0){ 23 if(fixup != 0){
27 sc->eip = fixup->fixup; 24 UPT_IP(regs) = fixup->fixup;
28 return(1); 25 return(1);
29 } 26 }
30 return(0); 27 return(0);
31} 28}
32
33/*
34 * Overrides for Emacs so that we follow Linus's tabbing style.
35 * Emacs will notice this stuff at the end of the file and automatically
36 * adjust the settings for this buffer only. This must remain at the end
37 * of the file.
38 * ---------------------------------------------------------------------------
39 * Local variables:
40 * c-file-style: "linux"
41 * End:
42 */
diff --git a/arch/um/sys-i386/ptrace_user.c b/arch/um/sys-i386/ptrace_user.c
index 01212c88fcc4..40ff0c831bd0 100644
--- a/arch/um/sys-i386/ptrace_user.c
+++ b/arch/um/sys-i386/ptrace_user.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -15,7 +15,6 @@
15#include "user.h" 15#include "user.h"
16#include "os.h" 16#include "os.h"
17#include "uml-config.h" 17#include "uml-config.h"
18#include "user_util.h"
19 18
20int ptrace_getregs(long pid, unsigned long *regs_out) 19int ptrace_getregs(long pid, unsigned long *regs_out)
21{ 20{
@@ -45,7 +44,8 @@ int ptrace_setfpregs(long pid, unsigned long *regs)
45 return 0; 44 return 0;
46} 45}
47 46
48/* All the below stuff is of interest for TT mode only */ 47#ifdef UML_CONFIG_MODE_TT
48
49static void write_debugregs(int pid, unsigned long *regs) 49static void write_debugregs(int pid, unsigned long *regs)
50{ 50{
51 struct user *dummy; 51 struct user *dummy;
@@ -128,13 +128,4 @@ void update_debugregs(int seq)
128} 128}
129#endif 129#endif
130 130
131/* 131#endif
132 * Overrides for Emacs so that we follow Linus's tabbing style.
133 * Emacs will notice this stuff at the end of the file and automatically
134 * adjust the settings for this buffer only. This must remain at the end
135 * of the file.
136 * ---------------------------------------------------------------------------
137 * Local variables:
138 * c-file-style: "linux"
139 * End:
140 */
diff --git a/arch/um/sys-i386/signal.c b/arch/um/sys-i386/signal.c
index 3f6acd667717..1cbf95f6858a 100644
--- a/arch/um/sys-i386/signal.c
+++ b/arch/um/sys-i386/signal.c
@@ -18,6 +18,28 @@
18 18
19#include "skas.h" 19#include "skas.h"
20 20
21void copy_sc(union uml_pt_regs *regs, void *from)
22{
23 struct sigcontext *sc = from;
24
25 REGS_GS(regs->skas.regs) = sc->gs;
26 REGS_FS(regs->skas.regs) = sc->fs;
27 REGS_ES(regs->skas.regs) = sc->es;
28 REGS_DS(regs->skas.regs) = sc->ds;
29 REGS_EDI(regs->skas.regs) = sc->edi;
30 REGS_ESI(regs->skas.regs) = sc->esi;
31 REGS_EBP(regs->skas.regs) = sc->ebp;
32 REGS_SP(regs->skas.regs) = sc->esp;
33 REGS_EBX(regs->skas.regs) = sc->ebx;
34 REGS_EDX(regs->skas.regs) = sc->edx;
35 REGS_ECX(regs->skas.regs) = sc->ecx;
36 REGS_EAX(regs->skas.regs) = sc->eax;
37 REGS_IP(regs->skas.regs) = sc->eip;
38 REGS_CS(regs->skas.regs) = sc->cs;
39 REGS_EFLAGS(regs->skas.regs) = sc->eflags;
40 REGS_SS(regs->skas.regs) = sc->ss;
41}
42
21static int copy_sc_from_user_skas(struct pt_regs *regs, 43static int copy_sc_from_user_skas(struct pt_regs *regs,
22 struct sigcontext __user *from) 44 struct sigcontext __user *from)
23{ 45{
@@ -28,33 +50,18 @@ static int copy_sc_from_user_skas(struct pt_regs *regs,
28 err = copy_from_user(&sc, from, sizeof(sc)); 50 err = copy_from_user(&sc, from, sizeof(sc));
29 err |= copy_from_user(fpregs, sc.fpstate, sizeof(fpregs)); 51 err |= copy_from_user(fpregs, sc.fpstate, sizeof(fpregs));
30 if(err) 52 if(err)
31 return(err); 53 return err;
32 54
33 REGS_GS(regs->regs.skas.regs) = sc.gs; 55 copy_sc(&regs->regs, &sc);
34 REGS_FS(regs->regs.skas.regs) = sc.fs;
35 REGS_ES(regs->regs.skas.regs) = sc.es;
36 REGS_DS(regs->regs.skas.regs) = sc.ds;
37 REGS_EDI(regs->regs.skas.regs) = sc.edi;
38 REGS_ESI(regs->regs.skas.regs) = sc.esi;
39 REGS_EBP(regs->regs.skas.regs) = sc.ebp;
40 REGS_SP(regs->regs.skas.regs) = sc.esp;
41 REGS_EBX(regs->regs.skas.regs) = sc.ebx;
42 REGS_EDX(regs->regs.skas.regs) = sc.edx;
43 REGS_ECX(regs->regs.skas.regs) = sc.ecx;
44 REGS_EAX(regs->regs.skas.regs) = sc.eax;
45 REGS_IP(regs->regs.skas.regs) = sc.eip;
46 REGS_CS(regs->regs.skas.regs) = sc.cs;
47 REGS_EFLAGS(regs->regs.skas.regs) = sc.eflags;
48 REGS_SS(regs->regs.skas.regs) = sc.ss;
49 56
50 err = restore_fp_registers(userspace_pid[0], fpregs); 57 err = restore_fp_registers(userspace_pid[0], fpregs);
51 if(err < 0){ 58 if(err < 0) {
52 printk("copy_sc_from_user_skas - PTRACE_SETFPREGS failed, " 59 printk("copy_sc_from_user_skas - PTRACE_SETFPREGS failed, "
53 "errno = %d\n", err); 60 "errno = %d\n", -err);
54 return(1); 61 return err;
55 } 62 }
56 63
57 return(0); 64 return 0;
58} 65}
59 66
60int copy_sc_to_user_skas(struct sigcontext __user *to, struct _fpstate __user *to_fp, 67int copy_sc_to_user_skas(struct sigcontext __user *to, struct _fpstate __user *to_fp,
@@ -90,16 +97,16 @@ int copy_sc_to_user_skas(struct sigcontext __user *to, struct _fpstate __user *t
90 if(err < 0){ 97 if(err < 0){
91 printk("copy_sc_to_user_skas - PTRACE_GETFPREGS failed, " 98 printk("copy_sc_to_user_skas - PTRACE_GETFPREGS failed, "
92 "errno = %d\n", err); 99 "errno = %d\n", err);
93 return(1); 100 return 1;
94 } 101 }
95 to_fp = (to_fp ? to_fp : (struct _fpstate __user *) (to + 1)); 102 to_fp = (to_fp ? to_fp : (struct _fpstate __user *) (to + 1));
96 sc.fpstate = to_fp; 103 sc.fpstate = to_fp;
97 104
98 if(err) 105 if(err)
99 return(err); 106 return err;
100 107
101 return(copy_to_user(to, &sc, sizeof(sc)) || 108 return copy_to_user(to, &sc, sizeof(sc)) ||
102 copy_to_user(to_fp, fpregs, sizeof(fpregs))); 109 copy_to_user(to_fp, fpregs, sizeof(fpregs));
103} 110}
104#endif 111#endif
105 112
@@ -129,7 +136,7 @@ int copy_sc_from_user_tt(struct sigcontext *to, struct sigcontext __user *from,
129 to->fpstate = to_fp; 136 to->fpstate = to_fp;
130 if(to_fp != NULL) 137 if(to_fp != NULL)
131 err |= copy_from_user(to_fp, from_fp, fpsize); 138 err |= copy_from_user(to_fp, from_fp, fpsize);
132 return(err); 139 return err;
133} 140}
134 141
135int copy_sc_to_user_tt(struct sigcontext __user *to, struct _fpstate __user *fp, 142int copy_sc_to_user_tt(struct sigcontext __user *to, struct _fpstate __user *fp,
@@ -164,15 +171,15 @@ static int copy_sc_from_user(struct pt_regs *to, void __user *from)
164 ret = CHOOSE_MODE(copy_sc_from_user_tt(UPT_SC(&to->regs), from, 171 ret = CHOOSE_MODE(copy_sc_from_user_tt(UPT_SC(&to->regs), from,
165 sizeof(struct _fpstate)), 172 sizeof(struct _fpstate)),
166 copy_sc_from_user_skas(to, from)); 173 copy_sc_from_user_skas(to, from));
167 return(ret); 174 return ret;
168} 175}
169 176
170static int copy_sc_to_user(struct sigcontext __user *to, struct _fpstate __user *fp, 177static int copy_sc_to_user(struct sigcontext __user *to, struct _fpstate __user *fp,
171 struct pt_regs *from, unsigned long sp) 178 struct pt_regs *from, unsigned long sp)
172{ 179{
173 return(CHOOSE_MODE(copy_sc_to_user_tt(to, fp, UPT_SC(&from->regs), 180 return CHOOSE_MODE(copy_sc_to_user_tt(to, fp, UPT_SC(&from->regs),
174 sizeof(*fp), sp), 181 sizeof(*fp), sp),
175 copy_sc_to_user_skas(to, fp, from, sp))); 182 copy_sc_to_user_skas(to, fp, from, sp));
176} 183}
177 184
178static int copy_ucontext_to_user(struct ucontext __user *uc, struct _fpstate __user *fp, 185static int copy_ucontext_to_user(struct ucontext __user *uc, struct _fpstate __user *fp,
@@ -185,7 +192,7 @@ static int copy_ucontext_to_user(struct ucontext __user *uc, struct _fpstate __u
185 err |= put_user(current->sas_ss_size, &uc->uc_stack.ss_size); 192 err |= put_user(current->sas_ss_size, &uc->uc_stack.ss_size);
186 err |= copy_sc_to_user(&uc->uc_mcontext, fp, &current->thread.regs, sp); 193 err |= copy_sc_to_user(&uc->uc_mcontext, fp, &current->thread.regs, sp);
187 err |= copy_to_user(&uc->uc_sigmask, set, sizeof(*set)); 194 err |= copy_to_user(&uc->uc_sigmask, set, sizeof(*set));
188 return(err); 195 return err;
189} 196}
190 197
191struct sigframe 198struct sigframe
@@ -359,7 +366,7 @@ long sys_sigreturn(struct pt_regs regs)
359 366
360 /* Avoid ERESTART handling */ 367 /* Avoid ERESTART handling */
361 PT_REGS_SYSCALL_NR(&current->thread.regs) = -1; 368 PT_REGS_SYSCALL_NR(&current->thread.regs) = -1;
362 return(PT_REGS_SYSCALL_RET(&current->thread.regs)); 369 return PT_REGS_SYSCALL_RET(&current->thread.regs);
363 370
364 segfault: 371 segfault:
365 force_sig(SIGSEGV, current); 372 force_sig(SIGSEGV, current);
@@ -389,20 +396,9 @@ long sys_rt_sigreturn(struct pt_regs regs)
389 396
390 /* Avoid ERESTART handling */ 397 /* Avoid ERESTART handling */
391 PT_REGS_SYSCALL_NR(&current->thread.regs) = -1; 398 PT_REGS_SYSCALL_NR(&current->thread.regs) = -1;
392 return(PT_REGS_SYSCALL_RET(&current->thread.regs)); 399 return PT_REGS_SYSCALL_RET(&current->thread.regs);
393 400
394 segfault: 401 segfault:
395 force_sig(SIGSEGV, current); 402 force_sig(SIGSEGV, current);
396 return 0; 403 return 0;
397} 404}
398
399/*
400 * Overrides for Emacs so that we follow Linus's tabbing style.
401 * Emacs will notice this stuff at the end of the file and automatically
402 * adjust the settings for this buffer only. This must remain at the end
403 * of the file.
404 * ---------------------------------------------------------------------------
405 * Local variables:
406 * c-file-style: "linux"
407 * End:
408 */
diff --git a/arch/um/sys-i386/tls.c b/arch/um/sys-i386/tls.c
index 643dab585727..fea8e5e15cc4 100644
--- a/arch/um/sys-i386/tls.c
+++ b/arch/um/sys-i386/tls.c
@@ -23,9 +23,13 @@
23#include "skas.h" 23#include "skas.h"
24#endif 24#endif
25 25
26/* If needed we can detect when it's uninitialized. */ 26/*
27 * If needed we can detect when it's uninitialized.
28 *
29 * These are initialized in an initcall and unchanged thereafter.
30 */
27static int host_supports_tls = -1; 31static int host_supports_tls = -1;
28int host_gdt_entry_tls_min = -1; 32int host_gdt_entry_tls_min;
29 33
30#ifdef CONFIG_MODE_SKAS 34#ifdef CONFIG_MODE_SKAS
31int do_set_thread_area_skas(struct user_desc *info) 35int do_set_thread_area_skas(struct user_desc *info)
@@ -361,7 +365,8 @@ out:
361 365
362/* XXX: This part is probably common to i386 and x86-64. Don't create a common 366/* XXX: This part is probably common to i386 and x86-64. Don't create a common
363 * file for now, do that when implementing x86-64 support.*/ 367 * file for now, do that when implementing x86-64 support.*/
364static int __init __setup_host_supports_tls(void) { 368static int __init __setup_host_supports_tls(void)
369{
365 check_host_supports_tls(&host_supports_tls, &host_gdt_entry_tls_min); 370 check_host_supports_tls(&host_supports_tls, &host_gdt_entry_tls_min);
366 if (host_supports_tls) { 371 if (host_supports_tls) {
367 printk(KERN_INFO "Host TLS support detected\n"); 372 printk(KERN_INFO "Host TLS support detected\n");
diff --git a/arch/um/sys-i386/user-offsets.c b/arch/um/sys-i386/user-offsets.c
index 447306b20aea..29118cf5ff25 100644
--- a/arch/um/sys-i386/user-offsets.c
+++ b/arch/um/sys-i386/user-offsets.c
@@ -1,9 +1,10 @@
1#include <stdio.h> 1#include <stdio.h>
2#include <stddef.h>
2#include <signal.h> 3#include <signal.h>
4#include <sys/poll.h>
5#include <sys/mman.h>
3#include <asm/ptrace.h> 6#include <asm/ptrace.h>
4#include <asm/user.h> 7#include <asm/user.h>
5#include <stddef.h>
6#include <sys/poll.h>
7 8
8#define DEFINE(sym, val) \ 9#define DEFINE(sym, val) \
9 asm volatile("\n->" #sym " %0 " #val : : "i" (val)) 10 asm volatile("\n->" #sym " %0 " #val : : "i" (val))
@@ -47,7 +48,6 @@ void foo(void)
47 OFFSET(HOST_SC_FP_ST, _fpstate, _st); 48 OFFSET(HOST_SC_FP_ST, _fpstate, _st);
48 OFFSET(HOST_SC_FXSR_ENV, _fpstate, _fxsr_env); 49 OFFSET(HOST_SC_FXSR_ENV, _fpstate, _fxsr_env);
49 50
50 DEFINE(HOST_FRAME_SIZE, FRAME_SIZE);
51 DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_i387_struct)); 51 DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_i387_struct));
52 DEFINE_LONGS(HOST_XFP_SIZE, sizeof(struct user_fxsr_struct)); 52 DEFINE_LONGS(HOST_XFP_SIZE, sizeof(struct user_fxsr_struct));
53 53
@@ -73,4 +73,8 @@ void foo(void)
73 DEFINE(UM_POLLIN, POLLIN); 73 DEFINE(UM_POLLIN, POLLIN);
74 DEFINE(UM_POLLPRI, POLLPRI); 74 DEFINE(UM_POLLPRI, POLLPRI);
75 DEFINE(UM_POLLOUT, POLLOUT); 75 DEFINE(UM_POLLOUT, POLLOUT);
76
77 DEFINE(UM_PROT_READ, PROT_READ);
78 DEFINE(UM_PROT_WRITE, PROT_WRITE);
79 DEFINE(UM_PROT_EXEC, PROT_EXEC);
76} 80}