UML - code tidying
PATCH 16/28 UML - code tidying
Some small cleanups that resulted from the x86_64 merge:
Some unneeded includes were removed
Some overlong lines were shortened current_thread_info was replaced by a generic version. Some warnings were fixed
Signed-off-by Jeff Dike <[email protected]>
arch/um/include/process.h +1 -1
@@ -6,7 +6,7 @@#ifndef __PROCESS_H__#define __PROCESS_H__ -#include <asm/sigcontext.h> +#include <signal.h> extern void sig_handler (int sig,struct sigcontext sc);extern void alarm_handler (int sig,struct sigcontext sc);
arch/um/kernel/mem.c +2 -0
@@ -173,6 +173,7 @@static void __init fixaddr_user_init (void ) { +#if FIXADDR_USER_START !=0 long size =FIXADDR_USER_END -FIXADDR_USER_START ;pgd_t *pgd;pmd_t *pmd;
@@ -192,6 +193,7 @@ pte =pte_offset_kernel (pmd, vaddr); pte_set_val( (*pte), paddr, PAGE_READONLY); } +#endif }void paging_init (void )
arch/um/kernel/mem_user.c +1 -3
@@ -48,8 +48,6 @@#include "tempfile.h" #include "kern_constants.h" -extern struct mem_region physmem_region; -#define TEMPNAME_TEMPLATE "vm_file-XXXXXX"static int create_tmp_file (unsigned long len)
@@ -135,7 +133,7 @@ addr =mmap (NULL , len,PROT_READ |PROT_WRITE ,MAP_PRIVATE , fd,0 );if (addr ==MAP_FAILED ){ -os_print_error ((int ) addr,"mapping physmem file" ); +perror ("mapping physmem file" );exit (1 ); }munmap (addr, len);
arch/um/kernel/process.c +2 -5
@@ -13,14 +13,10 @@#include <setjmp.h> #include <sys/time.h> #include <sys/ptrace.h> -#include <linux/ptrace.h> #include <sys/wait.h> #include <sys/mman.h> -#include <asm/ptrace.h> -#include <asm/sigcontext.h> #include <asm/unistd.h> #include <asm/page.h> -#include <asm/user.h> #include "user_util.h" #include "kern_util.h" #include "user.h"
@@ -28,6 +24,7 @@#include "signal_kern.h" #include "signal_user.h" #include "sysdep/ptrace.h" +#include "sysdep/ptrace_user.h" #include "sysdep/sigcontext.h" #include "irq_user.h" #include "ptrace_user.h"
@@ -331,7 +328,7 @@CATCH_EINTR (n =waitpid (pid, &status,WUNTRACED ));if (n <0 )panic ("check_ptrace : wait failed, errno = %d" , errno); -if (!WIFSTOPPED (status) || (WSTOPSIG (status) != (SIGTRAP +0x80 ))) +if (!WIFSTOPPED (status) || (WSTOPSIG (status) !=SIGTRAP +0x80 ))panic ("check_ptrace : expected SIGTRAP + 0x80, " "got status = %d" , status);
arch/um/kernel/skas/process.c +2 -1
@@ -73,7 +73,8 @@ "errno = %d\n", errno);CATCH_EINTR (err =waitpid (pid, &status,WUNTRACED )); -if ((err <0 ) || !WIFSTOPPED (status) || (WSTOPSIG (status) != (SIGTRAP +0x80 ))) +if ((err <0 ) || !WIFSTOPPED (status) || + (WSTOPSIG (status) !=SIGTRAP +0x80 ))panic ("handle_trap - failed to wait at end of syscall, " "errno = %d, status = %d\n" , errno, status); }
arch/um/kernel/skas/trap_user.c +0 -1
@@ -5,7 +5,6 @@#include <signal.h> #include <errno.h> -#include <asm/sigcontext.h> #include "sysdep/ptrace.h" #include "signal_user.h" #include "user_util.h"
arch/um/kernel/tt/ptproxy/sysdep.c +0 -1
@@ -12,7 +12,6 @@#include <errno.h> #include <sys/types.h> #include <sys/ptrace.h> -#include <asm/ptrace.h> #include <linux/unistd.h> #include "ptrace_user.h" #include "user_util.h"
arch/um/kernel/tt/ptproxy/wait.c +0 -1
@@ -10,7 +10,6 @@#include <signal.h> #include <sys/wait.h> #include <sys/ptrace.h> -#include <asm/ptrace.h> #include "ptproxy.h" #include "sysdep.h"
arch/um/kernel/tt/trap_user.c +0 -1
@@ -6,7 +6,6 @@#include <stdlib.h> #include <errno.h> #include <signal.h> -#include <asm/sigcontext.h> #include "sysdep/ptrace.h" #include "signal_user.h" #include "user_util.h"
arch/um/kernel/um_arch.c +5 -0
@@ -17,6 +17,7 @@#include "linux/sysrq.h" #include "linux/seq_file.h" #include "linux/delay.h" +#include "linux/module.h" #include "asm/page.h" #include "asm/pgtable.h" #include "asm/ptrace.h"
@@ -156,6 +157,8 @@ {printf ("%s\n" , system_utsname.release);exit (0 ); + +return 0 ; } __uml_setup("--version", uml_version_setup,
@@ -256,6 +259,8 @@ p++; }exit (0 ); + +return 0 ; } __uml_setup("--help", Usage,
arch/um/os-Linux/Makefile +2 -0
@@ -11,3 +11,5 @@ $(USER_OBJS) : %.o: %.c $(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $< + +CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH)
arch/um/os-Linux/elf_aux.c +0 -1
@@ -26,7 +26,6 @@unsigned long __kernel_vsyscall; -__init void scan_elf_aux (char **envp) {long page_size =0 ;
arch/um/os-Linux/user_syms.c +5 -3
@@ -26,9 +26,6 @@EXPORT_SYMBOL (strstr); -EXPORT_SYMBOL (vsyscall_ehdr); -EXPORT_SYMBOL (vsyscall_end); -/* Here, instead, I can provide a fake prototype. Yes, someone cares: genksyms. * However, the modules will use the CRC defined *here*, no matter if it is * good; so the versions of these symbols will always match
@@ -37,6 +34,11 @@int sym (void ); \EXPORT_SYMBOL (sym); +#ifdef SUBARCH_i386 +EXPORT_SYMBOL (vsyscall_ehdr); +EXPORT_SYMBOL (vsyscall_end); +#endif +EXPORT_SYMBOL_PROTO (__errno_location);EXPORT_SYMBOL_PROTO (access);
include/asm-um/processor-i386.h +2 -1
@@ -24,7 +24,8 @@* instruction pointer ("program counter"). Stolen * from asm-i386/processor.h */ -#define current_text_addr () ({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; }) +#define current_text_addr () \ + ({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; })#include "asm/processor-generic.h"
include/asm-um/thread_info.h +1 -1
@@ -47,7 +47,7 @@struct thread_info *ti;unsigned long mask =PAGE_SIZE * (1 <<CONFIG_KERNEL_STACK_ORDER ) -1 ; - __asm__("andl %%esp,%0; " :"=r" (ti) :"0" (~mask)); + ti = (struct thread_info *) (((unsigned long ) &ti) & ~mask);return ti; }