diff options
Diffstat (limited to 'arch/x86/um')
| -rw-r--r-- | arch/x86/um/Kconfig | 5 | ||||
| -rw-r--r-- | arch/x86/um/asm/barrier.h | 4 | ||||
| -rw-r--r-- | arch/x86/um/asm/processor_32.h | 5 | ||||
| -rw-r--r-- | arch/x86/um/asm/processor_64.h | 5 | ||||
| -rw-r--r-- | arch/x86/um/elfcore.c | 15 | ||||
| -rw-r--r-- | arch/x86/um/sysrq_32.c | 66 | ||||
| -rw-r--r-- | arch/x86/um/sysrq_64.c | 8 | ||||
| -rw-r--r-- | arch/x86/um/vdso/.gitignore | 2 | ||||
| -rw-r--r-- | arch/x86/um/vdso/vma.c | 2 | 
9 files changed, 23 insertions, 89 deletions
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig index 14ef8d1dbc3..ed56a1c4ae7 100644 --- a/arch/x86/um/Kconfig +++ b/arch/x86/um/Kconfig @@ -31,6 +31,11 @@ config X86_64  	def_bool 64BIT  	select MODULES_USE_ELF_RELA +config ARCH_DEFCONFIG +	string +	default "arch/um/configs/i386_defconfig" if X86_32 +	default "arch/um/configs/x86_64_defconfig" if X86_64 +  config RWSEM_XCHGADD_ALGORITHM  	def_bool 64BIT diff --git a/arch/x86/um/asm/barrier.h b/arch/x86/um/asm/barrier.h index 7d01b8c56c0..cc04e67bfd0 100644 --- a/arch/x86/um/asm/barrier.h +++ b/arch/x86/um/asm/barrier.h @@ -40,11 +40,7 @@  #define smp_rmb()	barrier()  #endif /* CONFIG_X86_PPRO_FENCE */ -#ifdef CONFIG_X86_OOSTORE -#define smp_wmb()	wmb() -#else /* CONFIG_X86_OOSTORE */  #define smp_wmb()	barrier() -#endif /* CONFIG_X86_OOSTORE */  #define smp_read_barrier_depends()	read_barrier_depends()  #define set_mb(var, value) do { (void)xchg(&var, value); } while (0) diff --git a/arch/x86/um/asm/processor_32.h b/arch/x86/um/asm/processor_32.h index 6c6689e574c..c112de81c9e 100644 --- a/arch/x86/um/asm/processor_32.h +++ b/arch/x86/um/asm/processor_32.h @@ -33,6 +33,8 @@ struct arch_thread {  	.faultinfo		= { 0, 0, 0 } \  } +#define STACKSLOTS_PER_LINE 8 +  static inline void arch_flush_thread(struct arch_thread *thread)  {  	/* Clear any TLS still hanging */ @@ -53,4 +55,7 @@ static inline void arch_copy_thread(struct arch_thread *from,  #define current_text_addr() \  	({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; }) +#define current_sp() ({ void *sp; __asm__("movl %%esp, %0" : "=r" (sp) : ); sp; }) +#define current_bp() ({ unsigned long bp; __asm__("movl %%ebp, %0" : "=r" (bp) : ); bp; }) +  #endif diff --git a/arch/x86/um/asm/processor_64.h b/arch/x86/um/asm/processor_64.h index 4b02a8455bd..c3be85205a6 100644 --- a/arch/x86/um/asm/processor_64.h +++ b/arch/x86/um/asm/processor_64.h @@ -19,6 +19,8 @@ struct arch_thread {  			   .fs			= 0, \  			   .faultinfo		= { 0, 0, 0 } } +#define STACKSLOTS_PER_LINE 4 +  static inline void arch_flush_thread(struct arch_thread *thread)  {  } @@ -32,4 +34,7 @@ static inline void arch_copy_thread(struct arch_thread *from,  #define current_text_addr() \  	({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; }) +#define current_sp() ({ void *sp; __asm__("movq %%rsp, %0" : "=r" (sp) : ); sp; }) +#define current_bp() ({ unsigned long bp; __asm__("movq %%rbp, %0" : "=r" (bp) : ); bp; }) +  #endif diff --git a/arch/x86/um/elfcore.c b/arch/x86/um/elfcore.c index 6bb49b687c9..7bb89a27a5e 100644 --- a/arch/x86/um/elfcore.c +++ b/arch/x86/um/elfcore.c @@ -11,8 +11,7 @@ Elf32_Half elf_core_extra_phdrs(void)  	return vsyscall_ehdr ? (((struct elfhdr *)vsyscall_ehdr)->e_phnum) : 0;  } -int elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size, -			       unsigned long limit) +int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset)  {  	if ( vsyscall_ehdr ) {  		const struct elfhdr *const ehdrp = @@ -32,17 +31,14 @@ int elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,  				phdr.p_offset += ofs;  			}  			phdr.p_paddr = 0; /* match other core phdrs */ -			*size += sizeof(phdr); -			if (*size > limit -			    || !dump_write(file, &phdr, sizeof(phdr))) +			if (!dump_emit(cprm, &phdr, sizeof(phdr)))  				return 0;  		}  	}  	return 1;  } -int elf_core_write_extra_data(struct file *file, size_t *size, -			      unsigned long limit) +int elf_core_write_extra_data(struct coredump_params *cprm)  {  	if ( vsyscall_ehdr ) {  		const struct elfhdr *const ehdrp = @@ -55,10 +51,7 @@ int elf_core_write_extra_data(struct file *file, size_t *size,  			if (phdrp[i].p_type == PT_LOAD) {  				void *addr = (void *) phdrp[i].p_vaddr;  				size_t filesz = phdrp[i].p_filesz; - -				*size += filesz; -				if (*size > limit -				    || !dump_write(file, addr, filesz)) +				if (!dump_emit(cprm, addr, filesz))  					return 0;  			}  		} diff --git a/arch/x86/um/sysrq_32.c b/arch/x86/um/sysrq_32.c index c9bee5b8c0d..16ee0e450e3 100644 --- a/arch/x86/um/sysrq_32.c +++ b/arch/x86/um/sysrq_32.c @@ -30,70 +30,4 @@ void show_regs(struct pt_regs *regs)          printk(" DS: %04lx ES: %04lx\n",  	       0xffff & PT_REGS_DS(regs),   	       0xffff & PT_REGS_ES(regs)); - -        show_trace(NULL, (unsigned long *) ®s);  } - -/* Copied from i386. */ -static inline int valid_stack_ptr(struct thread_info *tinfo, void *p) -{ -	return	p > (void *)tinfo && -		p < (void *)tinfo + THREAD_SIZE - 3; -} - -/* Adapted from i386 (we also print the address we read from). */ -static inline unsigned long print_context_stack(struct thread_info *tinfo, -				unsigned long *stack, unsigned long ebp) -{ -	unsigned long addr; - -#ifdef CONFIG_FRAME_POINTER -	while (valid_stack_ptr(tinfo, (void *)ebp)) { -		addr = *(unsigned long *)(ebp + 4); -		printk("%08lx:  [<%08lx>]", ebp + 4, addr); -		print_symbol(" %s", addr); -		printk("\n"); -		ebp = *(unsigned long *)ebp; -	} -#else -	while (valid_stack_ptr(tinfo, stack)) { -		addr = *stack; -		if (__kernel_text_address(addr)) { -			printk("%08lx:  [<%08lx>]", (unsigned long) stack, addr); -			print_symbol(" %s", addr); -			printk("\n"); -		} -		stack++; -	} -#endif -	return ebp; -} - -void show_trace(struct task_struct* task, unsigned long * stack) -{ -	unsigned long ebp; -	struct thread_info *context; - -	/* Turn this into BUG_ON if possible. */ -	if (!stack) { -		stack = (unsigned long*) &stack; -		printk("show_trace: got NULL stack, implicit assumption task == current"); -		WARN_ON(1); -	} - -	if (!task) -		task = current; - -	if (task != current) { -		ebp = (unsigned long) KSTK_EBP(task); -	} else { -		asm ("movl %%ebp, %0" : "=r" (ebp) : ); -	} - -	context = (struct thread_info *) -		((unsigned long)stack & (~(THREAD_SIZE - 1))); -	print_context_stack(context, stack, ebp); - -	printk("\n"); -} - diff --git a/arch/x86/um/sysrq_64.c b/arch/x86/um/sysrq_64.c index a0e7fb1134a..38b4e4abd0f 100644 --- a/arch/x86/um/sysrq_64.c +++ b/arch/x86/um/sysrq_64.c @@ -12,7 +12,7 @@  #include <asm/ptrace.h>  #include <asm/sysrq.h> -void __show_regs(struct pt_regs *regs) +void show_regs(struct pt_regs *regs)  {  	printk("\n");  	print_modules(); @@ -33,9 +33,3 @@ void __show_regs(struct pt_regs *regs)  	printk(KERN_INFO "R13: %016lx R14: %016lx R15: %016lx\n",  	       PT_REGS_R13(regs), PT_REGS_R14(regs), PT_REGS_R15(regs));  } - -void show_regs(struct pt_regs *regs) -{ -	__show_regs(regs); -	show_trace(current, (unsigned long *) ®s); -} diff --git a/arch/x86/um/vdso/.gitignore b/arch/x86/um/vdso/.gitignore new file mode 100644 index 00000000000..9cac6d07219 --- /dev/null +++ b/arch/x86/um/vdso/.gitignore @@ -0,0 +1,2 @@ +vdso-syms.lds +vdso.lds diff --git a/arch/x86/um/vdso/vma.c b/arch/x86/um/vdso/vma.c index af91901babb..916cda4cd5b 100644 --- a/arch/x86/um/vdso/vma.c +++ b/arch/x86/um/vdso/vma.c @@ -12,7 +12,7 @@  #include <asm/page.h>  #include <linux/init.h> -unsigned int __read_mostly vdso_enabled = 1; +static unsigned int __read_mostly vdso_enabled = 1;  unsigned long um_vdso_addr;  extern unsigned long task_size;  | 
