diff options
author | Tony Luck <tony.luck@intel.com> | 2005-05-09 19:44:53 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-05-09 19:44:53 -0400 |
commit | a84f5770170232a48e753e02ee5f0f17ee17b791 (patch) | |
tree | 4efbd8a990df4437fb178c8a705dadc36812f98a | |
parent | 66302f211a21bb9439a2ae7f7b6a4c386bb10ecd (diff) | |
parent | 88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff) |
Merge with /home/aegl/GIT/linus
44 files changed, 288 insertions, 360 deletions
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 12 | 3 | SUBLEVEL = 12 |
4 | EXTRAVERSION =-rc3 | 4 | EXTRAVERSION =-rc4 |
5 | NAME=Woozy Numbat | 5 | NAME=Woozy Numbat |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index 53eb5cfd5b63..848bb97af7ca 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c | |||
@@ -650,7 +650,7 @@ acpi_find_rsdp (void) | |||
650 | */ | 650 | */ |
651 | rsdp_phys = acpi_scan_rsdp (0, 0x400); | 651 | rsdp_phys = acpi_scan_rsdp (0, 0x400); |
652 | if (!rsdp_phys) | 652 | if (!rsdp_phys) |
653 | rsdp_phys = acpi_scan_rsdp (0xE0000, 0xFFFFF); | 653 | rsdp_phys = acpi_scan_rsdp (0xE0000, 0x20000); |
654 | 654 | ||
655 | return rsdp_phys; | 655 | return rsdp_phys; |
656 | } | 656 | } |
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig index d0d94e56b90b..600f23d7fd33 100644 --- a/arch/ppc/Kconfig +++ b/arch/ppc/Kconfig | |||
@@ -77,9 +77,11 @@ config 44x | |||
77 | bool "44x" | 77 | bool "44x" |
78 | 78 | ||
79 | config POWER3 | 79 | config POWER3 |
80 | select PPC_FPU | ||
80 | bool "POWER3" | 81 | bool "POWER3" |
81 | 82 | ||
82 | config POWER4 | 83 | config POWER4 |
84 | select PPC_FPU | ||
83 | bool "POWER4 and 970 (G5)" | 85 | bool "POWER4 and 970 (G5)" |
84 | 86 | ||
85 | config 8xx | 87 | config 8xx |
diff --git a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig index 257ff66d83cf..5cb343883e4d 100644 --- a/arch/ppc64/Kconfig +++ b/arch/ppc64/Kconfig | |||
@@ -262,6 +262,7 @@ config PPC_RTAS | |||
262 | config RTAS_PROC | 262 | config RTAS_PROC |
263 | bool "Proc interface to RTAS" | 263 | bool "Proc interface to RTAS" |
264 | depends on PPC_RTAS | 264 | depends on PPC_RTAS |
265 | default y | ||
265 | 266 | ||
266 | config RTAS_FLASH | 267 | config RTAS_FLASH |
267 | tristate "Firmware flash interface" | 268 | tristate "Firmware flash interface" |
diff --git a/arch/um/include/user_util.h b/arch/um/include/user_util.h index 103cd320386c..b8c5b8a95250 100644 --- a/arch/um/include/user_util.h +++ b/arch/um/include/user_util.h | |||
@@ -67,7 +67,6 @@ extern void *um_kmalloc(int size); | |||
67 | extern int switcheroo(int fd, int prot, void *from, void *to, int size); | 67 | extern int switcheroo(int fd, int prot, void *from, void *to, int size); |
68 | extern void setup_machinename(char *machine_out); | 68 | extern void setup_machinename(char *machine_out); |
69 | extern void setup_hostinfo(void); | 69 | extern void setup_hostinfo(void); |
70 | extern void add_arg(char *arg); | ||
71 | extern void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)); | 70 | extern void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)); |
72 | extern void init_new_thread_signals(int altstack); | 71 | extern void init_new_thread_signals(int altstack); |
73 | extern void do_exec(int old_pid, int new_pid); | 72 | extern void do_exec(int old_pid, int new_pid); |
diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile index dca654263857..9736ca27c5f0 100644 --- a/arch/um/kernel/Makefile +++ b/arch/um/kernel/Makefile | |||
@@ -23,14 +23,10 @@ obj-$(CONFIG_SYSCALL_DEBUG) += syscall_user.o | |||
23 | obj-$(CONFIG_MODE_TT) += tt/ | 23 | obj-$(CONFIG_MODE_TT) += tt/ |
24 | obj-$(CONFIG_MODE_SKAS) += skas/ | 24 | obj-$(CONFIG_MODE_SKAS) += skas/ |
25 | 25 | ||
26 | # This needs be compiled with frame pointers regardless of how the rest of the | ||
27 | # kernel is built. | ||
28 | CFLAGS_frame.o := -fno-omit-frame-pointer | ||
29 | |||
30 | user-objs-$(CONFIG_TTY_LOG) += tty_log.o | 26 | user-objs-$(CONFIG_TTY_LOG) += tty_log.o |
31 | 27 | ||
32 | USER_OBJS := $(user-objs-y) config.o helper.o main.o process.o tempfile.o \ | 28 | USER_OBJS := $(user-objs-y) config.o helper.o main.o process.o tempfile.o \ |
33 | time.o tty_log.o umid.o user_util.o frame.o | 29 | time.o tty_log.o umid.o user_util.o |
34 | 30 | ||
35 | include arch/um/scripts/Makefile.rules | 31 | include arch/um/scripts/Makefile.rules |
36 | 32 | ||
diff --git a/arch/um/kernel/process_kern.c b/arch/um/kernel/process_kern.c index 7a943696f950..c1adf7ba3fd1 100644 --- a/arch/um/kernel/process_kern.c +++ b/arch/um/kernel/process_kern.c | |||
@@ -115,16 +115,6 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) | |||
115 | return(pid); | 115 | return(pid); |
116 | } | 116 | } |
117 | 117 | ||
118 | void switch_mm(struct mm_struct *prev, struct mm_struct *next, | ||
119 | struct task_struct *tsk) | ||
120 | { | ||
121 | int cpu = smp_processor_id(); | ||
122 | |||
123 | if (prev != next) | ||
124 | cpu_clear(cpu, prev->cpu_vm_mask); | ||
125 | cpu_set(cpu, next->cpu_vm_mask); | ||
126 | } | ||
127 | |||
128 | void set_current(void *t) | 118 | void set_current(void *t) |
129 | { | 119 | { |
130 | struct task_struct *task = t; | 120 | struct task_struct *task = t; |
@@ -152,7 +142,6 @@ void release_thread(struct task_struct *task) | |||
152 | 142 | ||
153 | void exit_thread(void) | 143 | void exit_thread(void) |
154 | { | 144 | { |
155 | CHOOSE_MODE(exit_thread_tt(), exit_thread_skas()); | ||
156 | unprotect_stack((unsigned long) current_thread); | 145 | unprotect_stack((unsigned long) current_thread); |
157 | } | 146 | } |
158 | 147 | ||
@@ -476,12 +465,21 @@ int singlestepping(void * t) | |||
476 | return 2; | 465 | return 2; |
477 | } | 466 | } |
478 | 467 | ||
468 | /* | ||
469 | * Only x86 and x86_64 have an arch_align_stack(). | ||
470 | * All other arches have "#define arch_align_stack(x) (x)" | ||
471 | * in their asm/system.h | ||
472 | * As this is included in UML from asm-um/system-generic.h, | ||
473 | * we can use it to behave as the subarch does. | ||
474 | */ | ||
475 | #ifndef arch_align_stack | ||
479 | unsigned long arch_align_stack(unsigned long sp) | 476 | unsigned long arch_align_stack(unsigned long sp) |
480 | { | 477 | { |
481 | if (randomize_va_space) | 478 | if (randomize_va_space) |
482 | sp -= get_random_int() % 8192; | 479 | sp -= get_random_int() % 8192; |
483 | return sp & ~0xf; | 480 | return sp & ~0xf; |
484 | } | 481 | } |
482 | #endif | ||
485 | 483 | ||
486 | 484 | ||
487 | /* | 485 | /* |
diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c index 3efa59a941a4..2b75d8d9ba73 100644 --- a/arch/um/kernel/ptrace.c +++ b/arch/um/kernel/ptrace.c | |||
@@ -19,15 +19,30 @@ | |||
19 | #include "skas_ptrace.h" | 19 | #include "skas_ptrace.h" |
20 | #include "sysdep/ptrace.h" | 20 | #include "sysdep/ptrace.h" |
21 | 21 | ||
22 | static inline void set_singlestepping(struct task_struct *child, int on) | ||
23 | { | ||
24 | if (on) | ||
25 | child->ptrace |= PT_DTRACE; | ||
26 | else | ||
27 | child->ptrace &= ~PT_DTRACE; | ||
28 | child->thread.singlestep_syscall = 0; | ||
29 | |||
30 | #ifdef SUBARCH_SET_SINGLESTEPPING | ||
31 | SUBARCH_SET_SINGLESTEPPING(child, on) | ||
32 | #endif | ||
33 | } | ||
34 | |||
22 | /* | 35 | /* |
23 | * Called by kernel/ptrace.c when detaching.. | 36 | * Called by kernel/ptrace.c when detaching.. |
24 | */ | 37 | */ |
25 | void ptrace_disable(struct task_struct *child) | 38 | void ptrace_disable(struct task_struct *child) |
26 | { | 39 | { |
27 | child->ptrace &= ~PT_DTRACE; | 40 | set_singlestepping(child,0); |
28 | child->thread.singlestep_syscall = 0; | ||
29 | } | 41 | } |
30 | 42 | ||
43 | extern int peek_user(struct task_struct * child, long addr, long data); | ||
44 | extern int poke_user(struct task_struct * child, long addr, long data); | ||
45 | |||
31 | long sys_ptrace(long request, long pid, long addr, long data) | 46 | long sys_ptrace(long request, long pid, long addr, long data) |
32 | { | 47 | { |
33 | struct task_struct *child; | 48 | struct task_struct *child; |
@@ -67,6 +82,10 @@ long sys_ptrace(long request, long pid, long addr, long data) | |||
67 | goto out_tsk; | 82 | goto out_tsk; |
68 | } | 83 | } |
69 | 84 | ||
85 | #ifdef SUBACH_PTRACE_SPECIAL | ||
86 | SUBARCH_PTRACE_SPECIAL(child,request,addr,data) | ||
87 | #endif | ||
88 | |||
70 | ret = ptrace_check_attach(child, request == PTRACE_KILL); | 89 | ret = ptrace_check_attach(child, request == PTRACE_KILL); |
71 | if (ret < 0) | 90 | if (ret < 0) |
72 | goto out_tsk; | 91 | goto out_tsk; |
@@ -87,28 +106,9 @@ long sys_ptrace(long request, long pid, long addr, long data) | |||
87 | } | 106 | } |
88 | 107 | ||
89 | /* read the word at location addr in the USER area. */ | 108 | /* read the word at location addr in the USER area. */ |
90 | case PTRACE_PEEKUSR: { | 109 | case PTRACE_PEEKUSR: |
91 | unsigned long tmp; | 110 | ret = peek_user(child, addr, data); |
92 | 111 | break; | |
93 | ret = -EIO; | ||
94 | if ((addr & 3) || addr < 0) | ||
95 | break; | ||
96 | |||
97 | tmp = 0; /* Default return condition */ | ||
98 | if(addr < MAX_REG_OFFSET){ | ||
99 | tmp = getreg(child, addr); | ||
100 | } | ||
101 | #if defined(CONFIG_UML_X86) && !defined(CONFIG_64BIT) | ||
102 | else if((addr >= offsetof(struct user, u_debugreg[0])) && | ||
103 | (addr <= offsetof(struct user, u_debugreg[7]))){ | ||
104 | addr -= offsetof(struct user, u_debugreg[0]); | ||
105 | addr = addr >> 2; | ||
106 | tmp = child->thread.arch.debugregs[addr]; | ||
107 | } | ||
108 | #endif | ||
109 | ret = put_user(tmp, (unsigned long __user *) data); | ||
110 | break; | ||
111 | } | ||
112 | 112 | ||
113 | /* when I and D space are separate, this will have to be fixed. */ | 113 | /* when I and D space are separate, this will have to be fixed. */ |
114 | case PTRACE_POKETEXT: /* write the word at location addr. */ | 114 | case PTRACE_POKETEXT: /* write the word at location addr. */ |
@@ -121,26 +121,8 @@ long sys_ptrace(long request, long pid, long addr, long data) | |||
121 | break; | 121 | break; |
122 | 122 | ||
123 | case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ | 123 | case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ |
124 | ret = -EIO; | 124 | ret = poke_user(child, addr, data); |
125 | if ((addr & 3) || addr < 0) | 125 | break; |
126 | break; | ||
127 | |||
128 | if (addr < MAX_REG_OFFSET) { | ||
129 | ret = putreg(child, addr, data); | ||
130 | break; | ||
131 | } | ||
132 | #if defined(CONFIG_UML_X86) && !defined(CONFIG_64BIT) | ||
133 | else if((addr >= offsetof(struct user, u_debugreg[0])) && | ||
134 | (addr <= offsetof(struct user, u_debugreg[7]))){ | ||
135 | addr -= offsetof(struct user, u_debugreg[0]); | ||
136 | addr = addr >> 2; | ||
137 | if((addr == 4) || (addr == 5)) break; | ||
138 | child->thread.arch.debugregs[addr] = data; | ||
139 | ret = 0; | ||
140 | } | ||
141 | #endif | ||
142 | |||
143 | break; | ||
144 | 126 | ||
145 | case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ | 127 | case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ |
146 | case PTRACE_CONT: { /* restart after signal. */ | 128 | case PTRACE_CONT: { /* restart after signal. */ |
@@ -148,8 +130,7 @@ long sys_ptrace(long request, long pid, long addr, long data) | |||
148 | if (!valid_signal(data)) | 130 | if (!valid_signal(data)) |
149 | break; | 131 | break; |
150 | 132 | ||
151 | child->ptrace &= ~PT_DTRACE; | 133 | set_singlestepping(child, 0); |
152 | child->thread.singlestep_syscall = 0; | ||
153 | if (request == PTRACE_SYSCALL) { | 134 | if (request == PTRACE_SYSCALL) { |
154 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | 135 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); |
155 | } | 136 | } |
@@ -172,8 +153,7 @@ long sys_ptrace(long request, long pid, long addr, long data) | |||
172 | if (child->exit_state == EXIT_ZOMBIE) /* already dead */ | 153 | if (child->exit_state == EXIT_ZOMBIE) /* already dead */ |
173 | break; | 154 | break; |
174 | 155 | ||
175 | child->ptrace &= ~PT_DTRACE; | 156 | set_singlestepping(child, 0); |
176 | child->thread.singlestep_syscall = 0; | ||
177 | child->exit_code = SIGKILL; | 157 | child->exit_code = SIGKILL; |
178 | wake_up_process(child); | 158 | wake_up_process(child); |
179 | break; | 159 | break; |
@@ -184,8 +164,7 @@ long sys_ptrace(long request, long pid, long addr, long data) | |||
184 | if (!valid_signal(data)) | 164 | if (!valid_signal(data)) |
185 | break; | 165 | break; |
186 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | 166 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); |
187 | child->ptrace |= PT_DTRACE; | 167 | set_singlestepping(child, 1); |
188 | child->thread.singlestep_syscall = 0; | ||
189 | child->exit_code = data; | 168 | child->exit_code = data; |
190 | /* give it a chance to run. */ | 169 | /* give it a chance to run. */ |
191 | wake_up_process(child); | 170 | wake_up_process(child); |
diff --git a/arch/um/kernel/skas/include/mode_kern-skas.h b/arch/um/kernel/skas/include/mode_kern-skas.h index 94c564962378..e48490028111 100644 --- a/arch/um/kernel/skas/include/mode_kern-skas.h +++ b/arch/um/kernel/skas/include/mode_kern-skas.h | |||
@@ -18,7 +18,6 @@ extern int copy_thread_skas(int nr, unsigned long clone_flags, | |||
18 | unsigned long sp, unsigned long stack_top, | 18 | unsigned long sp, unsigned long stack_top, |
19 | struct task_struct *p, struct pt_regs *regs); | 19 | struct task_struct *p, struct pt_regs *regs); |
20 | extern void release_thread_skas(struct task_struct *task); | 20 | extern void release_thread_skas(struct task_struct *task); |
21 | extern void exit_thread_skas(void); | ||
22 | extern void initial_thread_cb_skas(void (*proc)(void *), void *arg); | 21 | extern void initial_thread_cb_skas(void (*proc)(void *), void *arg); |
23 | extern void init_idle_skas(void); | 22 | extern void init_idle_skas(void); |
24 | extern void flush_tlb_kernel_range_skas(unsigned long start, | 23 | extern void flush_tlb_kernel_range_skas(unsigned long start, |
diff --git a/arch/um/kernel/skas/include/uaccess-skas.h b/arch/um/kernel/skas/include/uaccess-skas.h index c35620385da0..cd6c280482cb 100644 --- a/arch/um/kernel/skas/include/uaccess-skas.h +++ b/arch/um/kernel/skas/include/uaccess-skas.h | |||
@@ -18,8 +18,8 @@ | |||
18 | ((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \ | 18 | ((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \ |
19 | ((unsigned long) (addr) + (size) >= (unsigned long)(addr)))) | 19 | ((unsigned long) (addr) + (size) >= (unsigned long)(addr)))) |
20 | 20 | ||
21 | static inline int __deprecated verify_area_skas(int type, const void * addr, | 21 | static inline int verify_area_skas(int type, const void * addr, |
22 | unsigned long size) | 22 | unsigned long size) |
23 | { | 23 | { |
24 | return(access_ok_skas(type, addr, size) ? 0 : -EFAULT); | 24 | return(access_ok_skas(type, addr, size) ? 0 : -EFAULT); |
25 | } | 25 | } |
diff --git a/arch/um/kernel/skas/process.c b/arch/um/kernel/skas/process.c index 4dc13bc8cfd8..773cd2b525fc 100644 --- a/arch/um/kernel/skas/process.c +++ b/arch/um/kernel/skas/process.c | |||
@@ -201,6 +201,11 @@ void userspace(union uml_pt_regs *regs) | |||
201 | } | 201 | } |
202 | } | 202 | } |
203 | } | 203 | } |
204 | #define INIT_JMP_NEW_THREAD 0 | ||
205 | #define INIT_JMP_REMOVE_SIGSTACK 1 | ||
206 | #define INIT_JMP_CALLBACK 2 | ||
207 | #define INIT_JMP_HALT 3 | ||
208 | #define INIT_JMP_REBOOT 4 | ||
204 | 209 | ||
205 | void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr, | 210 | void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr, |
206 | void (*handler)(int)) | 211 | void (*handler)(int)) |
@@ -236,7 +241,7 @@ void thread_wait(void *sw, void *fb) | |||
236 | *switch_buf = &buf; | 241 | *switch_buf = &buf; |
237 | fork_buf = fb; | 242 | fork_buf = fb; |
238 | if(sigsetjmp(buf, 1) == 0) | 243 | if(sigsetjmp(buf, 1) == 0) |
239 | siglongjmp(*fork_buf, 1); | 244 | siglongjmp(*fork_buf, INIT_JMP_REMOVE_SIGSTACK); |
240 | } | 245 | } |
241 | 246 | ||
242 | void switch_threads(void *me, void *next) | 247 | void switch_threads(void *me, void *next) |
@@ -266,21 +271,25 @@ int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr) | |||
266 | 271 | ||
267 | *fork_buf_ptr = &initial_jmpbuf; | 272 | *fork_buf_ptr = &initial_jmpbuf; |
268 | n = sigsetjmp(initial_jmpbuf, 1); | 273 | n = sigsetjmp(initial_jmpbuf, 1); |
269 | if(n == 0) | 274 | switch(n){ |
270 | new_thread_proc((void *) stack, new_thread_handler); | 275 | case INIT_JMP_NEW_THREAD: |
271 | else if(n == 1) | 276 | new_thread_proc((void *) stack, new_thread_handler); |
272 | remove_sigstack(); | 277 | break; |
273 | else if(n == 2){ | 278 | case INIT_JMP_REMOVE_SIGSTACK: |
279 | remove_sigstack(); | ||
280 | break; | ||
281 | case INIT_JMP_CALLBACK: | ||
274 | (*cb_proc)(cb_arg); | 282 | (*cb_proc)(cb_arg); |
275 | siglongjmp(*cb_back, 1); | 283 | siglongjmp(*cb_back, 1); |
276 | } | 284 | break; |
277 | else if(n == 3){ | 285 | case INIT_JMP_HALT: |
278 | kmalloc_ok = 0; | 286 | kmalloc_ok = 0; |
279 | return(0); | 287 | return(0); |
280 | } | 288 | case INIT_JMP_REBOOT: |
281 | else if(n == 4){ | ||
282 | kmalloc_ok = 0; | 289 | kmalloc_ok = 0; |
283 | return(1); | 290 | return(1); |
291 | default: | ||
292 | panic("Bad sigsetjmp return in start_idle_thread - %d\n", n); | ||
284 | } | 293 | } |
285 | siglongjmp(**switch_buf, 1); | 294 | siglongjmp(**switch_buf, 1); |
286 | } | 295 | } |
@@ -305,7 +314,7 @@ void initial_thread_cb_skas(void (*proc)(void *), void *arg) | |||
305 | 314 | ||
306 | block_signals(); | 315 | block_signals(); |
307 | if(sigsetjmp(here, 1) == 0) | 316 | if(sigsetjmp(here, 1) == 0) |
308 | siglongjmp(initial_jmpbuf, 2); | 317 | siglongjmp(initial_jmpbuf, INIT_JMP_CALLBACK); |
309 | unblock_signals(); | 318 | unblock_signals(); |
310 | 319 | ||
311 | cb_proc = NULL; | 320 | cb_proc = NULL; |
@@ -316,13 +325,13 @@ void initial_thread_cb_skas(void (*proc)(void *), void *arg) | |||
316 | void halt_skas(void) | 325 | void halt_skas(void) |
317 | { | 326 | { |
318 | block_signals(); | 327 | block_signals(); |
319 | siglongjmp(initial_jmpbuf, 3); | 328 | siglongjmp(initial_jmpbuf, INIT_JMP_HALT); |
320 | } | 329 | } |
321 | 330 | ||
322 | void reboot_skas(void) | 331 | void reboot_skas(void) |
323 | { | 332 | { |
324 | block_signals(); | 333 | block_signals(); |
325 | siglongjmp(initial_jmpbuf, 4); | 334 | siglongjmp(initial_jmpbuf, INIT_JMP_REBOOT); |
326 | } | 335 | } |
327 | 336 | ||
328 | void switch_mm_skas(int mm_fd) | 337 | void switch_mm_skas(int mm_fd) |
diff --git a/arch/um/kernel/skas/process_kern.c b/arch/um/kernel/skas/process_kern.c index 5d096ea63b97..ab5d3271da0b 100644 --- a/arch/um/kernel/skas/process_kern.c +++ b/arch/um/kernel/skas/process_kern.c | |||
@@ -83,10 +83,6 @@ void release_thread_skas(struct task_struct *task) | |||
83 | { | 83 | { |
84 | } | 84 | } |
85 | 85 | ||
86 | void exit_thread_skas(void) | ||
87 | { | ||
88 | } | ||
89 | |||
90 | void fork_handler(int sig) | 86 | void fork_handler(int sig) |
91 | { | 87 | { |
92 | change_sig(SIGUSR1, 1); | 88 | change_sig(SIGUSR1, 1); |
diff --git a/arch/um/kernel/skas/uaccess.c b/arch/um/kernel/skas/uaccess.c index f7da9d027672..75195281081e 100644 --- a/arch/um/kernel/skas/uaccess.c +++ b/arch/um/kernel/skas/uaccess.c | |||
@@ -29,9 +29,12 @@ static unsigned long maybe_map(unsigned long virt, int is_write) | |||
29 | if(IS_ERR(phys) || (is_write && !pte_write(pte))){ | 29 | if(IS_ERR(phys) || (is_write && !pte_write(pte))){ |
30 | err = handle_page_fault(virt, 0, is_write, 1, &dummy_code); | 30 | err = handle_page_fault(virt, 0, is_write, 1, &dummy_code); |
31 | if(err) | 31 | if(err) |
32 | return(0); | 32 | return(-1UL); |
33 | phys = um_virt_to_phys(current, virt, NULL); | 33 | phys = um_virt_to_phys(current, virt, NULL); |
34 | } | 34 | } |
35 | if(IS_ERR(phys)) | ||
36 | phys = (void *) -1; | ||
37 | |||
35 | return((unsigned long) phys); | 38 | return((unsigned long) phys); |
36 | } | 39 | } |
37 | 40 | ||
@@ -42,7 +45,7 @@ static int do_op(unsigned long addr, int len, int is_write, | |||
42 | int n; | 45 | int n; |
43 | 46 | ||
44 | addr = maybe_map(addr, is_write); | 47 | addr = maybe_map(addr, is_write); |
45 | if(addr == -1) | 48 | if(addr == -1UL) |
46 | return(-1); | 49 | return(-1); |
47 | 50 | ||
48 | page = phys_to_page(addr); | 51 | page = phys_to_page(addr); |
diff --git a/arch/um/kernel/syscall_kern.c b/arch/um/kernel/syscall_kern.c index 42731e04f50f..b7a55251e897 100644 --- a/arch/um/kernel/syscall_kern.c +++ b/arch/um/kernel/syscall_kern.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include "linux/utime.h" | 17 | #include "linux/utime.h" |
18 | #include "asm/mman.h" | 18 | #include "asm/mman.h" |
19 | #include "asm/uaccess.h" | 19 | #include "asm/uaccess.h" |
20 | #include "asm/ipc.h" | ||
21 | #include "kern_util.h" | 20 | #include "kern_util.h" |
22 | #include "user_util.h" | 21 | #include "user_util.h" |
23 | #include "sysdep/syscalls.h" | 22 | #include "sysdep/syscalls.h" |
diff --git a/arch/um/kernel/trap_kern.c b/arch/um/kernel/trap_kern.c index 54e2ec33a43c..5fca2c61eb98 100644 --- a/arch/um/kernel/trap_kern.c +++ b/arch/um/kernel/trap_kern.c | |||
@@ -48,7 +48,7 @@ int handle_page_fault(unsigned long address, unsigned long ip, | |||
48 | goto good_area; | 48 | goto good_area; |
49 | else if(!(vma->vm_flags & VM_GROWSDOWN)) | 49 | else if(!(vma->vm_flags & VM_GROWSDOWN)) |
50 | goto out; | 50 | goto out; |
51 | else if(!ARCH_IS_STACKGROW(address)) | 51 | else if(is_user && !ARCH_IS_STACKGROW(address)) |
52 | goto out; | 52 | goto out; |
53 | else if(expand_stack(vma, address)) | 53 | else if(expand_stack(vma, address)) |
54 | goto out; | 54 | goto out; |
diff --git a/arch/um/kernel/tt/include/mode_kern-tt.h b/arch/um/kernel/tt/include/mode_kern-tt.h index 28aaab3448fa..e0ca0e0b2516 100644 --- a/arch/um/kernel/tt/include/mode_kern-tt.h +++ b/arch/um/kernel/tt/include/mode_kern-tt.h | |||
@@ -19,7 +19,6 @@ extern int copy_thread_tt(int nr, unsigned long clone_flags, unsigned long sp, | |||
19 | unsigned long stack_top, struct task_struct *p, | 19 | unsigned long stack_top, struct task_struct *p, |
20 | struct pt_regs *regs); | 20 | struct pt_regs *regs); |
21 | extern void release_thread_tt(struct task_struct *task); | 21 | extern void release_thread_tt(struct task_struct *task); |
22 | extern void exit_thread_tt(void); | ||
23 | extern void initial_thread_cb_tt(void (*proc)(void *), void *arg); | 22 | extern void initial_thread_cb_tt(void (*proc)(void *), void *arg); |
24 | extern void init_idle_tt(void); | 23 | extern void init_idle_tt(void); |
25 | extern void flush_tlb_kernel_range_tt(unsigned long start, unsigned long end); | 24 | extern void flush_tlb_kernel_range_tt(unsigned long start, unsigned long end); |
diff --git a/arch/um/kernel/tt/include/uaccess-tt.h b/arch/um/kernel/tt/include/uaccess-tt.h index bb69d6b7d022..3fbb5fe26f49 100644 --- a/arch/um/kernel/tt/include/uaccess-tt.h +++ b/arch/um/kernel/tt/include/uaccess-tt.h | |||
@@ -33,8 +33,8 @@ extern unsigned long uml_physmem; | |||
33 | (((unsigned long) (addr) <= ((unsigned long) (addr) + (size))) && \ | 33 | (((unsigned long) (addr) <= ((unsigned long) (addr) + (size))) && \ |
34 | (under_task_size(addr, size) || is_stack(addr, size)))) | 34 | (under_task_size(addr, size) || is_stack(addr, size)))) |
35 | 35 | ||
36 | static inline int __deprecated verify_area_tt(int type, const void * addr, | 36 | static inline int verify_area_tt(int type, const void * addr, |
37 | unsigned long size) | 37 | unsigned long size) |
38 | { | 38 | { |
39 | return(access_ok_tt(type, addr, size) ? 0 : -EFAULT); | 39 | return(access_ok_tt(type, addr, size) ? 0 : -EFAULT); |
40 | } | 40 | } |
diff --git a/arch/um/kernel/tt/mem.c b/arch/um/kernel/tt/mem.c index 74346a04a2b2..bcb8796c3cb1 100644 --- a/arch/um/kernel/tt/mem.c +++ b/arch/um/kernel/tt/mem.c | |||
@@ -21,14 +21,8 @@ void before_mem_tt(unsigned long brk_start) | |||
21 | remap_data(UML_ROUND_DOWN(&__bss_start), UML_ROUND_UP(&_end), 1); | 21 | remap_data(UML_ROUND_DOWN(&__bss_start), UML_ROUND_UP(&_end), 1); |
22 | } | 22 | } |
23 | 23 | ||
24 | #ifdef CONFIG_HOST_2G_2G | ||
25 | #define TOP 0x80000000 | ||
26 | #else | ||
27 | #define TOP 0xc0000000 | ||
28 | #endif | ||
29 | |||
30 | #define SIZE ((CONFIG_NEST_LEVEL + CONFIG_KERNEL_HALF_GIGS) * 0x20000000) | 24 | #define SIZE ((CONFIG_NEST_LEVEL + CONFIG_KERNEL_HALF_GIGS) * 0x20000000) |
31 | #define START (TOP - SIZE) | 25 | #define START (CONFIG_TOP_ADDR - SIZE) |
32 | 26 | ||
33 | unsigned long set_task_sizes_tt(int arg, unsigned long *host_size_out, | 27 | unsigned long set_task_sizes_tt(int arg, unsigned long *host_size_out, |
34 | unsigned long *task_size_out) | 28 | unsigned long *task_size_out) |
diff --git a/arch/um/kernel/tt/process_kern.c b/arch/um/kernel/tt/process_kern.c index f19f7c18febe..df810ca8fc12 100644 --- a/arch/um/kernel/tt/process_kern.c +++ b/arch/um/kernel/tt/process_kern.c | |||
@@ -65,8 +65,7 @@ void *switch_to_tt(void *prev, void *next, void *last) | |||
65 | panic("write of switch_pipe failed, err = %d", -err); | 65 | panic("write of switch_pipe failed, err = %d", -err); |
66 | 66 | ||
67 | reading = 1; | 67 | reading = 1; |
68 | if((from->exit_state == EXIT_ZOMBIE) || | 68 | if(from->thread.mode.tt.switch_pipe[0] == -1) |
69 | (from->exit_state == EXIT_DEAD)) | ||
70 | os_kill_process(os_getpid(), 0); | 69 | os_kill_process(os_getpid(), 0); |
71 | 70 | ||
72 | err = os_read_file(from->thread.mode.tt.switch_pipe[0], &c, sizeof(c)); | 71 | err = os_read_file(from->thread.mode.tt.switch_pipe[0], &c, sizeof(c)); |
@@ -81,8 +80,7 @@ void *switch_to_tt(void *prev, void *next, void *last) | |||
81 | * in case it has not already killed itself. | 80 | * in case it has not already killed itself. |
82 | */ | 81 | */ |
83 | prev_sched = current->thread.prev_sched; | 82 | prev_sched = current->thread.prev_sched; |
84 | if((prev_sched->exit_state == EXIT_ZOMBIE) || | 83 | if(prev_sched->thread.mode.tt.switch_pipe[0] == -1) |
85 | (prev_sched->exit_state == EXIT_DEAD)) | ||
86 | os_kill_process(prev_sched->thread.mode.tt.extern_pid, 1); | 84 | os_kill_process(prev_sched->thread.mode.tt.extern_pid, 1); |
87 | 85 | ||
88 | change_sig(SIGVTALRM, vtalrm); | 86 | change_sig(SIGVTALRM, vtalrm); |
@@ -101,14 +99,18 @@ void release_thread_tt(struct task_struct *task) | |||
101 | { | 99 | { |
102 | int pid = task->thread.mode.tt.extern_pid; | 100 | int pid = task->thread.mode.tt.extern_pid; |
103 | 101 | ||
102 | /* | ||
103 | * We first have to kill the other process, before | ||
104 | * closing its switch_pipe. Else it might wake up | ||
105 | * and receive "EOF" before we could kill it. | ||
106 | */ | ||
104 | if(os_getpid() != pid) | 107 | if(os_getpid() != pid) |
105 | os_kill_process(pid, 0); | 108 | os_kill_process(pid, 0); |
106 | } | ||
107 | 109 | ||
108 | void exit_thread_tt(void) | 110 | os_close_file(task->thread.mode.tt.switch_pipe[0]); |
109 | { | 111 | os_close_file(task->thread.mode.tt.switch_pipe[1]); |
110 | os_close_file(current->thread.mode.tt.switch_pipe[0]); | 112 | /* use switch_pipe as flag: thread is released */ |
111 | os_close_file(current->thread.mode.tt.switch_pipe[1]); | 113 | task->thread.mode.tt.switch_pipe[0] = -1; |
112 | } | 114 | } |
113 | 115 | ||
114 | void suspend_new_thread(int fd) | 116 | void suspend_new_thread(int fd) |
diff --git a/arch/um/kernel/tt/syscall_user.c b/arch/um/kernel/tt/syscall_user.c index e4e7e9c2224c..b218316cfdb2 100644 --- a/arch/um/kernel/tt/syscall_user.c +++ b/arch/um/kernel/tt/syscall_user.c | |||
@@ -63,6 +63,10 @@ void do_syscall(void *task, int pid, int local_using_sysemu) | |||
63 | 63 | ||
64 | UPT_SYSCALL_NR(TASK_REGS(task)) = PT_SYSCALL_NR(proc_regs); | 64 | UPT_SYSCALL_NR(TASK_REGS(task)) = PT_SYSCALL_NR(proc_regs); |
65 | 65 | ||
66 | #ifdef UPT_ORIGGPR2 | ||
67 | UPT_ORIGGPR2(TASK_REGS(task)) = REGS_ORIGGPR2(proc_regs); | ||
68 | #endif | ||
69 | |||
66 | if(((unsigned long *) PT_IP(proc_regs) >= &_stext) && | 70 | if(((unsigned long *) PT_IP(proc_regs) >= &_stext) && |
67 | ((unsigned long *) PT_IP(proc_regs) <= &_etext)) | 71 | ((unsigned long *) PT_IP(proc_regs) <= &_etext)) |
68 | tracer_panic("I'm tracing myself and I can't get out"); | 72 | tracer_panic("I'm tracing myself and I can't get out"); |
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index 5c49d88eed3d..4d10ec372a67 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "asm/ptrace.h" | 23 | #include "asm/ptrace.h" |
24 | #include "asm/elf.h" | 24 | #include "asm/elf.h" |
25 | #include "asm/user.h" | 25 | #include "asm/user.h" |
26 | #include "asm/setup.h" | ||
26 | #include "ubd_user.h" | 27 | #include "ubd_user.h" |
27 | #include "asm/current.h" | 28 | #include "asm/current.h" |
28 | #include "asm/setup.h" | 29 | #include "asm/setup.h" |
@@ -42,9 +43,9 @@ | |||
42 | #define DEFAULT_COMMAND_LINE "root=98:0" | 43 | #define DEFAULT_COMMAND_LINE "root=98:0" |
43 | 44 | ||
44 | /* Changed in linux_main and setup_arch, which run before SMP is started */ | 45 | /* Changed in linux_main and setup_arch, which run before SMP is started */ |
45 | char command_line[COMMAND_LINE_SIZE] = { 0 }; | 46 | static char command_line[COMMAND_LINE_SIZE] = { 0 }; |
46 | 47 | ||
47 | void add_arg(char *arg) | 48 | static void add_arg(char *arg) |
48 | { | 49 | { |
49 | if (strlen(command_line) + strlen(arg) + 1 > COMMAND_LINE_SIZE) { | 50 | if (strlen(command_line) + strlen(arg) + 1 > COMMAND_LINE_SIZE) { |
50 | printf("add_arg: Too many command line arguments!\n"); | 51 | printf("add_arg: Too many command line arguments!\n"); |
@@ -449,7 +450,7 @@ void __init setup_arch(char **cmdline_p) | |||
449 | { | 450 | { |
450 | notifier_chain_register(&panic_notifier_list, &panic_exit_notifier); | 451 | notifier_chain_register(&panic_notifier_list, &panic_exit_notifier); |
451 | paging_init(); | 452 | paging_init(); |
452 | strlcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); | 453 | strlcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); |
453 | *cmdline_p = command_line; | 454 | *cmdline_p = command_line; |
454 | setup_hostinfo(); | 455 | setup_hostinfo(); |
455 | } | 456 | } |
diff --git a/arch/um/sys-i386/ptrace.c b/arch/um/sys-i386/ptrace.c index e470d28cdf84..e839ce65ad28 100644 --- a/arch/um/sys-i386/ptrace.c +++ b/arch/um/sys-i386/ptrace.c | |||
@@ -73,6 +73,25 @@ int putreg(struct task_struct *child, int regno, unsigned long value) | |||
73 | return 0; | 73 | return 0; |
74 | } | 74 | } |
75 | 75 | ||
76 | int poke_user(struct task_struct *child, long addr, long data) | ||
77 | { | ||
78 | if ((addr & 3) || addr < 0) | ||
79 | return -EIO; | ||
80 | |||
81 | if (addr < MAX_REG_OFFSET) | ||
82 | return putreg(child, addr, data); | ||
83 | |||
84 | else if((addr >= offsetof(struct user, u_debugreg[0])) && | ||
85 | (addr <= offsetof(struct user, u_debugreg[7]))){ | ||
86 | addr -= offsetof(struct user, u_debugreg[0]); | ||
87 | addr = addr >> 2; | ||
88 | if((addr == 4) || (addr == 5)) return -EIO; | ||
89 | child->thread.arch.debugregs[addr] = data; | ||
90 | return 0; | ||
91 | } | ||
92 | return -EIO; | ||
93 | } | ||
94 | |||
76 | unsigned long getreg(struct task_struct *child, int regno) | 95 | unsigned long getreg(struct task_struct *child, int regno) |
77 | { | 96 | { |
78 | unsigned long retval = ~0UL; | 97 | unsigned long retval = ~0UL; |
@@ -93,6 +112,27 @@ unsigned long getreg(struct task_struct *child, int regno) | |||
93 | return retval; | 112 | return retval; |
94 | } | 113 | } |
95 | 114 | ||
115 | int peek_user(struct task_struct *child, long addr, long data) | ||
116 | { | ||
117 | /* read the word at location addr in the USER area. */ | ||
118 | unsigned long tmp; | ||
119 | |||
120 | if ((addr & 3) || addr < 0) | ||
121 | return -EIO; | ||
122 | |||
123 | tmp = 0; /* Default return condition */ | ||
124 | if(addr < MAX_REG_OFFSET){ | ||
125 | tmp = getreg(child, addr); | ||
126 | } | ||
127 | else if((addr >= offsetof(struct user, u_debugreg[0])) && | ||
128 | (addr <= offsetof(struct user, u_debugreg[7]))){ | ||
129 | addr -= offsetof(struct user, u_debugreg[0]); | ||
130 | addr = addr >> 2; | ||
131 | tmp = child->thread.arch.debugregs[addr]; | ||
132 | } | ||
133 | return put_user(tmp, (unsigned long *) data); | ||
134 | } | ||
135 | |||
96 | struct i387_fxsave_struct { | 136 | struct i387_fxsave_struct { |
97 | unsigned short cwd; | 137 | unsigned short cwd; |
98 | unsigned short swd; | 138 | unsigned short swd; |
diff --git a/arch/um/sys-ppc/ptrace.c b/arch/um/sys-ppc/ptrace.c index a971366d3277..8e71b47f2b8e 100644 --- a/arch/um/sys-ppc/ptrace.c +++ b/arch/um/sys-ppc/ptrace.c | |||
@@ -8,6 +8,25 @@ int putreg(struct task_struct *child, unsigned long regno, | |||
8 | return 0; | 8 | return 0; |
9 | } | 9 | } |
10 | 10 | ||
11 | int poke_user(struct task_struct *child, long addr, long data) | ||
12 | { | ||
13 | if ((addr & 3) || addr < 0) | ||
14 | return -EIO; | ||
15 | |||
16 | if (addr < MAX_REG_OFFSET) | ||
17 | return putreg(child, addr, data); | ||
18 | |||
19 | else if((addr >= offsetof(struct user, u_debugreg[0])) && | ||
20 | (addr <= offsetof(struct user, u_debugreg[7]))){ | ||
21 | addr -= offsetof(struct user, u_debugreg[0]); | ||
22 | addr = addr >> 2; | ||
23 | if((addr == 4) || (addr == 5)) return -EIO; | ||
24 | child->thread.arch.debugregs[addr] = data; | ||
25 | return 0; | ||
26 | } | ||
27 | return -EIO; | ||
28 | } | ||
29 | |||
11 | unsigned long getreg(struct task_struct *child, unsigned long regno) | 30 | unsigned long getreg(struct task_struct *child, unsigned long regno) |
12 | { | 31 | { |
13 | unsigned long retval = ~0UL; | 32 | unsigned long retval = ~0UL; |
@@ -16,6 +35,27 @@ unsigned long getreg(struct task_struct *child, unsigned long regno) | |||
16 | return retval; | 35 | return retval; |
17 | } | 36 | } |
18 | 37 | ||
38 | int peek_user(struct task_struct *child, long addr, long data) | ||
39 | { | ||
40 | /* read the word at location addr in the USER area. */ | ||
41 | unsigned long tmp; | ||
42 | |||
43 | if ((addr & 3) || addr < 0) | ||
44 | return -EIO; | ||
45 | |||
46 | tmp = 0; /* Default return condition */ | ||
47 | if(addr < MAX_REG_OFFSET){ | ||
48 | tmp = getreg(child, addr); | ||
49 | } | ||
50 | else if((addr >= offsetof(struct user, u_debugreg[0])) && | ||
51 | (addr <= offsetof(struct user, u_debugreg[7]))){ | ||
52 | addr -= offsetof(struct user, u_debugreg[0]); | ||
53 | addr = addr >> 2; | ||
54 | tmp = child->thread.arch.debugregs[addr]; | ||
55 | } | ||
56 | return put_user(tmp, (unsigned long *) data); | ||
57 | } | ||
58 | |||
19 | /* | 59 | /* |
20 | * Overrides for Emacs so that we follow Linus's tabbing style. | 60 | * Overrides for Emacs so that we follow Linus's tabbing style. |
21 | * Emacs will notice this stuff at the end of the file and automatically | 61 | * Emacs will notice this stuff at the end of the file and automatically |
diff --git a/arch/um/sys-x86_64/ptrace.c b/arch/um/sys-x86_64/ptrace.c index 8c146b2a1e00..b593bb256f2c 100644 --- a/arch/um/sys-x86_64/ptrace.c +++ b/arch/um/sys-x86_64/ptrace.c | |||
@@ -62,6 +62,27 @@ int putreg(struct task_struct *child, int regno, unsigned long value) | |||
62 | return 0; | 62 | return 0; |
63 | } | 63 | } |
64 | 64 | ||
65 | int poke_user(struct task_struct *child, long addr, long data) | ||
66 | { | ||
67 | if ((addr & 3) || addr < 0) | ||
68 | return -EIO; | ||
69 | |||
70 | if (addr < MAX_REG_OFFSET) | ||
71 | return putreg(child, addr, data); | ||
72 | |||
73 | #if 0 /* Need x86_64 debugregs handling */ | ||
74 | else if((addr >= offsetof(struct user, u_debugreg[0])) && | ||
75 | (addr <= offsetof(struct user, u_debugreg[7]))){ | ||
76 | addr -= offsetof(struct user, u_debugreg[0]); | ||
77 | addr = addr >> 2; | ||
78 | if((addr == 4) || (addr == 5)) return -EIO; | ||
79 | child->thread.arch.debugregs[addr] = data; | ||
80 | return 0; | ||
81 | } | ||
82 | #endif | ||
83 | return -EIO; | ||
84 | } | ||
85 | |||
65 | unsigned long getreg(struct task_struct *child, int regno) | 86 | unsigned long getreg(struct task_struct *child, int regno) |
66 | { | 87 | { |
67 | unsigned long retval = ~0UL; | 88 | unsigned long retval = ~0UL; |
@@ -84,6 +105,29 @@ unsigned long getreg(struct task_struct *child, int regno) | |||
84 | return retval; | 105 | return retval; |
85 | } | 106 | } |
86 | 107 | ||
108 | int peek_user(struct task_struct *child, long addr, long data) | ||
109 | { | ||
110 | /* read the word at location addr in the USER area. */ | ||
111 | unsigned long tmp; | ||
112 | |||
113 | if ((addr & 3) || addr < 0) | ||
114 | return -EIO; | ||
115 | |||
116 | tmp = 0; /* Default return condition */ | ||
117 | if(addr < MAX_REG_OFFSET){ | ||
118 | tmp = getreg(child, addr); | ||
119 | } | ||
120 | #if 0 /* Need x86_64 debugregs handling */ | ||
121 | else if((addr >= offsetof(struct user, u_debugreg[0])) && | ||
122 | (addr <= offsetof(struct user, u_debugreg[7]))){ | ||
123 | addr -= offsetof(struct user, u_debugreg[0]); | ||
124 | addr = addr >> 2; | ||
125 | tmp = child->thread.arch.debugregs[addr]; | ||
126 | } | ||
127 | #endif | ||
128 | return put_user(tmp, (unsigned long *) data); | ||
129 | } | ||
130 | |||
87 | void arch_switch(void) | 131 | void arch_switch(void) |
88 | { | 132 | { |
89 | /* XXX | 133 | /* XXX |
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c index b740177066a0..73a7926f7370 100644 --- a/arch/um/sys-x86_64/signal.c +++ b/arch/um/sys-x86_64/signal.c | |||
@@ -168,7 +168,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig, | |||
168 | 168 | ||
169 | frame = (struct rt_sigframe __user *) | 169 | frame = (struct rt_sigframe __user *) |
170 | round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; | 170 | round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; |
171 | frame -= 128; | 171 | ((unsigned char *) frame) -= 128; |
172 | 172 | ||
173 | if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) | 173 | if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) |
174 | goto out; | 174 | goto out; |
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c index 2a575ef52bba..dd9914642b8e 100644 --- a/arch/um/sys-x86_64/syscalls.c +++ b/arch/um/sys-x86_64/syscalls.c | |||
@@ -44,6 +44,8 @@ long sys_modify_ldt_tt(int func, void *ptr, unsigned long bytecount) | |||
44 | #ifdef CONFIG_MODE_SKAS | 44 | #ifdef CONFIG_MODE_SKAS |
45 | extern int userspace_pid[]; | 45 | extern int userspace_pid[]; |
46 | 46 | ||
47 | #include "skas_ptrace.h" | ||
48 | |||
47 | long sys_modify_ldt_skas(int func, void *ptr, unsigned long bytecount) | 49 | long sys_modify_ldt_skas(int func, void *ptr, unsigned long bytecount) |
48 | { | 50 | { |
49 | struct ptrace_ldt ldt; | 51 | struct ptrace_ldt ldt; |
diff --git a/drivers/block/rd.c b/drivers/block/rd.c index f8a8b68dced0..145c1fbffe01 100644 --- a/drivers/block/rd.c +++ b/drivers/block/rd.c | |||
@@ -74,7 +74,7 @@ static struct request_queue *rd_queue[CONFIG_BLK_DEV_RAM_COUNT]; | |||
74 | * architecture-specific setup routine (from the stored boot sector | 74 | * architecture-specific setup routine (from the stored boot sector |
75 | * information). | 75 | * information). |
76 | */ | 76 | */ |
77 | static int rd_size = CONFIG_BLK_DEV_RAM_SIZE; /* Size of the RAM disks */ | 77 | int rd_size = CONFIG_BLK_DEV_RAM_SIZE; /* Size of the RAM disks */ |
78 | /* | 78 | /* |
79 | * It would be very desirable to have a soft-blocksize (that in the case | 79 | * It would be very desirable to have a soft-blocksize (that in the case |
80 | * of the ramdisk driver is also the hardblocksize ;) of PAGE_SIZE because | 80 | * of the ramdisk driver is also the hardblocksize ;) of PAGE_SIZE because |
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 881a0539fc17..6212388edb75 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -357,8 +357,16 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
357 | V4L2_TUNER_RADIO != t->mode) | 357 | V4L2_TUNER_RADIO != t->mode) |
358 | set_tv_freq(client,400*16); | 358 | set_tv_freq(client,400*16); |
359 | t->mode = f->type; | 359 | t->mode = f->type; |
360 | t->freq = f->frequency; | 360 | set_freq(client,f->frequency); |
361 | set_freq(client,t->freq); | 361 | break; |
362 | } | ||
363 | case VIDIOC_G_FREQUENCY: | ||
364 | { | ||
365 | struct v4l2_frequency *f = arg; | ||
366 | |||
367 | SWITCH_V4L2; | ||
368 | f->type = t->mode; | ||
369 | f->frequency = t->freq; | ||
362 | break; | 370 | break; |
363 | } | 371 | } |
364 | case VIDIOC_G_TUNER: | 372 | case VIDIOC_G_TUNER: |
@@ -368,6 +376,8 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
368 | SWITCH_V4L2; | 376 | SWITCH_V4L2; |
369 | if (V4L2_TUNER_RADIO == t->mode && t->has_signal) | 377 | if (V4L2_TUNER_RADIO == t->mode && t->has_signal) |
370 | tuner->signal = t->has_signal(client); | 378 | tuner->signal = t->has_signal(client); |
379 | tuner->rangelow = tv_range[0] * 16; | ||
380 | tuner->rangehigh = tv_range[1] * 16; | ||
371 | break; | 381 | break; |
372 | } | 382 | } |
373 | default: | 383 | default: |
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 1f9aeb4accc6..68d151aaa474 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
@@ -52,7 +52,7 @@ static inline int zfcp_sg_list_copy_from_user(struct zfcp_sg_list *, | |||
52 | static inline int zfcp_sg_list_copy_to_user(void __user *, | 52 | static inline int zfcp_sg_list_copy_to_user(void __user *, |
53 | struct zfcp_sg_list *, size_t); | 53 | struct zfcp_sg_list *, size_t); |
54 | 54 | ||
55 | static int zfcp_cfdc_dev_ioctl(struct file *, unsigned int, unsigned long); | 55 | static long zfcp_cfdc_dev_ioctl(struct file *, unsigned int, unsigned long); |
56 | 56 | ||
57 | #define ZFCP_CFDC_IOC_MAGIC 0xDD | 57 | #define ZFCP_CFDC_IOC_MAGIC 0xDD |
58 | #define ZFCP_CFDC_IOC \ | 58 | #define ZFCP_CFDC_IOC \ |
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 0afa1c4696ca..c5daf372f853 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h | |||
@@ -61,7 +61,6 @@ | |||
61 | #include <linux/mempool.h> | 61 | #include <linux/mempool.h> |
62 | #include <linux/syscalls.h> | 62 | #include <linux/syscalls.h> |
63 | #include <linux/ioctl.h> | 63 | #include <linux/ioctl.h> |
64 | #include <linux/ioctl32.h> | ||
65 | 64 | ||
66 | /************************ DEBUG FLAGS *****************************************/ | 65 | /************************ DEBUG FLAGS *****************************************/ |
67 | 66 | ||
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index c9b82687ba1a..242fa77513f5 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c | |||
@@ -450,7 +450,7 @@ static int aac_cfg_open(struct inode *inode, struct file *file) | |||
450 | } | 450 | } |
451 | } | 451 | } |
452 | 452 | ||
453 | return 0; | 453 | return err; |
454 | } | 454 | } |
455 | 455 | ||
456 | /** | 456 | /** |
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index e60f9338e44a..d978e4a3e973 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c | |||
@@ -2335,8 +2335,6 @@ ahc_linux_free_target(struct ahc_softc *ahc, struct ahc_linux_target *targ) | |||
2335 | AHC_TRANS_GOAL, /*paused*/FALSE); | 2335 | AHC_TRANS_GOAL, /*paused*/FALSE); |
2336 | ahc_update_neg_request(ahc, &devinfo, tstate, tinfo, AHC_NEG_ALWAYS); | 2336 | ahc_update_neg_request(ahc, &devinfo, tstate, tinfo, AHC_NEG_ALWAYS); |
2337 | ahc->platform_data->targets[target_offset] = NULL; | 2337 | ahc->platform_data->targets[target_offset] = NULL; |
2338 | if (targ->inq_data != NULL) | ||
2339 | free(targ->inq_data, M_DEVBUF); | ||
2340 | free(targ, M_DEVBUF); | 2338 | free(targ, M_DEVBUF); |
2341 | } | 2339 | } |
2342 | 2340 | ||
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h index c401537067b6..ed9027bd8a40 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.h +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h | |||
@@ -423,10 +423,6 @@ struct ahc_linux_device { | |||
423 | struct ahc_linux_target *target; | 423 | struct ahc_linux_target *target; |
424 | }; | 424 | }; |
425 | 425 | ||
426 | typedef enum { | ||
427 | AHC_INQ_VALID = 0x02, | ||
428 | } ahc_linux_targ_flags; | ||
429 | |||
430 | struct ahc_linux_target { | 426 | struct ahc_linux_target { |
431 | struct ahc_linux_device *devices[AHC_NUM_LUNS]; | 427 | struct ahc_linux_device *devices[AHC_NUM_LUNS]; |
432 | int channel; | 428 | int channel; |
@@ -434,8 +430,6 @@ struct ahc_linux_target { | |||
434 | int refcount; | 430 | int refcount; |
435 | struct ahc_transinfo last_tinfo; | 431 | struct ahc_transinfo last_tinfo; |
436 | struct ahc_softc *ahc; | 432 | struct ahc_softc *ahc; |
437 | ahc_linux_targ_flags flags; | ||
438 | struct scsi_inquiry_data *inq_data; | ||
439 | }; | 433 | }; |
440 | 434 | ||
441 | /********************* Definitions Required by the Core ***********************/ | 435 | /********************* Definitions Required by the Core ***********************/ |
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 2240a0cde583..9bc1f153f7ea 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -300,7 +300,7 @@ qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout) | |||
300 | rport->dev_loss_tmo = ha->port_down_retry_count + 5; | 300 | rport->dev_loss_tmo = ha->port_down_retry_count + 5; |
301 | } | 301 | } |
302 | 302 | ||
303 | static struct fc_function_template qla2xxx_transport_functions = { | 303 | struct fc_function_template qla2xxx_transport_functions = { |
304 | 304 | ||
305 | .show_host_node_name = 1, | 305 | .show_host_node_name = 1, |
306 | .show_host_port_name = 1, | 306 | .show_host_port_name = 1, |
@@ -322,12 +322,6 @@ static struct fc_function_template qla2xxx_transport_functions = { | |||
322 | 322 | ||
323 | }; | 323 | }; |
324 | 324 | ||
325 | struct scsi_transport_template * | ||
326 | qla2x00_alloc_transport_tmpl(void) | ||
327 | { | ||
328 | return (fc_attach_transport(&qla2xxx_transport_functions)); | ||
329 | } | ||
330 | |||
331 | void | 325 | void |
332 | qla2x00_init_host_attr(scsi_qla_host_t *ha) | 326 | qla2x00_init_host_attr(scsi_qla_host_t *ha) |
333 | { | 327 | { |
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index e4bfe4d5bbe4..2efec6c24d60 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h | |||
@@ -24,7 +24,6 @@ | |||
24 | #define __QLA_GBL_H | 24 | #define __QLA_GBL_H |
25 | 25 | ||
26 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
27 | #include <scsi/scsi_transport.h> | ||
28 | 27 | ||
29 | extern void qla2x00_remove_one(struct pci_dev *); | 28 | extern void qla2x00_remove_one(struct pci_dev *); |
30 | extern int qla2x00_probe_one(struct pci_dev *, struct qla_board_info *); | 29 | extern int qla2x00_probe_one(struct pci_dev *, struct qla_board_info *); |
@@ -248,9 +247,10 @@ extern void qla2x00_cancel_io_descriptors(scsi_qla_host_t *); | |||
248 | /* | 247 | /* |
249 | * Global Function Prototypes in qla_attr.c source file. | 248 | * Global Function Prototypes in qla_attr.c source file. |
250 | */ | 249 | */ |
250 | struct fc_function_template; | ||
251 | extern struct fc_function_template qla2xxx_transport_functions; | ||
251 | extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *); | 252 | extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *); |
252 | extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *); | 253 | extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *); |
253 | extern struct scsi_transport_template *qla2x00_alloc_transport_tmpl(void); | ||
254 | extern void qla2x00_init_host_attr(scsi_qla_host_t *); | 254 | extern void qla2x00_init_host_attr(scsi_qla_host_t *); |
255 | extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *); | 255 | extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *); |
256 | extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *); | 256 | extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *); |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 84db911318c6..579448222d69 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -2350,7 +2350,8 @@ qla2x00_module_init(void) | |||
2350 | #if DEBUG_QLA2100 | 2350 | #if DEBUG_QLA2100 |
2351 | strcat(qla2x00_version_str, "-debug"); | 2351 | strcat(qla2x00_version_str, "-debug"); |
2352 | #endif | 2352 | #endif |
2353 | qla2xxx_transport_template = qla2x00_alloc_transport_tmpl(); | 2353 | qla2xxx_transport_template = |
2354 | fc_attach_transport(&qla2xxx_transport_functions); | ||
2354 | if (!qla2xxx_transport_template) | 2355 | if (!qla2xxx_transport_template) |
2355 | return -ENODEV; | 2356 | return -ENODEV; |
2356 | 2357 | ||
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 05d2bd075fd4..184bcaeaf812 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c | |||
@@ -542,7 +542,7 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd) | |||
542 | * that the device is no longer present */ | 542 | * that the device is no longer present */ |
543 | cmd->result = DID_NO_CONNECT << 16; | 543 | cmd->result = DID_NO_CONNECT << 16; |
544 | atomic_inc(&cmd->device->iorequest_cnt); | 544 | atomic_inc(&cmd->device->iorequest_cnt); |
545 | scsi_done(cmd); | 545 | __scsi_done(cmd); |
546 | /* return 0 (because the command has been processed) */ | 546 | /* return 0 (because the command has been processed) */ |
547 | goto out; | 547 | goto out; |
548 | } | 548 | } |
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index 303d7656f710..28966d05435c 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/workqueue.h> | 24 | #include <linux/workqueue.h> |
25 | #include <linux/blkdev.h> | ||
25 | #include <asm/semaphore.h> | 26 | #include <asm/semaphore.h> |
26 | #include <scsi/scsi.h> | 27 | #include <scsi/scsi.h> |
27 | #include "scsi_priv.h" | 28 | #include "scsi_priv.h" |
@@ -41,6 +42,11 @@ | |||
41 | 42 | ||
42 | #define SPI_MAX_ECHO_BUFFER_SIZE 4096 | 43 | #define SPI_MAX_ECHO_BUFFER_SIZE 4096 |
43 | 44 | ||
45 | #define DV_LOOPS 3 | ||
46 | #define DV_TIMEOUT (10*HZ) | ||
47 | #define DV_RETRIES 3 /* should only need at most | ||
48 | * two cc/ua clears */ | ||
49 | |||
44 | /* Private data accessors (keep these out of the header file) */ | 50 | /* Private data accessors (keep these out of the header file) */ |
45 | #define spi_dv_pending(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_pending) | 51 | #define spi_dv_pending(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_pending) |
46 | #define spi_dv_sem(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_sem) | 52 | #define spi_dv_sem(x) (((struct spi_transport_attrs *)&(x)->starget_data)->dv_sem) |
@@ -100,6 +106,29 @@ static int sprint_frac(char *dest, int value, int denom) | |||
100 | return result; | 106 | return result; |
101 | } | 107 | } |
102 | 108 | ||
109 | /* Modification of scsi_wait_req that will clear UNIT ATTENTION conditions | ||
110 | * resulting from (likely) bus and device resets */ | ||
111 | static void spi_wait_req(struct scsi_request *sreq, const void *cmd, | ||
112 | void *buffer, unsigned bufflen) | ||
113 | { | ||
114 | int i; | ||
115 | |||
116 | for(i = 0; i < DV_RETRIES; i++) { | ||
117 | sreq->sr_request->flags |= REQ_FAILFAST; | ||
118 | |||
119 | scsi_wait_req(sreq, cmd, buffer, bufflen, | ||
120 | DV_TIMEOUT, /* retries */ 1); | ||
121 | if (sreq->sr_result & DRIVER_SENSE) { | ||
122 | struct scsi_sense_hdr sshdr; | ||
123 | |||
124 | if (scsi_request_normalize_sense(sreq, &sshdr) | ||
125 | && sshdr.sense_key == UNIT_ATTENTION) | ||
126 | continue; | ||
127 | } | ||
128 | break; | ||
129 | } | ||
130 | } | ||
131 | |||
103 | static struct { | 132 | static struct { |
104 | enum spi_signal_type value; | 133 | enum spi_signal_type value; |
105 | char *name; | 134 | char *name; |
@@ -378,11 +407,6 @@ static CLASS_DEVICE_ATTR(signalling, S_IRUGO | S_IWUSR, | |||
378 | if(i->f->set_##x) \ | 407 | if(i->f->set_##x) \ |
379 | i->f->set_##x(sdev->sdev_target, y) | 408 | i->f->set_##x(sdev->sdev_target, y) |
380 | 409 | ||
381 | #define DV_LOOPS 3 | ||
382 | #define DV_TIMEOUT (10*HZ) | ||
383 | #define DV_RETRIES 3 /* should only need at most | ||
384 | * two cc/ua clears */ | ||
385 | |||
386 | enum spi_compare_returns { | 410 | enum spi_compare_returns { |
387 | SPI_COMPARE_SUCCESS, | 411 | SPI_COMPARE_SUCCESS, |
388 | SPI_COMPARE_FAILURE, | 412 | SPI_COMPARE_FAILURE, |
@@ -446,8 +470,7 @@ spi_dv_device_echo_buffer(struct scsi_request *sreq, u8 *buffer, | |||
446 | for (r = 0; r < retries; r++) { | 470 | for (r = 0; r < retries; r++) { |
447 | sreq->sr_cmd_len = 0; /* wait_req to fill in */ | 471 | sreq->sr_cmd_len = 0; /* wait_req to fill in */ |
448 | sreq->sr_data_direction = DMA_TO_DEVICE; | 472 | sreq->sr_data_direction = DMA_TO_DEVICE; |
449 | scsi_wait_req(sreq, spi_write_buffer, buffer, len, | 473 | spi_wait_req(sreq, spi_write_buffer, buffer, len); |
450 | DV_TIMEOUT, DV_RETRIES); | ||
451 | if(sreq->sr_result || !scsi_device_online(sdev)) { | 474 | if(sreq->sr_result || !scsi_device_online(sdev)) { |
452 | struct scsi_sense_hdr sshdr; | 475 | struct scsi_sense_hdr sshdr; |
453 | 476 | ||
@@ -471,8 +494,7 @@ spi_dv_device_echo_buffer(struct scsi_request *sreq, u8 *buffer, | |||
471 | memset(ptr, 0, len); | 494 | memset(ptr, 0, len); |
472 | sreq->sr_cmd_len = 0; /* wait_req to fill in */ | 495 | sreq->sr_cmd_len = 0; /* wait_req to fill in */ |
473 | sreq->sr_data_direction = DMA_FROM_DEVICE; | 496 | sreq->sr_data_direction = DMA_FROM_DEVICE; |
474 | scsi_wait_req(sreq, spi_read_buffer, ptr, len, | 497 | spi_wait_req(sreq, spi_read_buffer, ptr, len); |
475 | DV_TIMEOUT, DV_RETRIES); | ||
476 | scsi_device_set_state(sdev, SDEV_QUIESCE); | 498 | scsi_device_set_state(sdev, SDEV_QUIESCE); |
477 | 499 | ||
478 | if (memcmp(buffer, ptr, len) != 0) | 500 | if (memcmp(buffer, ptr, len) != 0) |
@@ -500,8 +522,7 @@ spi_dv_device_compare_inquiry(struct scsi_request *sreq, u8 *buffer, | |||
500 | 522 | ||
501 | memset(ptr, 0, len); | 523 | memset(ptr, 0, len); |
502 | 524 | ||
503 | scsi_wait_req(sreq, spi_inquiry, ptr, len, | 525 | spi_wait_req(sreq, spi_inquiry, ptr, len); |
504 | DV_TIMEOUT, DV_RETRIES); | ||
505 | 526 | ||
506 | if(sreq->sr_result || !scsi_device_online(sdev)) { | 527 | if(sreq->sr_result || !scsi_device_online(sdev)) { |
507 | scsi_device_set_state(sdev, SDEV_QUIESCE); | 528 | scsi_device_set_state(sdev, SDEV_QUIESCE); |
@@ -593,8 +614,7 @@ spi_dv_device_get_echo_buffer(struct scsi_request *sreq, u8 *buffer) | |||
593 | * (reservation conflict, device not ready, etc) just | 614 | * (reservation conflict, device not ready, etc) just |
594 | * skip the write tests */ | 615 | * skip the write tests */ |
595 | for (l = 0; ; l++) { | 616 | for (l = 0; ; l++) { |
596 | scsi_wait_req(sreq, spi_test_unit_ready, NULL, 0, | 617 | spi_wait_req(sreq, spi_test_unit_ready, NULL, 0); |
597 | DV_TIMEOUT, DV_RETRIES); | ||
598 | 618 | ||
599 | if(sreq->sr_result) { | 619 | if(sreq->sr_result) { |
600 | if(l >= 3) | 620 | if(l >= 3) |
@@ -608,8 +628,7 @@ spi_dv_device_get_echo_buffer(struct scsi_request *sreq, u8 *buffer) | |||
608 | sreq->sr_cmd_len = 0; | 628 | sreq->sr_cmd_len = 0; |
609 | sreq->sr_data_direction = DMA_FROM_DEVICE; | 629 | sreq->sr_data_direction = DMA_FROM_DEVICE; |
610 | 630 | ||
611 | scsi_wait_req(sreq, spi_read_buffer_descriptor, buffer, 4, | 631 | spi_wait_req(sreq, spi_read_buffer_descriptor, buffer, 4); |
612 | DV_TIMEOUT, DV_RETRIES); | ||
613 | 632 | ||
614 | if (sreq->sr_result) | 633 | if (sreq->sr_result) |
615 | /* Device has no echo buffer */ | 634 | /* Device has no echo buffer */ |
diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c index 3471be05779a..82d68fdb1548 100644 --- a/drivers/scsi/sr_ioctl.c +++ b/drivers/scsi/sr_ioctl.c | |||
@@ -281,6 +281,9 @@ int sr_get_mcn(struct cdrom_device_info *cdi, struct cdrom_mcn *mcn) | |||
281 | char *buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd)); | 281 | char *buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd)); |
282 | int result; | 282 | int result; |
283 | 283 | ||
284 | if (!buffer) | ||
285 | return -ENOMEM; | ||
286 | |||
284 | memset(&cgc, 0, sizeof(struct packet_command)); | 287 | memset(&cgc, 0, sizeof(struct packet_command)); |
285 | cgc.cmd[0] = GPCMD_READ_SUBCHANNEL; | 288 | cgc.cmd[0] = GPCMD_READ_SUBCHANNEL; |
286 | cgc.cmd[2] = 0x40; /* I do want the subchannel info */ | 289 | cgc.cmd[2] = 0x40; /* I do want the subchannel info */ |
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c index 5ff83d214f12..5b07c6ec3ecc 100644 --- a/drivers/scsi/sym53c8xx_2/sym_glue.c +++ b/drivers/scsi/sym53c8xx_2/sym_glue.c | |||
@@ -2038,8 +2038,9 @@ static void sym2_set_period(struct scsi_target *starget, int period) | |||
2038 | struct sym_hcb *np = sym_get_hcb(shost); | 2038 | struct sym_hcb *np = sym_get_hcb(shost); |
2039 | struct sym_tcb *tp = &np->target[starget->id]; | 2039 | struct sym_tcb *tp = &np->target[starget->id]; |
2040 | 2040 | ||
2041 | /* have to have DT for these transfers */ | 2041 | /* have to have DT for these transfers, but DT will also |
2042 | if (period <= np->minsync) | 2042 | * set width, so check that this is allowed */ |
2043 | if (period <= np->minsync && spi_width(starget)) | ||
2043 | tp->tgoal.dt = 1; | 2044 | tp->tgoal.dt = 1; |
2044 | 2045 | ||
2045 | tp->tgoal.period = period; | 2046 | tp->tgoal.period = period; |
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c index f8d90d0ecfea..de54bdc5398b 100644 --- a/drivers/serial/8250_pci.c +++ b/drivers/serial/8250_pci.c | |||
@@ -1009,6 +1009,8 @@ get_pci_irq(struct pci_dev *dev, struct pci_board *board, int idx) | |||
1009 | * n = number of serial ports | 1009 | * n = number of serial ports |
1010 | * baud = baud rate | 1010 | * baud = baud rate |
1011 | * | 1011 | * |
1012 | * This table is sorted by (in order): baud, bt, bn, n. | ||
1013 | * | ||
1012 | * Please note: in theory if n = 1, _bt infix should make no difference. | 1014 | * Please note: in theory if n = 1, _bt infix should make no difference. |
1013 | * ie, pbn_b0_1_115200 is the same as pbn_b0_bt_1_115200 | 1015 | * ie, pbn_b0_1_115200 is the same as pbn_b0_bt_1_115200 |
1014 | */ | 1016 | */ |
diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c index 17ee1b4ff087..584a27b2bbd5 100644 --- a/fs/partitions/msdos.c +++ b/fs/partitions/msdos.c | |||
@@ -114,9 +114,6 @@ parse_extended(struct parsed_partitions *state, struct block_device *bdev, | |||
114 | */ | 114 | */ |
115 | for (i=0; i<4; i++, p++) { | 115 | for (i=0; i<4; i++, p++) { |
116 | u32 offs, size, next; | 116 | u32 offs, size, next; |
117 | |||
118 | if (SYS_IND(p) == 0) | ||
119 | continue; | ||
120 | if (!NR_SECTS(p) || is_extended_partition(p)) | 117 | if (!NR_SECTS(p) || is_extended_partition(p)) |
121 | continue; | 118 | continue; |
122 | 119 | ||
@@ -433,8 +430,6 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
433 | for (slot = 1 ; slot <= 4 ; slot++, p++) { | 430 | for (slot = 1 ; slot <= 4 ; slot++, p++) { |
434 | u32 start = START_SECT(p)*sector_size; | 431 | u32 start = START_SECT(p)*sector_size; |
435 | u32 size = NR_SECTS(p)*sector_size; | 432 | u32 size = NR_SECTS(p)*sector_size; |
436 | if (SYS_IND(p) == 0) | ||
437 | continue; | ||
438 | if (!size) | 433 | if (!size) |
439 | continue; | 434 | continue; |
440 | if (is_extended_partition(p)) { | 435 | if (is_extended_partition(p)) { |
diff --git a/include/asm-um/elf.h b/include/asm-um/elf.h index ebf7c63886e0..e69de29bb2d1 100644 --- a/include/asm-um/elf.h +++ b/include/asm-um/elf.h | |||
@@ -1,196 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | #ifndef __UM_ELF_I386_H | ||
6 | #define __UM_ELF_I386_H | ||
7 | |||
8 | #include "user.h" | ||
9 | |||
10 | #if defined(CONFIG_UML_X86) && !defined(CONFIG_64BIT) | ||
11 | |||
12 | #define R_386_NONE 0 | ||
13 | #define R_386_32 1 | ||
14 | #define R_386_PC32 2 | ||
15 | #define R_386_GOT32 3 | ||
16 | #define R_386_PLT32 4 | ||
17 | #define R_386_COPY 5 | ||
18 | #define R_386_GLOB_DAT 6 | ||
19 | #define R_386_JMP_SLOT 7 | ||
20 | #define R_386_RELATIVE 8 | ||
21 | #define R_386_GOTOFF 9 | ||
22 | #define R_386_GOTPC 10 | ||
23 | #define R_386_NUM 11 | ||
24 | |||
25 | #elif defined(CONFIG_UML_X86) && defined(CONFIG_64BIT) | ||
26 | |||
27 | /* x86-64 relocation types */ | ||
28 | #define R_X86_64_NONE 0 /* No reloc */ | ||
29 | #define R_X86_64_64 1 /* Direct 64 bit */ | ||
30 | #define R_X86_64_PC32 2 /* PC relative 32 bit signed */ | ||
31 | #define R_X86_64_GOT32 3 /* 32 bit GOT entry */ | ||
32 | #define R_X86_64_PLT32 4 /* 32 bit PLT address */ | ||
33 | #define R_X86_64_COPY 5 /* Copy symbol at runtime */ | ||
34 | #define R_X86_64_GLOB_DAT 6 /* Create GOT entry */ | ||
35 | #define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */ | ||
36 | #define R_X86_64_RELATIVE 8 /* Adjust by program base */ | ||
37 | #define R_X86_64_GOTPCREL 9 /* 32 bit signed pc relative | ||
38 | offset to GOT */ | ||
39 | #define R_X86_64_32 10 /* Direct 32 bit zero extended */ | ||
40 | #define R_X86_64_32S 11 /* Direct 32 bit sign extended */ | ||
41 | #define R_X86_64_16 12 /* Direct 16 bit zero extended */ | ||
42 | #define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */ | ||
43 | #define R_X86_64_8 14 /* Direct 8 bit sign extended */ | ||
44 | #define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */ | ||
45 | |||
46 | #define R_X86_64_NUM 16 | ||
47 | |||
48 | #endif | ||
49 | |||
50 | typedef unsigned long elf_greg_t; | ||
51 | |||
52 | #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) | ||
53 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | ||
54 | |||
55 | typedef struct user_i387_struct elf_fpregset_t; | ||
56 | |||
57 | /* | ||
58 | * This is used to ensure we don't load something for the wrong architecture. | ||
59 | */ | ||
60 | #define elf_check_arch(x) \ | ||
61 | (((x)->e_machine == EM_386) || ((x)->e_machine == EM_486)) | ||
62 | |||
63 | #define ELF_CLASS ELFCLASS32 | ||
64 | #define ELF_DATA ELFDATA2LSB | ||
65 | #define ELF_ARCH EM_386 | ||
66 | |||
67 | #define ELF_PLAT_INIT(regs, load_addr) do { \ | ||
68 | PT_REGS_EBX(regs) = 0; \ | ||
69 | PT_REGS_ECX(regs) = 0; \ | ||
70 | PT_REGS_EDX(regs) = 0; \ | ||
71 | PT_REGS_ESI(regs) = 0; \ | ||
72 | PT_REGS_EDI(regs) = 0; \ | ||
73 | PT_REGS_EBP(regs) = 0; \ | ||
74 | PT_REGS_EAX(regs) = 0; \ | ||
75 | } while(0) | ||
76 | |||
77 | #define USE_ELF_CORE_DUMP | ||
78 | #define ELF_EXEC_PAGESIZE 4096 | ||
79 | |||
80 | #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3) | ||
81 | |||
82 | /* Shamelessly stolen from include/asm-i386/elf.h */ | ||
83 | |||
84 | #define ELF_CORE_COPY_REGS(pr_reg, regs) do { \ | ||
85 | pr_reg[0] = PT_REGS_EBX(regs); \ | ||
86 | pr_reg[1] = PT_REGS_ECX(regs); \ | ||
87 | pr_reg[2] = PT_REGS_EDX(regs); \ | ||
88 | pr_reg[3] = PT_REGS_ESI(regs); \ | ||
89 | pr_reg[4] = PT_REGS_EDI(regs); \ | ||
90 | pr_reg[5] = PT_REGS_EBP(regs); \ | ||
91 | pr_reg[6] = PT_REGS_EAX(regs); \ | ||
92 | pr_reg[7] = PT_REGS_DS(regs); \ | ||
93 | pr_reg[8] = PT_REGS_ES(regs); \ | ||
94 | /* fake once used fs and gs selectors? */ \ | ||
95 | pr_reg[9] = PT_REGS_DS(regs); \ | ||
96 | pr_reg[10] = PT_REGS_DS(regs); \ | ||
97 | pr_reg[11] = PT_REGS_SYSCALL_NR(regs); \ | ||
98 | pr_reg[12] = PT_REGS_IP(regs); \ | ||
99 | pr_reg[13] = PT_REGS_CS(regs); \ | ||
100 | pr_reg[14] = PT_REGS_EFLAGS(regs); \ | ||
101 | pr_reg[15] = PT_REGS_SP(regs); \ | ||
102 | pr_reg[16] = PT_REGS_SS(regs); \ | ||
103 | } while(0); | ||
104 | |||
105 | extern long elf_aux_hwcap; | ||
106 | #define ELF_HWCAP (elf_aux_hwcap) | ||
107 | |||
108 | extern char * elf_aux_platform; | ||
109 | #define ELF_PLATFORM (elf_aux_platform) | ||
110 | |||
111 | #define SET_PERSONALITY(ex, ibcs2) do ; while(0) | ||
112 | |||
113 | extern unsigned long vsyscall_ehdr; | ||
114 | extern unsigned long vsyscall_end; | ||
115 | extern unsigned long __kernel_vsyscall; | ||
116 | |||
117 | #define VSYSCALL_BASE vsyscall_ehdr | ||
118 | #define VSYSCALL_END vsyscall_end | ||
119 | |||
120 | /* | ||
121 | * This is the range that is readable by user mode, and things | ||
122 | * acting like user mode such as get_user_pages. | ||
123 | */ | ||
124 | #define FIXADDR_USER_START VSYSCALL_BASE | ||
125 | #define FIXADDR_USER_END VSYSCALL_END | ||
126 | |||
127 | /* | ||
128 | * Architecture-neutral AT_ values in 0-17, leave some room | ||
129 | * for more of them, start the x86-specific ones at 32. | ||
130 | */ | ||
131 | #define AT_SYSINFO 32 | ||
132 | #define AT_SYSINFO_EHDR 33 | ||
133 | |||
134 | #define ARCH_DLINFO \ | ||
135 | do { \ | ||
136 | if ( vsyscall_ehdr ) { \ | ||
137 | NEW_AUX_ENT(AT_SYSINFO, __kernel_vsyscall); \ | ||
138 | NEW_AUX_ENT(AT_SYSINFO_EHDR, vsyscall_ehdr); \ | ||
139 | } \ | ||
140 | } while (0) | ||
141 | |||
142 | /* | ||
143 | * These macros parameterize elf_core_dump in fs/binfmt_elf.c to write out | ||
144 | * extra segments containing the vsyscall DSO contents. Dumping its | ||
145 | * contents makes post-mortem fully interpretable later without matching up | ||
146 | * the same kernel and hardware config to see what PC values meant. | ||
147 | * Dumping its extra ELF program headers includes all the other information | ||
148 | * a debugger needs to easily find how the vsyscall DSO was being used. | ||
149 | */ | ||
150 | #define ELF_CORE_EXTRA_PHDRS \ | ||
151 | (vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0 ) | ||
152 | |||
153 | #define ELF_CORE_WRITE_EXTRA_PHDRS \ | ||
154 | if ( vsyscall_ehdr ) { \ | ||
155 | const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \ | ||
156 | const struct elf_phdr *const phdrp = \ | ||
157 | (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \ | ||
158 | int i; \ | ||
159 | Elf32_Off ofs = 0; \ | ||
160 | for (i = 0; i < ehdrp->e_phnum; ++i) { \ | ||
161 | struct elf_phdr phdr = phdrp[i]; \ | ||
162 | if (phdr.p_type == PT_LOAD) { \ | ||
163 | ofs = phdr.p_offset = offset; \ | ||
164 | offset += phdr.p_filesz; \ | ||
165 | } \ | ||
166 | else \ | ||
167 | phdr.p_offset += ofs; \ | ||
168 | phdr.p_paddr = 0; /* match other core phdrs */ \ | ||
169 | DUMP_WRITE(&phdr, sizeof(phdr)); \ | ||
170 | } \ | ||
171 | } | ||
172 | #define ELF_CORE_WRITE_EXTRA_DATA \ | ||
173 | if ( vsyscall_ehdr ) { \ | ||
174 | const struct elfhdr *const ehdrp = (struct elfhdr *)vsyscall_ehdr; \ | ||
175 | const struct elf_phdr *const phdrp = \ | ||
176 | (const struct elf_phdr *) (vsyscall_ehdr + ehdrp->e_phoff); \ | ||
177 | int i; \ | ||
178 | for (i = 0; i < ehdrp->e_phnum; ++i) { \ | ||
179 | if (phdrp[i].p_type == PT_LOAD) \ | ||
180 | DUMP_WRITE((void *) phdrp[i].p_vaddr, \ | ||
181 | phdrp[i].p_filesz); \ | ||
182 | } \ | ||
183 | } | ||
184 | |||
185 | #endif | ||
186 | |||
187 | /* | ||
188 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
189 | * Emacs will notice this stuff at the end of the file and automatically | ||
190 | * adjust the settings for this buffer only. This must remain at the end | ||
191 | * of the file. | ||
192 | * --------------------------------------------------------------------------- | ||
193 | * Local variables: | ||
194 | * c-file-style: "linux" | ||
195 | * End: | ||
196 | */ | ||
diff --git a/include/asm-um/setup.h b/include/asm-um/setup.h index c85252e803c1..99f086301f4c 100644 --- a/include/asm-um/setup.h +++ b/include/asm-um/setup.h | |||
@@ -2,7 +2,8 @@ | |||
2 | #define SETUP_H_INCLUDED | 2 | #define SETUP_H_INCLUDED |
3 | 3 | ||
4 | /* POSIX mandated with _POSIX_ARG_MAX that we can rely on 4096 chars in the | 4 | /* POSIX mandated with _POSIX_ARG_MAX that we can rely on 4096 chars in the |
5 | * command line, so this choice is ok.*/ | 5 | * command line, so this choice is ok. |
6 | */ | ||
6 | 7 | ||
7 | #define COMMAND_LINE_SIZE 4096 | 8 | #define COMMAND_LINE_SIZE 4096 |
8 | 9 | ||