]> git.hungrycats.org Git - linux/commitdiff
[PATCH] UML: code tidying
authorJeff Dike <jdike@addtoit.com>
Tue, 11 Jan 2005 11:14:48 +0000 (03:14 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 11 Jan 2005 11:14:48 +0000 (03:14 -0800)
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 <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
15 files changed:
arch/um/include/process.h
arch/um/kernel/mem.c
arch/um/kernel/mem_user.c
arch/um/kernel/process.c
arch/um/kernel/skas/process.c
arch/um/kernel/skas/trap_user.c
arch/um/kernel/tt/ptproxy/sysdep.c
arch/um/kernel/tt/ptproxy/wait.c
arch/um/kernel/tt/trap_user.c
arch/um/kernel/um_arch.c
arch/um/os-Linux/Makefile
arch/um/os-Linux/elf_aux.c
arch/um/os-Linux/user_syms.c
include/asm-um/processor-i386.h
include/asm-um/thread_info.h

index 07af218574fdf3b1eaa57bca03d58a5e73793fcb..5af9157ff54fb0e300350bff1678340167d08848 100644 (file)
@@ -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);
index e8a2c9c5716b401f5e55eda7dc35acc4ebf1f977..f95e90ae9c8898c9fd4e2ac9c3fc653f52dff73f 100644 (file)
@@ -173,6 +173,7 @@ static void init_highmem(void)
 
 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 @@ static void __init fixaddr_user_init( void)
                pte = pte_offset_kernel(pmd, vaddr);
                pte_set_val( (*pte), paddr, PAGE_READONLY);
        }
+#endif
 }
 
 void paging_init(void)
index 33f71e76495177a79c2d6634e3b080571a48fffa..4a663fd434bbaf30e851094efe947044b95695b8 100644 (file)
@@ -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 @@ static int create_anon_file(unsigned long len)
 
        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);
index 0fca3f073c86b3157ed252a399412392887c17c0..1e638b8131996f1b50bd08d01b2606b9e5c421cb 100644 (file)
 #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 @@ void __init check_ptrace(void)
                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);
                
index 4b368908e5a4503070369d62c5b0836bf077964d..2fc18a123dae22c69e004f34c59e6ac1b420064d 100644 (file)
@@ -73,7 +73,8 @@ static void handle_trap(int pid, union uml_pt_regs *regs, int local_using_sysemu
                              "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);
        }
index 96593709a6e169c9b9a40ee5b480004d6d235062..09248772de60591f06de220b2ba242129dc1dc4d 100644 (file)
@@ -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"
index c42855aeda60521a91269287a4c60aa2b9ffcc5e..4545ea4f27e1649e48b3e8174696a749f78bf3db 100644 (file)
@@ -12,7 +12,6 @@ terms and conditions.
 #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"
index 86ef67653e726132920e96f18ae60d22cea4cb4e..fcb7ea50fc7e60bba66a709212f2394c5349eefa 100644 (file)
@@ -10,7 +10,6 @@ terms and conditions.
 #include <signal.h>
 #include <sys/wait.h>
 #include <sys/ptrace.h>
-#include <asm/ptrace.h>
 
 #include "ptproxy.h"
 #include "sysdep.h"
index 00bacacfcc35294f7a0a3f079796f55fd5598af2..67fdef69d54eedb7131b3171a11075bf4990ac13 100644 (file)
@@ -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"
index 1ce25f89f8acf38086d92d481513dcac781e4a63..8096843e4d4cbad4edb74d3b88f2b7b9db7ee5bb 100644 (file)
@@ -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 @@ static int __init uml_version_setup(char *line, int *add)
 {
        printf("%s\n", system_utsname.release);
        exit(0);
+
+       return 0;
 }
 
 __uml_setup("--version", uml_version_setup,
@@ -256,6 +259,8 @@ static int __init Usage(char *line, int *add)
                p++;
        }
        exit(0);
+
+       return 0;
 }
 
 __uml_setup("--help", Usage,
index 9d88f68977dfc692a5a6db739313dbc4d97d47f2..f8378124be135758dacbe7aada76c1e2daaaaa48 100644 (file)
@@ -11,3 +11,5 @@ USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
 
 $(USER_OBJS) : %.o: %.c
        $(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
+
+CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH)
index 36575ff8bfac7e0d9d45803097f2768543f3e621..9aee0b62ebca19c1551242c49c3e11ed17ad0baf 100644 (file)
@@ -26,7 +26,6 @@ unsigned long vsyscall_end;
 
 unsigned long __kernel_vsyscall;
 
-
 __init void scan_elf_aux( char **envp)
 {
        long page_size = 0;
index 383ac7b52beb0a73b4680c57fd07d3df35f998f7..75d7af9ae1d2268ae145be5c02fc41dec739d423 100644 (file)
@@ -26,9 +26,6 @@ EXPORT_SYMBOL(printf);
 
 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 @@ EXPORT_SYMBOL(vsyscall_end);
        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);
index b276481cc6cbe2a19abf5bb7c11f5c54a443cab7..cb44bb56836f3b8524b9516f3f3da11942445041 100644 (file)
@@ -24,7 +24,8 @@ struct arch_thread {
  * 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"
 
index 6550ed4355c295fcc2fb17c1d597e93cd1a57a2d..7797873890c2b870db734febc95ce963aac73ee6 100644 (file)
@@ -47,7 +47,7 @@ static inline struct thread_info *current_thread_info(void)
        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;
 }