Commit df2649b4 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://uml.bkbits.net/updates-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 34d0d4c1 821e1161
...@@ -128,6 +128,7 @@ source "net/Kconfig" ...@@ -128,6 +128,7 @@ source "net/Kconfig"
source "fs/Kconfig" source "fs/Kconfig"
source "lib/Kconfig"
menu "SCSI support" menu "SCSI support"
......
...@@ -190,7 +190,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) ...@@ -190,7 +190,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
current->thread.request.u.thread.proc = fn; current->thread.request.u.thread.proc = fn;
current->thread.request.u.thread.arg = arg; current->thread.request.u.thread.arg = arg;
p = do_fork(CLONE_VM | flags, 0, NULL, 0, NULL); p = do_fork(CLONE_VM | flags, 0, NULL, 0, NULL, NULL);
if(IS_ERR(p)) panic("do_fork failed in kernel_thread"); if(IS_ERR(p)) panic("do_fork failed in kernel_thread");
return(p->pid); return(p->pid);
} }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "linux/binfmts.h" #include "linux/binfmts.h"
#include "asm/signal.h" #include "asm/signal.h"
#include "asm/uaccess.h" #include "asm/uaccess.h"
#include "asm/unistd.h"
#include "user_util.h" #include "user_util.h"
#include "kern_util.h" #include "kern_util.h"
#include "signal_kern.h" #include "signal_kern.h"
...@@ -69,6 +70,9 @@ static int handle_signal(struct pt_regs *regs, unsigned long signr, ...@@ -69,6 +70,9 @@ static int handle_signal(struct pt_regs *regs, unsigned long signr,
ret = 0; ret = 0;
switch(error){ switch(error){
case -ERESTART_RESTARTBLOCK:
current_thread_info()->restart_block.fn =
do_no_restart_syscall;
case -ERESTARTNOHAND: case -ERESTARTNOHAND:
ret = -EINTR; ret = -EINTR;
break; break;
...@@ -160,6 +164,10 @@ static int kern_do_signal(struct pt_regs *regs, sigset_t *oldset, int error) ...@@ -160,6 +164,10 @@ static int kern_do_signal(struct pt_regs *regs, sigset_t *oldset, int error)
PT_REGS_ORIG_SYSCALL(regs) = PT_REGS_SYSCALL_NR(regs); PT_REGS_ORIG_SYSCALL(regs) = PT_REGS_SYSCALL_NR(regs);
PT_REGS_RESTART_SYSCALL(regs); PT_REGS_RESTART_SYSCALL(regs);
} }
else if(PT_REGS_SYSCALL_RET(regs) == -ERESTART_RESTARTBLOCK){
PT_REGS_SYSCALL_RET(regs) = __NR_restart_syscall;
PT_REGS_RESTART_SYSCALL(regs);
}
} }
/* This closes a way to execute a system call on the host. If /* This closes a way to execute a system call on the host. If
......
...@@ -8,10 +8,12 @@ ...@@ -8,10 +8,12 @@
#include "linux/version.h" #include "linux/version.h"
#include "linux/sys.h" #include "linux/sys.h"
#include "linux/swap.h" #include "linux/swap.h"
#include "linux/sysctl.h"
#include "asm/signal.h" #include "asm/signal.h"
#include "sysdep/syscalls.h" #include "sysdep/syscalls.h"
#include "kern_util.h" #include "kern_util.h"
extern syscall_handler_t sys_restart_syscall;
extern syscall_handler_t sys_ni_syscall; extern syscall_handler_t sys_ni_syscall;
extern syscall_handler_t sys_exit; extern syscall_handler_t sys_exit;
extern syscall_handler_t sys_fork; extern syscall_handler_t sys_fork;
...@@ -125,10 +127,8 @@ extern syscall_handler_t sys_ni_syscall; ...@@ -125,10 +127,8 @@ extern syscall_handler_t sys_ni_syscall;
extern syscall_handler_t sys_adjtimex; extern syscall_handler_t sys_adjtimex;
extern syscall_handler_t sys_mprotect; extern syscall_handler_t sys_mprotect;
extern syscall_handler_t sys_sigprocmask; extern syscall_handler_t sys_sigprocmask;
extern syscall_handler_t sys_create_module;
extern syscall_handler_t sys_init_module; extern syscall_handler_t sys_init_module;
extern syscall_handler_t sys_delete_module; extern syscall_handler_t sys_delete_module;
extern syscall_handler_t sys_get_kernel_syms;
extern syscall_handler_t sys_quotactl; extern syscall_handler_t sys_quotactl;
extern syscall_handler_t sys_getpgid; extern syscall_handler_t sys_getpgid;
extern syscall_handler_t sys_fchdir; extern syscall_handler_t sys_fchdir;
...@@ -162,7 +162,6 @@ extern syscall_handler_t sys_mremap; ...@@ -162,7 +162,6 @@ extern syscall_handler_t sys_mremap;
extern syscall_handler_t sys_setresuid16; extern syscall_handler_t sys_setresuid16;
extern syscall_handler_t sys_getresuid16; extern syscall_handler_t sys_getresuid16;
extern syscall_handler_t sys_ni_syscall; extern syscall_handler_t sys_ni_syscall;
extern syscall_handler_t sys_query_module;
extern syscall_handler_t sys_poll; extern syscall_handler_t sys_poll;
extern syscall_handler_t sys_nfsservctl; extern syscall_handler_t sys_nfsservctl;
extern syscall_handler_t sys_setresgid16; extern syscall_handler_t sys_setresgid16;
...@@ -235,9 +234,10 @@ extern syscall_handler_t sys_epoll_create; ...@@ -235,9 +234,10 @@ extern syscall_handler_t sys_epoll_create;
extern syscall_handler_t sys_epoll_ctl; extern syscall_handler_t sys_epoll_ctl;
extern syscall_handler_t sys_epoll_wait; extern syscall_handler_t sys_epoll_wait;
extern syscall_handler_t sys_remap_file_pages; extern syscall_handler_t sys_remap_file_pages;
extern syscall_handler_t sys_set_tid_address;
#if CONFIG_NFSD #if CONFIG_NFSD
#define NFSSERVCTL sys_nfsserctl #define NFSSERVCTL sys_nfsservctl
#else #else
#define NFSSERVCTL sys_ni_syscall #define NFSSERVCTL sys_ni_syscall
#endif #endif
...@@ -246,7 +246,7 @@ extern syscall_handler_t um_mount; ...@@ -246,7 +246,7 @@ extern syscall_handler_t um_mount;
extern syscall_handler_t um_time; extern syscall_handler_t um_time;
extern syscall_handler_t um_stime; extern syscall_handler_t um_stime;
#define LAST_GENERIC_SYSCALL __NR_remap_file_pages #define LAST_GENERIC_SYSCALL __NR_set_tid_address
#if LAST_GENERIC_SYSCALL > LAST_ARCH_SYSCALL #if LAST_GENERIC_SYSCALL > LAST_ARCH_SYSCALL
#define LAST_SYSCALL LAST_GENERIC_SYSCALL #define LAST_SYSCALL LAST_GENERIC_SYSCALL
...@@ -255,7 +255,7 @@ extern syscall_handler_t um_stime; ...@@ -255,7 +255,7 @@ extern syscall_handler_t um_stime;
#endif #endif
syscall_handler_t *sys_call_table[] = { syscall_handler_t *sys_call_table[] = {
[ 0 ] = sys_ni_syscall, [ __NR_restart_syscall ] = sys_restart_syscall,
[ __NR_exit ] = sys_exit, [ __NR_exit ] = sys_exit,
[ __NR_fork ] = sys_fork, [ __NR_fork ] = sys_fork,
[ __NR_read ] = (syscall_handler_t *) sys_read, [ __NR_read ] = (syscall_handler_t *) sys_read,
...@@ -384,10 +384,10 @@ syscall_handler_t *sys_call_table[] = { ...@@ -384,10 +384,10 @@ syscall_handler_t *sys_call_table[] = {
[ __NR_adjtimex ] = sys_adjtimex, [ __NR_adjtimex ] = sys_adjtimex,
[ __NR_mprotect ] = sys_mprotect, [ __NR_mprotect ] = sys_mprotect,
[ __NR_sigprocmask ] = sys_sigprocmask, [ __NR_sigprocmask ] = sys_sigprocmask,
[ __NR_create_module ] = sys_create_module, [ __NR_create_module ] = sys_ni_syscall,
[ __NR_init_module ] = sys_init_module, [ __NR_init_module ] = sys_init_module,
[ __NR_delete_module ] = sys_delete_module, [ __NR_delete_module ] = sys_delete_module,
[ __NR_get_kernel_syms ] = sys_get_kernel_syms, [ __NR_get_kernel_syms ] = sys_ni_syscall,
[ __NR_quotactl ] = sys_quotactl, [ __NR_quotactl ] = sys_quotactl,
[ __NR_getpgid ] = sys_getpgid, [ __NR_getpgid ] = sys_getpgid,
[ __NR_fchdir ] = sys_fchdir, [ __NR_fchdir ] = sys_fchdir,
...@@ -424,7 +424,7 @@ syscall_handler_t *sys_call_table[] = { ...@@ -424,7 +424,7 @@ syscall_handler_t *sys_call_table[] = {
[ __NR_setresuid ] = sys_setresuid16, [ __NR_setresuid ] = sys_setresuid16,
[ __NR_getresuid ] = sys_getresuid16, [ __NR_getresuid ] = sys_getresuid16,
[ __NR_vm86 ] = sys_ni_syscall, [ __NR_vm86 ] = sys_ni_syscall,
[ __NR_query_module ] = sys_query_module, [ __NR_query_module ] = sys_ni_syscall,
[ __NR_poll ] = sys_poll, [ __NR_poll ] = sys_poll,
[ __NR_nfsservctl ] = NFSSERVCTL, [ __NR_nfsservctl ] = NFSSERVCTL,
[ __NR_setresgid ] = sys_setresgid16, [ __NR_setresgid ] = sys_setresgid16,
...@@ -489,6 +489,7 @@ syscall_handler_t *sys_call_table[] = { ...@@ -489,6 +489,7 @@ syscall_handler_t *sys_call_table[] = {
[ __NR_epoll_ctl ] = sys_epoll_ctl, [ __NR_epoll_ctl ] = sys_epoll_ctl,
[ __NR_epoll_wait ] = sys_epoll_wait, [ __NR_epoll_wait ] = sys_epoll_wait,
[ __NR_remap_file_pages ] = sys_remap_file_pages, [ __NR_remap_file_pages ] = sys_remap_file_pages,
[ __NR_set_tid_address ] = sys_set_tid_address,
ARCH_SYSCALLS ARCH_SYSCALLS
[ LAST_SYSCALL + 1 ... NR_syscalls ] = [ LAST_SYSCALL + 1 ... NR_syscalls ] =
......
...@@ -33,7 +33,7 @@ long sys_fork(void) ...@@ -33,7 +33,7 @@ long sys_fork(void)
struct task_struct *p; struct task_struct *p;
current->thread.forking = 1; current->thread.forking = 1;
p = do_fork(SIGCHLD, 0, NULL, 0, NULL); p = do_fork(SIGCHLD, 0, NULL, 0, NULL, NULL);
current->thread.forking = 0; current->thread.forking = 0;
return(IS_ERR(p) ? PTR_ERR(p) : p->pid); return(IS_ERR(p) ? PTR_ERR(p) : p->pid);
} }
...@@ -43,7 +43,7 @@ long sys_clone(unsigned long clone_flags, unsigned long newsp) ...@@ -43,7 +43,7 @@ long sys_clone(unsigned long clone_flags, unsigned long newsp)
struct task_struct *p; struct task_struct *p;
current->thread.forking = 1; current->thread.forking = 1;
p = do_fork(clone_flags, newsp, NULL, 0, NULL); p = do_fork(clone_flags, newsp, NULL, 0, NULL, NULL);
current->thread.forking = 0; current->thread.forking = 0;
return(IS_ERR(p) ? PTR_ERR(p) : p->pid); return(IS_ERR(p) ? PTR_ERR(p) : p->pid);
} }
...@@ -53,7 +53,7 @@ long sys_vfork(void) ...@@ -53,7 +53,7 @@ long sys_vfork(void)
struct task_struct *p; struct task_struct *p;
current->thread.forking = 1; current->thread.forking = 1;
p = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0, NULL, 0, NULL); p = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0, NULL, 0, NULL, NULL);
current->thread.forking = 0; current->thread.forking = 0;
return(IS_ERR(p) ? PTR_ERR(p) : p->pid); return(IS_ERR(p) ? PTR_ERR(p) : p->pid);
} }
...@@ -182,7 +182,11 @@ int sys_ipc (uint call, int first, int second, ...@@ -182,7 +182,11 @@ int sys_ipc (uint call, int first, int second,
switch (call) { switch (call) {
case SEMOP: case SEMOP:
return sys_semop (first, (struct sembuf *)ptr, second); return sys_semtimedop(first, (struct sembuf *) ptr, second,
NULL);
case SEMTIMEDOP:
return sys_semtimedop(first, (struct sembuf *) ptr, second,
(const struct timespec *) fifth);
case SEMGET: case SEMGET:
return sys_semget (first, second, third); return sys_semget (first, second, third);
case SEMCTL: { case SEMCTL: {
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
#ifdef CONFIG_MODULES #ifdef CONFIG_MODULES
extern struct module *module_list; /* FIXME: Accessed without a lock --RR */
extern struct module kernel_module; extern struct list_head modules;
static inline int kernel_text_address(unsigned long addr) static inline int kernel_text_address(unsigned long addr)
{ {
...@@ -31,11 +31,11 @@ static inline int kernel_text_address(unsigned long addr) ...@@ -31,11 +31,11 @@ static inline int kernel_text_address(unsigned long addr)
addr <= (unsigned long) &_etext) addr <= (unsigned long) &_etext)
return 1; return 1;
for (mod = module_list; mod != &kernel_module; mod = mod->next) { list_for_each_entry(mod, &modules, list) {
/* mod_bound tests for addr being inside the vmalloc'ed /* mod_bound tests for addr being inside the vmalloc'ed
* module area. Of course it'd be better to test only * module area. Of course it'd be better to test only
* for the .text subset... */ * for the .text subset... */
if (mod_bound(addr, 0, mod)) { if (mod_bound((void *) addr, 0, mod)) {
retval = 1; retval = 1;
break; break;
} }
......
obj-y = bugs.o checksum.o extable.o fault.o ksyms.o ldt.o \ obj-y = bugs.o checksum.o extable.o fault.o ksyms.o ldt.o module.o \
ptrace.o ptrace_user.o semaphore.o sigcontext.o syscalls.o sysrq.o ptrace.o ptrace_user.o semaphore.o sigcontext.o syscalls.o sysrq.o
obj-$(CONFIG_HIGHMEM) += highmem.o obj-$(CONFIG_HIGHMEM) += highmem.o
...@@ -6,28 +6,26 @@ obj-$(CONFIG_HIGHMEM) += highmem.o ...@@ -6,28 +6,26 @@ obj-$(CONFIG_HIGHMEM) += highmem.o
export-objs = ksyms.o export-objs = ksyms.o
USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o
USER_OBJS := $(foreach file,$(USER_OBJS),arch/um/sys-i386/$(file)) USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
SYMLINKS = semaphore.c checksum.S extable.c highmem.c SYMLINKS = semaphore.c extable.c highmem.c module.c
$(USER_OBJS) : %.o: %.c semaphore.c-dir = kernel
$(CC) $(CFLAGS_$@) $(USER_CFLAGS) -c -o $@ $< extable.c-dir = mm
highmem.c-dir = mm
module.c-dir = kernel
arch/um/sys-i386/checksum.S: define make_link
-rm -f $@ -rm -f $1
-ln -s $(TOPDIR)/arch/i386/lib/$(notdir $@) $@ ln -sf $(TOPDIR)/arch/i386/$($(notdir $1)-dir)/$(notdir $1) $1
endef
arch/um/sys-i386/semaphore.c: $(USER_OBJS) : %.o: %.c
-rm -f $@ $(CC) $(CFLAGS_$(notdir $@)) $(USER_CFLAGS) -c -o $@ $<
-ln -s $(TOPDIR)/arch/i386/kernel/$(notdir $@) $@
arch/um/sys-i386/extable.c: $(foreach f,$(SYMLINKS),$(src)/$f):
-rm -f $@ $(call make_link,$@)
-ln -s $(TOPDIR)/arch/i386/mm/$(notdir $@) $@
arch/um/sys-i386/highmem.c:
-rm -f $@
-ln -s $(TOPDIR)/arch/i386/mm/$(notdir $@) $@
clean: clean:
$(MAKE) -C util clean $(MAKE) -C util clean
......
...@@ -38,6 +38,7 @@ SECTIONS ...@@ -38,6 +38,7 @@ SECTIONS
__ex_table : { *(__ex_table) } __ex_table : { *(__ex_table) }
__stop___ex_table = .; __stop___ex_table = .;
. = ALIGN(64);
__start___ksymtab = .; /* Kernel symbol table */ __start___ksymtab = .; /* Kernel symbol table */
__ksymtab : { *(__ksymtab) } __ksymtab : { *(__ksymtab) }
__stop___ksymtab = .; __stop___ksymtab = .;
...@@ -58,18 +59,27 @@ SECTIONS ...@@ -58,18 +59,27 @@ SECTIONS
__uml_setup_start = .; __uml_setup_start = .;
.uml.setup.init : { *(.uml.setup.init) } .uml.setup.init : { *(.uml.setup.init) }
__uml_setup_end = .; __uml_setup_end = .;
__uml_help_start = .; __uml_help_start = .;
.uml.help.init : { *(.uml.help.init) } .uml.help.init : { *(.uml.help.init) }
__uml_help_end = .; __uml_help_end = .;
__uml_postsetup_start = .; __uml_postsetup_start = .;
.uml.postsetup.init : { *(.uml.postsetup.init) } .uml.postsetup.init : { *(.uml.postsetup.init) }
__uml_postsetup_end = .; __uml_postsetup_end = .;
__setup_start = .; __setup_start = .;
.init.setup : { *(.init.setup) } .init.setup : { *(.init.setup) }
__setup_end = .; __setup_end = .;
__start___param = .;
__param : { *(__param) }
__stop___param = .;
__per_cpu_start = . ; __per_cpu_start = . ;
.data.percpu : { *(.data.percpu) } .data.percpu : { *(.data.percpu) }
__per_cpu_end = . ; __per_cpu_end = . ;
__initcall_start = .; __initcall_start = .;
.initcall.init : { .initcall.init : {
*(.initcall1.init) *(.initcall1.init)
......
...@@ -373,15 +373,15 @@ static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address) ...@@ -373,15 +373,15 @@ static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
} }
/* Find an entry in the third-level page table.. */ /* Find an entry in the third-level page table.. */
#define __pte_offset(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) #define __pte_offset(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
#define pte_offset_kernel(dir, address) \ #define pte_offset_kernel(dir, address) \
((pte_t *) pmd_page_kernel(*(dir)) + __pte_offset(address)) ((pte_t *) pmd_page_kernel(*(dir)) + __pte_offset(address))
#define pte_offset_map(dir, address) \ #define pte_offset_map(dir, address) \
((pte_t *)kmap_atomic(pmd_page(*(dir)),KM_PTE0) + __pte_offset(address)) ((pte_t *)kmap_atomic(pmd_page(*(dir)),KM_PTE0) + __pte_offset(address))
#define pte_offset_map_nested(dir, address) \ #define pte_offset_map_nested(dir, address) \
((pte_t *)kmap_atomic(pmd_page(*(dir)),KM_PTE1) + __pte_offset(address)) ((pte_t *)kmap_atomic(pmd_page(*(dir)),KM_PTE1) + __pte_offset(address))
#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0) #define pte_unmap(pte) kunmap_atomic((pte), KM_PTE0)
#define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1) #define pte_unmap_nested(pte) kunmap_atomic((pte), KM_PTE1)
#if defined(CONFIG_HIGHPTE) && defined(CONFIG_HIGHMEM4G) #if defined(CONFIG_HIGHPTE) && defined(CONFIG_HIGHMEM4G)
typedef u32 pte_addr_t; typedef u32 pte_addr_t;
......
...@@ -20,14 +20,9 @@ struct thread_info { ...@@ -20,14 +20,9 @@ struct thread_info {
mm_segment_t addr_limit; /* thread address space: mm_segment_t addr_limit; /* thread address space:
0-0xBFFFFFFF for user 0-0xBFFFFFFF for user
0-0xFFFFFFFF for kernel */ 0-0xFFFFFFFF for kernel */
struct restart_block restart_block;
}; };
/*
* macros/functions for gaining access to the thread information structure
*
* preempt_count needs to be 1 initially, until the scheduler is functional.
*/
#define INIT_THREAD_INFO(tsk) \ #define INIT_THREAD_INFO(tsk) \
{ \ { \
task: &tsk, \ task: &tsk, \
...@@ -36,6 +31,9 @@ struct thread_info { ...@@ -36,6 +31,9 @@ struct thread_info {
cpu: 0, \ cpu: 0, \
preempt_count: 1, \ preempt_count: 1, \
addr_limit: KERNEL_DS, \ addr_limit: KERNEL_DS, \
restart_block: { \
fn: do_no_restart_syscall, \
}, \
} }
#define init_thread_info (init_thread_union.thread_info) #define init_thread_info (init_thread_union.thread_info)
......
...@@ -164,7 +164,7 @@ static inline int clear_user(void *mem, int len) ...@@ -164,7 +164,7 @@ static inline int clear_user(void *mem, int len)
extern int __do_strnlen_user(const char *str, unsigned long n, extern int __do_strnlen_user(const char *str, unsigned long n,
void **fault_addr, void **fault_catcher); void **fault_addr, void **fault_catcher);
static inline int strnlen_user(void *str, int len) static inline int strnlen_user(const void *str, int len)
{ {
return(__do_strnlen_user(str, len, return(__do_strnlen_user(str, len,
&current->thread.fault_addr, &current->thread.fault_addr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment