diff options
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/cpu/intel_cacheinfo.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce_amd.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/sys_i386_32.c | 185 | ||||
-rw-r--r-- | arch/x86/kernel/sys_x86_64.c | 12 | ||||
-rw-r--r-- | arch/x86/kernel/syscall_table_32.S | 4 |
6 files changed, 5 insertions, 201 deletions
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index eddb1bdd1b8f..b3eeb66c0a51 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c | |||
@@ -903,7 +903,7 @@ static ssize_t store(struct kobject *kobj, struct attribute *attr, | |||
903 | return ret; | 903 | return ret; |
904 | } | 904 | } |
905 | 905 | ||
906 | static struct sysfs_ops sysfs_ops = { | 906 | static const struct sysfs_ops sysfs_ops = { |
907 | .show = show, | 907 | .show = show, |
908 | .store = store, | 908 | .store = store, |
909 | }; | 909 | }; |
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index a8aacd4b513c..28cba46bf32c 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c | |||
@@ -2044,6 +2044,7 @@ static __init void mce_init_banks(void) | |||
2044 | struct mce_bank *b = &mce_banks[i]; | 2044 | struct mce_bank *b = &mce_banks[i]; |
2045 | struct sysdev_attribute *a = &b->attr; | 2045 | struct sysdev_attribute *a = &b->attr; |
2046 | 2046 | ||
2047 | sysfs_attr_init(&a->attr); | ||
2047 | a->attr.name = b->attrname; | 2048 | a->attr.name = b->attrname; |
2048 | snprintf(b->attrname, ATTR_LEN, "bank%d", i); | 2049 | snprintf(b->attrname, ATTR_LEN, "bank%d", i); |
2049 | 2050 | ||
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c index 83a3d1f4efca..cda932ca3ade 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c | |||
@@ -388,7 +388,7 @@ static ssize_t store(struct kobject *kobj, struct attribute *attr, | |||
388 | return ret; | 388 | return ret; |
389 | } | 389 | } |
390 | 390 | ||
391 | static struct sysfs_ops threshold_ops = { | 391 | static const struct sysfs_ops threshold_ops = { |
392 | .show = show, | 392 | .show = show, |
393 | .store = store, | 393 | .store = store, |
394 | }; | 394 | }; |
diff --git a/arch/x86/kernel/sys_i386_32.c b/arch/x86/kernel/sys_i386_32.c index dee1ff7cba58..196552bb412c 100644 --- a/arch/x86/kernel/sys_i386_32.c +++ b/arch/x86/kernel/sys_i386_32.c | |||
@@ -25,191 +25,6 @@ | |||
25 | #include <asm/syscalls.h> | 25 | #include <asm/syscalls.h> |
26 | 26 | ||
27 | /* | 27 | /* |
28 | * Perform the select(nd, in, out, ex, tv) and mmap() system | ||
29 | * calls. Linux/i386 didn't use to be able to handle more than | ||
30 | * 4 system call parameters, so these system calls used a memory | ||
31 | * block for parameter passing.. | ||
32 | */ | ||
33 | |||
34 | struct mmap_arg_struct { | ||
35 | unsigned long addr; | ||
36 | unsigned long len; | ||
37 | unsigned long prot; | ||
38 | unsigned long flags; | ||
39 | unsigned long fd; | ||
40 | unsigned long offset; | ||
41 | }; | ||
42 | |||
43 | asmlinkage int old_mmap(struct mmap_arg_struct __user *arg) | ||
44 | { | ||
45 | struct mmap_arg_struct a; | ||
46 | int err = -EFAULT; | ||
47 | |||
48 | if (copy_from_user(&a, arg, sizeof(a))) | ||
49 | goto out; | ||
50 | |||
51 | err = -EINVAL; | ||
52 | if (a.offset & ~PAGE_MASK) | ||
53 | goto out; | ||
54 | |||
55 | err = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, | ||
56 | a.fd, a.offset >> PAGE_SHIFT); | ||
57 | out: | ||
58 | return err; | ||
59 | } | ||
60 | |||
61 | |||
62 | struct sel_arg_struct { | ||
63 | unsigned long n; | ||
64 | fd_set __user *inp, *outp, *exp; | ||
65 | struct timeval __user *tvp; | ||
66 | }; | ||
67 | |||
68 | asmlinkage int old_select(struct sel_arg_struct __user *arg) | ||
69 | { | ||
70 | struct sel_arg_struct a; | ||
71 | |||
72 | if (copy_from_user(&a, arg, sizeof(a))) | ||
73 | return -EFAULT; | ||
74 | /* sys_select() does the appropriate kernel locking */ | ||
75 | return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp); | ||
76 | } | ||
77 | |||
78 | /* | ||
79 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. | ||
80 | * | ||
81 | * This is really horribly ugly. | ||
82 | */ | ||
83 | asmlinkage int sys_ipc(uint call, int first, int second, | ||
84 | int third, void __user *ptr, long fifth) | ||
85 | { | ||
86 | int version, ret; | ||
87 | |||
88 | version = call >> 16; /* hack for backward compatibility */ | ||
89 | call &= 0xffff; | ||
90 | |||
91 | switch (call) { | ||
92 | case SEMOP: | ||
93 | return sys_semtimedop(first, (struct sembuf __user *)ptr, second, NULL); | ||
94 | case SEMTIMEDOP: | ||
95 | return sys_semtimedop(first, (struct sembuf __user *)ptr, second, | ||
96 | (const struct timespec __user *)fifth); | ||
97 | |||
98 | case SEMGET: | ||
99 | return sys_semget(first, second, third); | ||
100 | case SEMCTL: { | ||
101 | union semun fourth; | ||
102 | if (!ptr) | ||
103 | return -EINVAL; | ||
104 | if (get_user(fourth.__pad, (void __user * __user *) ptr)) | ||
105 | return -EFAULT; | ||
106 | return sys_semctl(first, second, third, fourth); | ||
107 | } | ||
108 | |||
109 | case MSGSND: | ||
110 | return sys_msgsnd(first, (struct msgbuf __user *) ptr, | ||
111 | second, third); | ||
112 | case MSGRCV: | ||
113 | switch (version) { | ||
114 | case 0: { | ||
115 | struct ipc_kludge tmp; | ||
116 | if (!ptr) | ||
117 | return -EINVAL; | ||
118 | |||
119 | if (copy_from_user(&tmp, | ||
120 | (struct ipc_kludge __user *) ptr, | ||
121 | sizeof(tmp))) | ||
122 | return -EFAULT; | ||
123 | return sys_msgrcv(first, tmp.msgp, second, | ||
124 | tmp.msgtyp, third); | ||
125 | } | ||
126 | default: | ||
127 | return sys_msgrcv(first, | ||
128 | (struct msgbuf __user *) ptr, | ||
129 | second, fifth, third); | ||
130 | } | ||
131 | case MSGGET: | ||
132 | return sys_msgget((key_t) first, second); | ||
133 | case MSGCTL: | ||
134 | return sys_msgctl(first, second, (struct msqid_ds __user *) ptr); | ||
135 | |||
136 | case SHMAT: | ||
137 | switch (version) { | ||
138 | default: { | ||
139 | ulong raddr; | ||
140 | ret = do_shmat(first, (char __user *) ptr, second, &raddr); | ||
141 | if (ret) | ||
142 | return ret; | ||
143 | return put_user(raddr, (ulong __user *) third); | ||
144 | } | ||
145 | case 1: /* iBCS2 emulator entry point */ | ||
146 | if (!segment_eq(get_fs(), get_ds())) | ||
147 | return -EINVAL; | ||
148 | /* The "(ulong *) third" is valid _only_ because of the kernel segment thing */ | ||
149 | return do_shmat(first, (char __user *) ptr, second, (ulong *) third); | ||
150 | } | ||
151 | case SHMDT: | ||
152 | return sys_shmdt((char __user *)ptr); | ||
153 | case SHMGET: | ||
154 | return sys_shmget(first, second, third); | ||
155 | case SHMCTL: | ||
156 | return sys_shmctl(first, second, | ||
157 | (struct shmid_ds __user *) ptr); | ||
158 | default: | ||
159 | return -ENOSYS; | ||
160 | } | ||
161 | } | ||
162 | |||
163 | /* | ||
164 | * Old cruft | ||
165 | */ | ||
166 | asmlinkage int sys_uname(struct old_utsname __user *name) | ||
167 | { | ||
168 | int err; | ||
169 | if (!name) | ||
170 | return -EFAULT; | ||
171 | down_read(&uts_sem); | ||
172 | err = copy_to_user(name, utsname(), sizeof(*name)); | ||
173 | up_read(&uts_sem); | ||
174 | return err? -EFAULT:0; | ||
175 | } | ||
176 | |||
177 | asmlinkage int sys_olduname(struct oldold_utsname __user *name) | ||
178 | { | ||
179 | int error; | ||
180 | |||
181 | if (!name) | ||
182 | return -EFAULT; | ||
183 | if (!access_ok(VERIFY_WRITE, name, sizeof(struct oldold_utsname))) | ||
184 | return -EFAULT; | ||
185 | |||
186 | down_read(&uts_sem); | ||
187 | |||
188 | error = __copy_to_user(&name->sysname, &utsname()->sysname, | ||
189 | __OLD_UTS_LEN); | ||
190 | error |= __put_user(0, name->sysname + __OLD_UTS_LEN); | ||
191 | error |= __copy_to_user(&name->nodename, &utsname()->nodename, | ||
192 | __OLD_UTS_LEN); | ||
193 | error |= __put_user(0, name->nodename + __OLD_UTS_LEN); | ||
194 | error |= __copy_to_user(&name->release, &utsname()->release, | ||
195 | __OLD_UTS_LEN); | ||
196 | error |= __put_user(0, name->release + __OLD_UTS_LEN); | ||
197 | error |= __copy_to_user(&name->version, &utsname()->version, | ||
198 | __OLD_UTS_LEN); | ||
199 | error |= __put_user(0, name->version + __OLD_UTS_LEN); | ||
200 | error |= __copy_to_user(&name->machine, &utsname()->machine, | ||
201 | __OLD_UTS_LEN); | ||
202 | error |= __put_user(0, name->machine + __OLD_UTS_LEN); | ||
203 | |||
204 | up_read(&uts_sem); | ||
205 | |||
206 | error = error ? -EFAULT : 0; | ||
207 | |||
208 | return error; | ||
209 | } | ||
210 | |||
211 | |||
212 | /* | ||
213 | * Do a system call from kernel instead of calling sys_execve so we | 28 | * Do a system call from kernel instead of calling sys_execve so we |
214 | * end up with proper pt_regs. | 29 | * end up with proper pt_regs. |
215 | */ | 30 | */ |
diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c index 8aa2057efd12..ff14a5044ce6 100644 --- a/arch/x86/kernel/sys_x86_64.c +++ b/arch/x86/kernel/sys_x86_64.c | |||
@@ -209,15 +209,3 @@ bottomup: | |||
209 | 209 | ||
210 | return addr; | 210 | return addr; |
211 | } | 211 | } |
212 | |||
213 | |||
214 | SYSCALL_DEFINE1(uname, struct new_utsname __user *, name) | ||
215 | { | ||
216 | int err; | ||
217 | down_read(&uts_sem); | ||
218 | err = copy_to_user(name, utsname(), sizeof(*name)); | ||
219 | up_read(&uts_sem); | ||
220 | if (personality(current->personality) == PER_LINUX32) | ||
221 | err |= copy_to_user(&name->machine, "i686", 5); | ||
222 | return err ? -EFAULT : 0; | ||
223 | } | ||
diff --git a/arch/x86/kernel/syscall_table_32.S b/arch/x86/kernel/syscall_table_32.S index 15228b5d3eb7..8b3729341216 100644 --- a/arch/x86/kernel/syscall_table_32.S +++ b/arch/x86/kernel/syscall_table_32.S | |||
@@ -81,7 +81,7 @@ ENTRY(sys_call_table) | |||
81 | .long sys_settimeofday | 81 | .long sys_settimeofday |
82 | .long sys_getgroups16 /* 80 */ | 82 | .long sys_getgroups16 /* 80 */ |
83 | .long sys_setgroups16 | 83 | .long sys_setgroups16 |
84 | .long old_select | 84 | .long sys_old_select |
85 | .long sys_symlink | 85 | .long sys_symlink |
86 | .long sys_lstat | 86 | .long sys_lstat |
87 | .long sys_readlink /* 85 */ | 87 | .long sys_readlink /* 85 */ |
@@ -89,7 +89,7 @@ ENTRY(sys_call_table) | |||
89 | .long sys_swapon | 89 | .long sys_swapon |
90 | .long sys_reboot | 90 | .long sys_reboot |
91 | .long sys_old_readdir | 91 | .long sys_old_readdir |
92 | .long old_mmap /* 90 */ | 92 | .long sys_old_mmap /* 90 */ |
93 | .long sys_munmap | 93 | .long sys_munmap |
94 | .long sys_truncate | 94 | .long sys_truncate |
95 | .long sys_ftruncate | 95 | .long sys_ftruncate |