diff --git a/arch/um/Makefile b/arch/um/Makefile index 45435ff589c17e8252008431e3ee659dedc08ed8..6430a6383853494fecb56d562ada5918d9df424c 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -32,7 +32,7 @@ um-modes-$(CONFIG_MODE_TT) += tt um-modes-$(CONFIG_MODE_SKAS) += skas MODE_INCLUDE += $(foreach mode,$(um-modes-y),\ - -I$(srctree)/$(ARCH_DIR)/kernel/$(mode)/include) + -I$(srctree)/$(ARCH_DIR)/include/$(mode)) MAKEFILES-INCL += $(foreach mode,$(um-modes-y),\ $(srctree)/$(ARCH_DIR)/Makefile-$(mode)) diff --git a/arch/um/include/mode_kern.h b/arch/um/include/mode_kern.h index 2d88afd0cf167e2477c27b650e37ac40f8e16967..e7539a8451efece50aa56d8ee1b37159b054f496 100644 --- a/arch/um/include/mode_kern.h +++ b/arch/um/include/mode_kern.h @@ -9,22 +9,11 @@ #include "linux/config.h" #ifdef CONFIG_MODE_TT -#include "mode_kern-tt.h" +#include "mode_kern_tt.h" #endif #ifdef CONFIG_MODE_SKAS -#include "mode_kern-skas.h" +#include "mode_kern_skas.h" #endif #endif - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ diff --git a/arch/um/kernel/skas/include/mm_id.h b/arch/um/include/skas/mm_id.h similarity index 100% rename from arch/um/kernel/skas/include/mm_id.h rename to arch/um/include/skas/mm_id.h diff --git a/arch/um/include/skas/mmu-skas.h b/arch/um/include/skas/mmu-skas.h new file mode 100644 index 0000000000000000000000000000000000000000..d8869a6ef1b43b43b2ae006be0f1126cd8ed628f --- /dev/null +++ b/arch/um/include/skas/mmu-skas.h @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#ifndef __SKAS_MMU_H +#define __SKAS_MMU_H + +#include "linux/config.h" +#include "mm_id.h" +#include "asm/ldt.h" + +struct mmu_context_skas { + struct mm_id id; + unsigned long last_page_table; +#ifdef CONFIG_3_LEVEL_PGTABLES + unsigned long last_pmd; +#endif + uml_ldt_t ldt; +}; + +extern void switch_mm_skas(struct mm_id * mm_idp); + +#endif diff --git a/arch/um/kernel/skas/include/mode-skas.h b/arch/um/include/skas/mode-skas.h similarity index 58% rename from arch/um/kernel/skas/include/mode-skas.h rename to arch/um/include/skas/mode-skas.h index bcd26a6a3888cce3a09df6f4fb9f8177d4d71219..64b960006f1e2914f720f8b9b370bb1adc5ac3a6 100644 --- a/arch/um/kernel/skas/include/mode-skas.h +++ b/arch/um/include/skas/mode-skas.h @@ -20,14 +20,3 @@ extern void kill_off_processes_skas(void); extern int is_skas_winch(int pid, int fd, void *data); #endif - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ diff --git a/arch/um/kernel/skas/include/mode_kern-skas.h b/arch/um/include/skas/mode_kern_skas.h similarity index 80% rename from arch/um/kernel/skas/include/mode_kern-skas.h rename to arch/um/include/skas/mode_kern_skas.h index c97a80dfe37052bb5bf8f51378ae0f809d29b15e..dd9f2d722fb93bff1cc8c2af38dc3f5f3425393e 100644 --- a/arch/um/kernel/skas/include/mode_kern-skas.h +++ b/arch/um/include/skas/mode_kern_skas.h @@ -39,14 +39,3 @@ extern int thread_pid_skas(struct task_struct *task); #define kmem_end_skas (host_task_size - 1024 * 1024) #endif - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ diff --git a/arch/um/kernel/skas/include/proc_mm.h b/arch/um/include/skas/proc_mm.h similarity index 60% rename from arch/um/kernel/skas/include/proc_mm.h rename to arch/um/include/skas/proc_mm.h index cce61a679052cc42174245136665d715f6a87b9c..9028092096033d0fdcdc4aff1dece32b239e64e2 100644 --- a/arch/um/kernel/skas/include/proc_mm.h +++ b/arch/um/include/skas/proc_mm.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) * Licensed under the GPL */ @@ -22,13 +22,13 @@ struct mm_mmap { struct mm_munmap { unsigned long addr; - unsigned long len; + unsigned long len; }; struct mm_mprotect { unsigned long addr; unsigned long len; - unsigned int prot; + unsigned int prot; }; struct proc_mm_op { @@ -42,14 +42,3 @@ struct proc_mm_op { }; #endif - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ diff --git a/arch/um/kernel/skas/include/skas.h b/arch/um/include/skas/skas.h similarity index 81% rename from arch/um/kernel/skas/include/skas.h rename to arch/um/include/skas/skas.h index a7f7cd556f1f8752e64350a7e9751e9df5a5fabf..158f322248e34a02ad35c7812ab448255ba4b4f5 100644 --- a/arch/um/kernel/skas/include/skas.h +++ b/arch/um/include/skas/skas.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) * Licensed under the GPL */ @@ -16,8 +16,8 @@ extern int skas_needs_stub; extern void switch_threads(void *me, void *next); extern void thread_wait(void *sw, void *fb); extern void new_thread(void *stack, void **switch_buf_ptr, void **fork_buf_ptr, - void (*handler)(int)); -extern int start_idle_thread(void *stack, void *switch_buf_ptr, + void (*handler)(int)); +extern int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr); extern int user_thread(unsigned long stack, int flags); extern void userspace(union uml_pt_regs *regs); @@ -40,10 +40,10 @@ extern void get_skas_faultinfo(int pid, struct faultinfo * fi); extern long execute_syscall_skas(void *r); extern unsigned long current_stub_stack(void); extern long run_syscall_stub(struct mm_id * mm_idp, - int syscall, unsigned long *args, long expected, - void **addr, int done); + int syscall, unsigned long *args, long expected, + void **addr, int done); extern long syscall_stub_data(struct mm_id * mm_idp, - unsigned long *data, int data_count, - void **addr, void **stub_addr); + unsigned long *data, int data_count, + void **addr, void **stub_addr); #endif diff --git a/arch/um/kernel/skas/include/stub-data.h b/arch/um/include/skas/stub-data.h similarity index 100% rename from arch/um/kernel/skas/include/stub-data.h rename to arch/um/include/skas/stub-data.h diff --git a/arch/um/kernel/skas/include/uaccess-skas.h b/arch/um/include/skas/uaccess-skas.h similarity index 63% rename from arch/um/kernel/skas/include/uaccess-skas.h rename to arch/um/include/skas/uaccess-skas.h index 64516c556cdf98a425b14d4d7c961babc224125d..224a75f4c02599a3cf314dd4146b6d1a92448858 100644 --- a/arch/um/kernel/skas/include/uaccess-skas.h +++ b/arch/um/include/skas/uaccess-skas.h @@ -19,14 +19,3 @@ extern int clear_user_skas(void __user *mem, int len); extern int strnlen_user_skas(const void __user *str, int len); #endif - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ diff --git a/arch/um/kernel/tt/include/debug.h b/arch/um/include/tt/debug.h similarity index 99% rename from arch/um/kernel/tt/include/debug.h rename to arch/um/include/tt/debug.h index 738435461e137ddf51ec54ca395677b5965ef037..9778fa8382965d26bf1b96cff96638b1b2180ee0 100644 --- a/arch/um/kernel/tt/include/debug.h +++ b/arch/um/include/tt/debug.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) and * Lars Brinkhoff. * Licensed under the GPL diff --git a/arch/um/include/tt/mmu-tt.h b/arch/um/include/tt/mmu-tt.h new file mode 100644 index 0000000000000000000000000000000000000000..572a78b225872422f10f142e9607126c24eba463 --- /dev/null +++ b/arch/um/include/tt/mmu-tt.h @@ -0,0 +1,12 @@ +/* + * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#ifndef __TT_MMU_H +#define __TT_MMU_H + +struct mmu_context_tt { +}; + +#endif diff --git a/arch/um/include/tt/mode-tt.h b/arch/um/include/tt/mode-tt.h new file mode 100644 index 0000000000000000000000000000000000000000..2823cd56eea28c970f4df5cb23bb31332521e633 --- /dev/null +++ b/arch/um/include/tt/mode-tt.h @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#ifndef __MODE_TT_H__ +#define __MODE_TT_H__ + +#include "sysdep/ptrace.h" + +enum { OP_NONE, OP_EXEC, OP_FORK, OP_TRACE_ON, OP_REBOOT, OP_HALT, OP_CB }; + +extern int tracing_pid; + +extern int tracer(int (*init_proc)(void *), void *sp); +extern void sig_handler_common_tt(int sig, void *sc); +extern void syscall_handler_tt(int sig, union uml_pt_regs *regs); +extern void reboot_tt(void); +extern void halt_tt(void); +extern int is_tracer_winch(int pid, int fd, void *data); +extern void kill_off_processes_tt(void); + +#endif diff --git a/arch/um/include/tt/mode_kern_tt.h b/arch/um/include/tt/mode_kern_tt.h new file mode 100644 index 0000000000000000000000000000000000000000..efa0012550d0145a1ad4b82ea97d45d008cf45a9 --- /dev/null +++ b/arch/um/include/tt/mode_kern_tt.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) + * Licensed under the GPL + */ + +#ifndef __TT_MODE_KERN_H__ +#define __TT_MODE_KERN_H__ + +#include "linux/sched.h" +#include "asm/page.h" +#include "asm/ptrace.h" +#include "asm/uaccess.h" + +extern void switch_to_tt(void *prev, void *next); +extern void flush_thread_tt(void); +extern void start_thread_tt(struct pt_regs *regs, unsigned long eip, + unsigned long esp); +extern int copy_thread_tt(int nr, unsigned long clone_flags, unsigned long sp, + unsigned long stack_top, struct task_struct *p, + struct pt_regs *regs); +extern void release_thread_tt(struct task_struct *task); +extern void initial_thread_cb_tt(void (*proc)(void *), void *arg); +extern void init_idle_tt(void); +extern void flush_tlb_kernel_range_tt(unsigned long start, unsigned long end); +extern void flush_tlb_kernel_vm_tt(void); +extern void __flush_tlb_one_tt(unsigned long addr); +extern void flush_tlb_range_tt(struct vm_area_struct *vma, + unsigned long start, unsigned long end); +extern void flush_tlb_mm_tt(struct mm_struct *mm); +extern void force_flush_all_tt(void); +extern long execute_syscall_tt(void *r); +extern void before_mem_tt(unsigned long brk_start); +extern unsigned long set_task_sizes_tt(int arg, unsigned long *host_size_out, + unsigned long *task_size_out); +extern int start_uml_tt(void); +extern int external_pid_tt(struct task_struct *task); +extern int thread_pid_tt(struct task_struct *task); + +#define kmem_end_tt (host_task_size - ABOVE_KMEM) + +#endif diff --git a/arch/um/kernel/tt/include/tt.h b/arch/um/include/tt/tt.h similarity index 73% rename from arch/um/kernel/tt/include/tt.h rename to arch/um/include/tt/tt.h index c667b67af405fc948396e9370e9c247f4d2e8a56..8085219801861938cae75cc5c25a7edaf53cead3 100644 --- a/arch/um/kernel/tt/include/tt.h +++ b/arch/um/include/tt/tt.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) * Licensed under the GPL */ @@ -34,13 +34,3 @@ extern long execute_syscall_tt(void *r); #endif -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ diff --git a/arch/um/kernel/tt/include/uaccess-tt.h b/arch/um/include/tt/uaccess-tt.h similarity index 80% rename from arch/um/kernel/tt/include/uaccess-tt.h rename to arch/um/include/tt/uaccess-tt.h index b9bfe9c481c4eadd31601623bbe2e9de89dec1ea..b19645f32f24d9e5853b11c65afc200e9fd7c42b 100644 --- a/arch/um/kernel/tt/include/uaccess-tt.h +++ b/arch/um/include/tt/uaccess-tt.h @@ -46,14 +46,3 @@ extern int clear_user_tt(void __user *mem, int len); extern int strnlen_user_tt(const void __user *str, int len); #endif - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ diff --git a/arch/um/kernel/skas/include/mmu-skas.h b/arch/um/kernel/skas/include/mmu-skas.h deleted file mode 100644 index 44110c521e498bb2d86033d3dea5e71584346804..0000000000000000000000000000000000000000 --- a/arch/um/kernel/skas/include/mmu-skas.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) - * Licensed under the GPL - */ - -#ifndef __SKAS_MMU_H -#define __SKAS_MMU_H - -#include "linux/config.h" -#include "mm_id.h" -#include "asm/ldt.h" - -struct mmu_context_skas { - struct mm_id id; - unsigned long last_page_table; -#ifdef CONFIG_3_LEVEL_PGTABLES - unsigned long last_pmd; -#endif - uml_ldt_t ldt; -}; - -extern void switch_mm_skas(struct mm_id * mm_idp); - -#endif - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ diff --git a/arch/um/kernel/tt/include/mmu-tt.h b/arch/um/kernel/tt/include/mmu-tt.h deleted file mode 100644 index 0440510ab3fe5c866e3afb7fcd933f7603b18db1..0000000000000000000000000000000000000000 --- a/arch/um/kernel/tt/include/mmu-tt.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) - * Licensed under the GPL - */ - -#ifndef __TT_MMU_H -#define __TT_MMU_H - -struct mmu_context_tt { -}; - -#endif - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */