UML - Tidy kern_util.h
PATCH 3/5 UML - Tidy kern_util.h
Tidy kern_util.h. It turns out that most of the function declarations aren't used, so they can go away. os.h no longer includes kern_util.h, so files which got it through os.h now need to include it directly. A number of other files never needed it, so these includes are deleted.
The structure which was used to pass signal handlers from the kernel side to the userspace side is gone. Instead, the handlers are declared here, and used directly from libc code. This allows arch/um/os-Linux/trap.c to be deleted, with its remnants being moved to arch/um/os-Linux/skas/trap.c.
arch/um/os-Linux/tty.c had its inclusions changed, and it needed some style attention, so it got tidied.
--- arch/um/drivers/line.c | 1 arch/um/drivers/ssl.c | 1 arch/um/drivers/stdio_console.c | 1 arch/um/drivers/ubd_kern.c | 1 arch/um/drivers/ubd_user.c | 1 arch/um/include/kern_util.h | 118 +++++++++------------------------ arch/um/include/os.h | 4 - arch/um/kernel/initrd.c | 1 arch/um/kernel/reboot.c | 1 arch/um/kernel/smp.c | 1 arch/um/kernel/trap.c | 15 ---- arch/um/kernel/um_arch.c | 6 - arch/um/os-Linux/Makefile | 4 - arch/um/os-Linux/aio.c | 1 arch/um/os-Linux/drivers/tuntap_user.c | 1 arch/um/os-Linux/file.c | 1 arch/um/os-Linux/irq.c | 1 arch/um/os-Linux/mem.c | 1 arch/um/os-Linux/signal.c | 1 arch/um/os-Linux/skas/process.c | 1 arch/um/os-Linux/skas/trap.c | 18 +++-- arch/um/os-Linux/trap.c | 23 ------ arch/um/os-Linux/tty.c | 55 +++++++-------- arch/um/os-Linux/tty_log.c | 1 arch/um/sys-i386/bugs.c | 1 25 files changed, 88 insertions(+), 172 deletions(-)
arch/um/drivers/line.c +1 -0
@@ -8,6 +8,7 @@#include "chan_kern.h" #include "irq_kern.h" #include "irq_user.h" +#include "kern_util.h" #include "os.h" #define LINE_BUFSIZE 4096
arch/um/drivers/ssl.c +0 -1
@@ -15,7 +15,6 @@#include "line.h" #include "ssl.h" #include "chan_kern.h" -#include "kern_util.h" #include "kern.h" #include "init.h" #include "irq_user.h"
arch/um/drivers/stdio_console.c +0 -1
@@ -22,7 +22,6 @@#include "stdio_console.h" #include "line.h" #include "chan_kern.h" -#include "kern_util.h" #include "irq_user.h" #include "mconsole_kern.h" #include "init.h"
arch/um/drivers/ubd_kern.c +1 -0
@@ -49,6 +49,7 @@#include "irq_user.h" #include "irq_kern.h" #include "ubd_user.h" +#include "kern_util.h" #include "os.h" #include "mem.h" #include "mem_kern.h"
arch/um/drivers/ubd_user.c +0 -1
@@ -16,7 +16,6 @@#include <sys/mman.h> #include <sys/param.h> #include "asm/types.h" -#include "kern_util.h" #include "user.h" #include "ubd_user.h" #include "os.h"
arch/um/include/kern_util.h +35 -83
142 lines not on this page · raw message
arch/um/include/os.h +0 -4
@@ -8,7 +8,6 @@#include <stdarg.h> #include "irq_user.h" -#include "kern_util.h" #include "longjmp.h" #include "mm_id.h" #include "sysdep/tls.h"
@@ -237,9 +236,6 @@ extern void unblock_signals(void);extern int get_signals (void );extern int set_signals (int enable); -/* trap.c */ -extern void os_fill_handlinfo (struct kern_handlers h); -/* util.c */ extern void stack_protections (unsigned long address);extern int raw (int fd);
arch/um/kernel/initrd.c +0 -1
@@ -7,7 +7,6 @@#include "linux/bootmem.h" #include "linux/initrd.h" #include "asm/types.h" -#include "kern_util.h" #include "initrd.h" #include "init.h" #include "os.h"
arch/um/kernel/reboot.c +1 -0
@@ -4,6 +4,7 @@*/ #include "linux/sched.h" +#include "kern_util.h" #include "os.h" #include "skas.h"
arch/um/kernel/smp.c +0 -1
@@ -21,7 +21,6 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_ga#include "asm/smp.h" #include "asm/processor.h" #include "asm/spinlock.h" -#include "kern_util.h" #include "kern.h" #include "irq_user.h" #include "os.h"
arch/um/kernel/trap.c +3 -12
@@ -128,7 +128,7 @@ static void bad_segv(struct faultinfo fiforce_sig_info (SIGSEGV , &si, current); } -static void segv_handler (int sig,struct uml_pt_regs *regs) +void segv_handler (int sig,struct uml_pt_regs *regs) {struct faultinfo * fi =UPT_FAULTINFO (regs);
@@ -229,27 +229,18 @@ void relay_signal(int sig, struct uml_ptforce_sig (sig, current); } -static void bus_handler (int sig,struct uml_pt_regs *regs) +void bus_handler (int sig,struct uml_pt_regs *regs) {if (current->thread.fault_catcher !=NULL )UML_LONGJMP (current->thread.fault_catcher,1 );else relay_signal (sig, regs); } -static void winch (int sig,struct uml_pt_regs *regs) +void winch (int sig,struct uml_pt_regs *regs) {do_IRQ (WINCH_IRQ , regs); } -const struct kern_handlers handlinfo_kern = { - .relay_signal = relay_signal, - .winch = winch, - .bus_handler = bus_handler, - .page_fault = segv_handler, - .sigio_handler = sigio_handler, - .timer_handler = timer_handler -}; -void trap_init (void ) { }
arch/um/kernel/um_arch.c +1 -5
@@ -16,6 +16,7 @@#include "as-layout.h" #include "init.h" #include "kern.h" +#include "kern_util.h" #include "mem_user.h" #include "os.h" #include "skas.h"
@@ -280,11 +281,6 @@ int __init linux_main(int argc, char **a host_task_size =set_task_sizes_skas (&task_size); -/* -* Setting up handlers to 'sig_info' struct -*/ -os_fill_handlinfo (handlinfo_kern); - brk_start = (unsigned long )sbrk (0 );/*
arch/um/os-Linux/Makefile +2 -2
@@ -4,7 +4,7 @@ # obj-y = aio.o elf_aux.o execvp.o file.o helper.o irq.o main.o mem.o process.o \ - registers.o sigio.o signal.o start_up.o time.o trap.o tty.o uaccess.o \ + registers.o sigio.o signal.o start_up.o time.o tty.o uaccess.o \ umid.o tls.o user_syms.o util.o drivers/ sys-$(SUBARCH)/ skas/ obj-$(CONFIG_TTY_LOG) += tty_log.o
@@ -12,7 +12,7 @@ user-objs-$(CONFIG_TTY_LOG) += tty_log.o USER_OBJS := $(user-objs-y) aio.o elf_aux.o execvp.o file.o helper.o irq.o \ main.o mem.o process.o registers.o sigio.o signal.o start_up.o time.o \ - trap.o tty.o tls.o uaccess.o umid.o util.o + tty.o tls.o uaccess.o umid.o util.o CFLAGS_user_syms.o += -DSUBARCH_$(SUBARCH)
arch/um/os-Linux/aio.c +1 -0
@@ -12,6 +12,7 @@#include "aio.h" #include "init.h" #include "kern_constants.h" +#include "kern_util.h" #include "os.h" #include "user.h"
arch/um/os-Linux/drivers/tuntap_user.c +1 -0
@@ -14,6 +14,7 @@#include <sys/wait.h> #include <sys/uio.h> #include "kern_constants.h" +#include "kern_util.h" #include "os.h" #include "tuntap.h" #include "user.h"
arch/um/os-Linux/file.c +0 -1
@@ -17,7 +17,6 @@#include <sys/uio.h> #include "os.h" #include "user.h" -#include "kern_util.h" static void copy_stat (struct uml_stat *dst,const struct stat64 *src) {
arch/um/os-Linux/irq.c +0 -1
@@ -11,7 +11,6 @@#include <sys/poll.h> #include <sys/types.h> #include <sys/time.h> -#include "kern_util.h" #include "user.h" #include "process.h" #include "sigio.h"
arch/um/os-Linux/mem.c +0 -1
@@ -9,7 +9,6 @@#include <sys/types.h> #include <sys/mman.h> #include <sys/statfs.h> -#include "kern_util.h" #include "user.h" #include "mem_user.h" #include "init.h"
arch/um/os-Linux/signal.c +1 -0
@@ -9,6 +9,7 @@#include <errno.h> #include <signal.h> #include <strings.h> +#include "kern_util.h" #include "os.h" #include "sysdep/barrier.h" #include "sysdep/sigcontext.h"
arch/um/os-Linux/skas/process.c +1 -0
@@ -15,6 +15,7 @@#include "as-layout.h" #include "chan_user.h" #include "kern_constants.h" +#include "kern_util.h" #include "mem.h" #include "os.h" #include "process.h"
arch/um/os-Linux/skas/trap.c +11 -7
@@ -3,22 +3,26 @@* Licensed under the GPL */ -#if 0 -#include "kern_util.h" -#include "skas.h" -#include "ptrace_user.h" -#include "sysdep/ptrace_user.h" -#endif -#include <errno.h> #include <signal.h> #include "sysdep/ptrace.h" #include "kern_constants.h" #include "as-layout.h" +#include "kern_util.h" #include "os.h" #include "sigcontext.h" #include "task.h" +void (*sig_info[NSIG ])(int ,struct uml_pt_regs *) = { + [SIGTRAP ] = relay_signal, + [SIGFPE ] = relay_signal, + [SIGILL ] = relay_signal, + [SIGWINCH ] = winch, + [SIGBUS ] = bus_handler, + [SIGSEGV ] = segv_handler, + [SIGIO ] = sigio_handler, + [SIGVTALRM ] = timer_handler }; +static struct uml_pt_regs ksig_regs[UM_NR_CPUS ];void sig_handler_common_skas (int sig,void *sc_ptr)
arch/um/os-Linux/trap.c deleted +0 -23
@@ -1,23 +0,0 @@ -/* -* Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) -* Licensed under the GPL -*/ - -#include <signal.h> -#include "os.h" -#include "sysdep/ptrace.h" - -/* Initialized from linux_main() */ -void (*sig_info[NSIG ])(int ,struct uml_pt_regs *); - -void os_fill_handlinfo (struct kern_handlers h) -{ - sig_info[SIGTRAP ] = h.relay_signal; - sig_info[SIGFPE ] = h.relay_signal; - sig_info[SIGILL ] = h.relay_signal; - sig_info[SIGWINCH ] = h.winch; - sig_info[SIGBUS ] = h.bus_handler; - sig_info[SIGSEGV ] = h.page_fault; - sig_info[SIGIO ] = h.sigio_handler; - sig_info[SIGVTALRM ] = h.timer_handler; -}
arch/um/os-Linux/tty.c +28 -27
77 lines not on this page · raw message
arch/um/os-Linux/tty_log.c +0 -1
@@ -12,7 +12,6 @@#include <sys/time.h> #include "init.h" #include "user.h" -#include "kern_util.h" #include "os.h" #define TTY_LOG_DIR "./"
arch/um/sys-i386/bugs.c +1 -0
@@ -5,6 +5,7 @@#include <signal.h> #include "kern_constants.h" +#include "kern_util.h" #include "longjmp.h" #include "task.h" #include "user.h"
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel