diff --git a/[refs] b/[refs] index 632ce63db3a2..a1ec366ef5ee 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4f58802fae8a51d9e79454746584175c14f84519 +refs/heads/master: 6d1cfbab4de64f2d0c5b0f81177ade0d75b69288 diff --git a/trunk/arch/arm/kernel/entry-armv.S b/trunk/arch/arm/kernel/entry-armv.S index e14278d59882..4eb36155dc93 100644 --- a/trunk/arch/arm/kernel/entry-armv.S +++ b/trunk/arch/arm/kernel/entry-armv.S @@ -269,7 +269,7 @@ __pabt_svc: add r5, sp, #S_PC ldmia r7, {r2 - r4} @ Get USR pc, cpsr -#if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG) +#if __LINUX_ARM_ARCH__ < 6 @ make sure our user space atomic helper is aborted cmp r2, #VIRT_OFFSET bichs r3, r3, #PSR_Z_BIT @@ -616,17 +616,11 @@ __kuser_helper_start: __kuser_cmpxchg: @ 0xffff0fc0 -#if defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG) +#if __LINUX_ARM_ARCH__ < 6 - /* - * Poor you. No fast solution possible... - * The kernel itself must perform the operation. - * A special ghost syscall is used for that (see traps.c). - */ - swi #0x9ffff0 - mov pc, lr - -#elif __LINUX_ARM_ARCH__ < 6 +#ifdef CONFIG_SMP /* sanity check */ +#error "CONFIG_SMP on a machine supporting pre-ARMv6 processors?" +#endif /* * Theory of operation: diff --git a/trunk/arch/arm/kernel/traps.c b/trunk/arch/arm/kernel/traps.c index 45d2a032d890..14df16b983f4 100644 --- a/trunk/arch/arm/kernel/traps.c +++ b/trunk/arch/arm/kernel/traps.c @@ -464,55 +464,6 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs) #endif return 0; -#ifdef CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG - /* - * Atomically store r1 in *r2 if *r2 is equal to r0 for user space. - * Return zero in r0 if *MEM was changed or non-zero if no exchange - * happened. Also set the user C flag accordingly. - * If access permissions have to be fixed up then non-zero is - * returned and the operation has to be re-attempted. - * - * *NOTE*: This is a ghost syscall private to the kernel. Only the - * __kuser_cmpxchg code in entry-armv.S should be aware of its - * existence. Don't ever use this from user code. - */ - case 0xfff0: - { - extern void do_DataAbort(unsigned long addr, unsigned int fsr, - struct pt_regs *regs); - unsigned long val; - unsigned long addr = regs->ARM_r2; - struct mm_struct *mm = current->mm; - pgd_t *pgd; pmd_t *pmd; pte_t *pte; - - regs->ARM_cpsr &= ~PSR_C_BIT; - spin_lock(&mm->page_table_lock); - pgd = pgd_offset(mm, addr); - if (!pgd_present(*pgd)) - goto bad_access; - pmd = pmd_offset(pgd, addr); - if (!pmd_present(*pmd)) - goto bad_access; - pte = pte_offset_map(pmd, addr); - if (!pte_present(*pte) || !pte_write(*pte)) - goto bad_access; - val = *(unsigned long *)addr; - val -= regs->ARM_r0; - if (val == 0) { - *(unsigned long *)addr = regs->ARM_r1; - regs->ARM_cpsr |= PSR_C_BIT; - } - spin_unlock(&mm->page_table_lock); - return val; - - bad_access: - spin_unlock(&mm->page_table_lock); - /* simulate a read access fault */ - do_DataAbort(addr, 15 + (1 << 11), regs); - return -1; - } -#endif - default: /* Calls 9f00xx..9f07ff are defined to return -ENOSYS if not implemented, rather than raising SIGILL. This diff --git a/trunk/arch/arm/lib/io-writesw-armv4.S b/trunk/arch/arm/lib/io-writesw-armv4.S index 5e240e452af6..6d1d7c27806e 100644 --- a/trunk/arch/arm/lib/io-writesw-armv4.S +++ b/trunk/arch/arm/lib/io-writesw-armv4.S @@ -87,9 +87,9 @@ ENTRY(__raw_writesw) subs r2, r2, #2 orr ip, ip, r3, push_hbyte1 strh ip, [r0] - bpl 1b + bpl 2b - tst r2, #1 -3: movne ip, r3, lsr #8 +3: tst r2, #1 +2: movne ip, r3, lsr #8 strneh ip, [r0] mov pc, lr diff --git a/trunk/arch/arm/mm/Kconfig b/trunk/arch/arm/mm/Kconfig index 3fefb43c67f7..ade0e2222f59 100644 --- a/trunk/arch/arm/mm/Kconfig +++ b/trunk/arch/arm/mm/Kconfig @@ -422,11 +422,3 @@ config HAS_TLS_REG assume directly accessing that register and always obtain the expected value only on ARMv7 and above. -config NEEDS_SYSCALL_FOR_CMPXCHG - bool - default y if SMP && (CPU_32v5 || CPU_32v4 || CPU_32v3) - help - SMP on a pre-ARMv6 processor? Well OK then. - Forget about fast user space cmpxchg support. - It is just not possible. - diff --git a/trunk/arch/i386/kernel/Makefile b/trunk/arch/i386/kernel/Makefile index 51ecd512603d..0fbcfe00dd8d 100644 --- a/trunk/arch/i386/kernel/Makefile +++ b/trunk/arch/i386/kernel/Makefile @@ -43,7 +43,7 @@ obj-$(CONFIG_SCx200) += scx200.o # Note: kbuild does not track this dependency due to usage of .incbin $(obj)/vsyscall.o: $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so) -targets += vsyscall-note.o vsyscall.lds +targets += vsyscall.lds # The DSO images are built using a special linker script. quiet_cmd_syscall = SYSCALL $@ diff --git a/trunk/arch/ia64/kernel/module.c b/trunk/arch/ia64/kernel/module.c index f1aca7cffd12..febc091c2f02 100644 --- a/trunk/arch/ia64/kernel/module.c +++ b/trunk/arch/ia64/kernel/module.c @@ -825,16 +825,14 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind * XXX Should have an arch-hook for running this after final section * addresses have been selected... */ - uint64_t gp; - if (mod->core_size > MAX_LTOFF) + /* See if gp can cover the entire core module: */ + uint64_t gp = (uint64_t) mod->module_core + MAX_LTOFF / 2; + if (mod->core_size >= MAX_LTOFF) /* * This takes advantage of fact that SHF_ARCH_SMALL gets allocated * at the end of the module. */ - gp = mod->core_size - MAX_LTOFF / 2; - else - gp = mod->core_size / 2; - gp = (uint64_t) mod->module_core + ((gp + 7) & -8); + gp = (uint64_t) mod->module_core + mod->core_size - MAX_LTOFF / 2; mod->arch.gp = gp; DEBUGP("%s: placing gp at 0x%lx\n", __FUNCTION__, gp); } diff --git a/trunk/arch/ia64/kernel/ptrace.c b/trunk/arch/ia64/kernel/ptrace.c index 575a8f657b31..08c8a5eb25ab 100644 --- a/trunk/arch/ia64/kernel/ptrace.c +++ b/trunk/arch/ia64/kernel/ptrace.c @@ -635,17 +635,11 @@ ia64_flush_fph (struct task_struct *task) { struct ia64_psr *psr = ia64_psr(ia64_task_regs(task)); - /* - * Prevent migrating this task while - * we're fiddling with the FPU state - */ - preempt_disable(); if (ia64_is_local_fpu_owner(task) && psr->mfh) { psr->mfh = 0; task->thread.flags |= IA64_THREAD_FPH_VALID; ia64_save_fpu(&task->thread.fph[0]); } - preempt_enable(); } /* diff --git a/trunk/arch/ia64/kernel/setup.c b/trunk/arch/ia64/kernel/setup.c index d14692e0920a..b7e6b4cb374b 100644 --- a/trunk/arch/ia64/kernel/setup.c +++ b/trunk/arch/ia64/kernel/setup.c @@ -720,8 +720,7 @@ cpu_init (void) ia64_set_kr(IA64_KR_PT_BASE, __pa(ia64_imva(empty_zero_page))); /* - * Initialize default control register to defer speculative faults except - * for those arising from TLB misses, which are not deferred. The + * Initialize default control register to defer all speculative faults. The * kernel MUST NOT depend on a particular setting of these bits (in other words, * the kernel must have recovery code for all speculative accesses). Turn on * dcr.lc as per recommendation by the architecture team. Most IA-32 apps diff --git a/trunk/arch/ia64/kernel/traps.c b/trunk/arch/ia64/kernel/traps.c index 1861173bd4f6..e82ad78081b3 100644 --- a/trunk/arch/ia64/kernel/traps.c +++ b/trunk/arch/ia64/kernel/traps.c @@ -111,24 +111,6 @@ ia64_bad_break (unsigned long break_num, struct pt_regs *regs) siginfo_t siginfo; int sig, code; - /* break.b always sets cr.iim to 0, which causes problems for - * debuggers. Get the real break number from the original instruction, - * but only for kernel code. User space break.b is left alone, to - * preserve the existing behaviour. All break codings have the same - * format, so there is no need to check the slot type. - */ - if (break_num == 0 && !user_mode(regs)) { - struct ia64_psr *ipsr = ia64_psr(regs); - unsigned long *bundle = (unsigned long *)regs->cr_iip; - unsigned long slot; - switch (ipsr->ri) { - case 0: slot = (bundle[0] >> 5); break; - case 1: slot = (bundle[0] >> 46) | (bundle[1] << 18); break; - default: slot = (bundle[1] >> 23); break; - } - break_num = ((slot >> 36 & 1) << 20) | (slot >> 6 & 0xfffff); - } - /* SIGILL, SIGFPE, SIGSEGV, and SIGBUS want these field initialized: */ siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri); siginfo.si_imm = break_num; @@ -220,21 +202,13 @@ disabled_fph_fault (struct pt_regs *regs) /* first, grant user-level access to fph partition: */ psr->dfh = 0; - - /* - * Make sure that no other task gets in on this processor - * while we're claiming the FPU - */ - preempt_disable(); #ifndef CONFIG_SMP { struct task_struct *fpu_owner = (struct task_struct *)ia64_get_kr(IA64_KR_FPU_OWNER); - if (ia64_is_local_fpu_owner(current)) { - preempt_enable_no_resched(); + if (ia64_is_local_fpu_owner(current)) return; - } if (fpu_owner) ia64_flush_fph(fpu_owner); @@ -252,7 +226,6 @@ disabled_fph_fault (struct pt_regs *regs) */ psr->mfh = 1; } - preempt_enable_no_resched(); } static inline int diff --git a/trunk/arch/ia64/mm/init.c b/trunk/arch/ia64/mm/init.c index 4eb2f52b87a1..547785e3cba2 100644 --- a/trunk/arch/ia64/mm/init.c +++ b/trunk/arch/ia64/mm/init.c @@ -305,9 +305,8 @@ setup_gate (void) struct page *page; /* - * Map the gate page twice: once read-only to export the ELF - * headers etc. and once execute-only page to enable - * privilege-promotion via "epc": + * Map the gate page twice: once read-only to export the ELF headers etc. and once + * execute-only page to enable privilege-promotion via "epc": */ page = virt_to_page(ia64_imva(__start_gate_section)); put_kernel_page(page, GATE_ADDR, PAGE_READONLY); @@ -316,20 +315,6 @@ setup_gate (void) put_kernel_page(page, GATE_ADDR + PAGE_SIZE, PAGE_GATE); #else put_kernel_page(page, GATE_ADDR + PERCPU_PAGE_SIZE, PAGE_GATE); - /* Fill in the holes (if any) with read-only zero pages: */ - { - unsigned long addr; - - for (addr = GATE_ADDR + PAGE_SIZE; - addr < GATE_ADDR + PERCPU_PAGE_SIZE; - addr += PAGE_SIZE) - { - put_kernel_page(ZERO_PAGE(0), addr, - PAGE_READONLY); - put_kernel_page(ZERO_PAGE(0), addr + PERCPU_PAGE_SIZE, - PAGE_READONLY); - } - } #endif ia64_patch_gate(); } diff --git a/trunk/arch/ia64/sn/kernel/setup.c b/trunk/arch/ia64/sn/kernel/setup.c index 44bfc7f318cb..e64cb8175f7a 100644 --- a/trunk/arch/ia64/sn/kernel/setup.c +++ b/trunk/arch/ia64/sn/kernel/setup.c @@ -222,7 +222,7 @@ void __init early_sn_setup(void) extern int platform_intr_list[]; extern nasid_t master_nasid; -static int __initdata shub_1_1_found = 0; +static int shub_1_1_found __initdata; /* * sn_check_for_wars @@ -251,7 +251,7 @@ static void __init sn_check_for_wars(void) } else { for_each_online_node(cnode) { if (is_shub_1_1(cnodeid_to_nasid(cnode))) - shub_1_1_found = 1; + sn_hub_info->shub_1_1_found = 1; } } } diff --git a/trunk/arch/ppc/kernel/cputable.c b/trunk/arch/ppc/kernel/cputable.c index 17abf6cd0d90..d44b7dc5390a 100644 --- a/trunk/arch/ppc/kernel/cputable.c +++ b/trunk/arch/ppc/kernel/cputable.c @@ -849,17 +849,6 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, }, - { /* 405EP */ - .pvr_mask = 0xffff0000, - .pvr_value = 0x51210000, - .cpu_name = "405EP", - .cpu_features = CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_USE_TB, - .cpu_user_features = PPC_FEATURE_32 | - PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, - .icache_bsize = 32, - .dcache_bsize = 32, - }, #endif /* CONFIG_40x */ #ifdef CONFIG_44x diff --git a/trunk/arch/ppc64/boot/prom.c b/trunk/arch/ppc64/boot/prom.c index d5218b15824e..7b607d1862cb 100644 --- a/trunk/arch/ppc64/boot/prom.c +++ b/trunk/arch/ppc64/boot/prom.c @@ -11,23 +11,6 @@ #include #include -extern __u32 __div64_32(unsigned long long *dividend, __u32 divisor); - -/* The unnecessary pointer compare is there - * to check for type safety (n must be 64bit) - */ -# define do_div(n,base) ({ \ - __u32 __base = (base); \ - __u32 __rem; \ - (void)(((typeof((n)) *)0) == ((unsigned long long *)0)); \ - if (((n) >> 32) == 0) { \ - __rem = (__u32)(n) % __base; \ - (n) = (__u32)(n) / __base; \ - } else \ - __rem = __div64_32(&(n), __base); \ - __rem; \ - }) - int (*prom)(void *); void *chosen_handle; @@ -369,7 +352,7 @@ static int skip_atoi(const char **s) #define SPECIAL 32 /* 0x */ #define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ -static char * number(char * str, unsigned long long num, int base, int size, int precision, int type) +static char * number(char * str, long num, int base, int size, int precision, int type) { char c,sign,tmp[66]; const char *digits="0123456789abcdefghijklmnopqrstuvwxyz"; @@ -384,9 +367,9 @@ static char * number(char * str, unsigned long long num, int base, int size, int c = (type & ZEROPAD) ? '0' : ' '; sign = 0; if (type & SIGN) { - if ((signed long long)num < 0) { + if (num < 0) { sign = '-'; - num = - (signed long long)num; + num = -num; size--; } else if (type & PLUS) { sign = '+'; @@ -406,7 +389,8 @@ static char * number(char * str, unsigned long long num, int base, int size, int if (num == 0) tmp[i++]='0'; else while (num != 0) { - tmp[i++] = digits[do_div(num, base)]; + tmp[i++] = digits[num % base]; + num /= base; } if (i > precision) precision = i; @@ -442,7 +426,7 @@ int sprintf(char * buf, const char *fmt, ...); int vsprintf(char *buf, const char *fmt, va_list args) { int len; - unsigned long long num; + unsigned long num; int i, base; char * str; const char *s; diff --git a/trunk/arch/ppc64/kernel/kprobes.c b/trunk/arch/ppc64/kernel/kprobes.c index e950a2058a19..103daaf73573 100644 --- a/trunk/arch/ppc64/kernel/kprobes.c +++ b/trunk/arch/ppc64/kernel/kprobes.c @@ -45,17 +45,12 @@ static struct pt_regs jprobe_saved_regs; int arch_prepare_kprobe(struct kprobe *p) { - int ret = 0; kprobe_opcode_t insn = *p->addr; - if ((unsigned long)p->addr & 0x03) { - printk("Attempt to register kprobe at an unaligned address\n"); - ret = -EINVAL; - } else if (IS_MTMSRD(insn) || IS_RFID(insn)) { - printk("Cannot register a kprobe on rfid or mtmsrd\n"); - ret = -EINVAL; - } - return ret; + if (IS_MTMSRD(insn) || IS_RFID(insn)) + /* cannot put bp on RFID/MTMSRD */ + return 1; + return 0; } void arch_copy_kprobe(struct kprobe *p) @@ -177,6 +172,8 @@ static void resume_execution(struct kprobe *p, struct pt_regs *regs) ret = emulate_step(regs, p->ainsn.insn[0]); if (ret == 0) regs->nip = (unsigned long)p->addr + 4; + + regs->msr &= ~MSR_SE; } static inline int post_kprobe_handler(struct pt_regs *regs) @@ -213,7 +210,6 @@ static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr) if (kprobe_status & KPROBE_HIT_SS) { resume_execution(current_kprobe, regs); - regs->msr &= ~MSR_SE; regs->msr |= kprobe_saved_msr; unlock_kprobes(); @@ -237,6 +233,8 @@ int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val, */ preempt_disable(); switch (val) { + case DIE_IABR_MATCH: + case DIE_DABR_MATCH: case DIE_BPT: if (kprobe_handler(args->regs)) ret = NOTIFY_STOP; diff --git a/trunk/arch/um/Kconfig_char b/trunk/arch/um/Kconfig_char index 62d87b71179b..3e50fdb67626 100644 --- a/trunk/arch/um/Kconfig_char +++ b/trunk/arch/um/Kconfig_char @@ -204,11 +204,5 @@ config UML_RANDOM http://sourceforge.net/projects/gkernel/). rngd periodically reads /dev/hwrng and injects the entropy into /dev/random. -config MMAPPER - tristate "iomem emulation driver" - help - This driver allows a host file to be used as emulated IO memory inside - UML. - endmenu diff --git a/trunk/arch/um/drivers/chan_user.c b/trunk/arch/um/drivers/chan_user.c index 5d3768156c92..583b8e137c33 100644 --- a/trunk/arch/um/drivers/chan_user.c +++ b/trunk/arch/um/drivers/chan_user.c @@ -143,22 +143,22 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out) { struct winch_data data; unsigned long stack; - int fds[2], n, err; + int fds[2], pid, n, err; char c; err = os_pipe(fds, 1, 1); if(err < 0){ printk("winch_tramp : os_pipe failed, err = %d\n", -err); - goto out; + return(err); } data = ((struct winch_data) { .pty_fd = fd, .pipe_fd = fds[1], .close_me = fds[0] } ); - err = run_helper_thread(winch_thread, &data, 0, &stack, 0); - if(err < 0){ + pid = run_helper_thread(winch_thread, &data, 0, &stack, 0); + if(pid < 0){ printk("fork of winch_thread failed - errno = %d\n", errno); - goto out_close; + return(pid); } os_close_file(fds[1]); @@ -168,22 +168,14 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out) printk("winch_tramp : failed to read synchronization byte\n"); printk("read failed, err = %d\n", -n); printk("fd %d will not support SIGWINCH\n", fd); - err = -EINVAL; - goto out_close1; + *fd_out = -1; } - return err ; - - out_close: - os_close_file(fds[1]); - out_close1: - os_close_file(fds[0]); - out: - return err; + return(pid); } void register_winch(int fd, struct tty_struct *tty) { - int pid, thread, thread_fd = -1; + int pid, thread, thread_fd; int count; char c = 1; @@ -194,7 +186,7 @@ void register_winch(int fd, struct tty_struct *tty) if(!CHOOSE_MODE_PROC(is_tracer_winch, is_skas_winch, pid, fd, tty) && (pid == -1)){ thread = winch_tramp(fd, tty, &thread_fd); - if(thread > 0){ + if(fd != -1){ register_winch_irq(thread_fd, fd, thread, tty); count = os_write_file(thread_fd, &c, sizeof(c)); diff --git a/trunk/arch/um/drivers/mmapper_kern.c b/trunk/arch/um/drivers/mmapper_kern.c index a37a5ac13c22..a63231dffe05 100644 --- a/trunk/arch/um/drivers/mmapper_kern.c +++ b/trunk/arch/um/drivers/mmapper_kern.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -118,39 +117,24 @@ static struct file_operations mmapper_fops = { .release = mmapper_release, }; -static struct miscdevice mmapper_dev = { - .minor = MISC_DYNAMIC_MINOR, - .name = "mmapper", - .fops = &mmapper_fops -}; - static int __init mmapper_init(void) { - int err; - printk(KERN_INFO "Mapper v0.1\n"); v_buf = (char *) find_iomem("mmapper", &mmapper_size); if(mmapper_size == 0){ printk(KERN_ERR "mmapper_init - find_iomem failed\n"); - goto out; - } - - err = misc_register(&mmapper_dev); - if(err){ - printk(KERN_ERR "mmapper - misc_register failed, err = %d\n", - err); - goto out; + return(0); } p_buf = __pa(v_buf); -out: - return 0; + + devfs_mk_cdev(MKDEV(30, 0), S_IFCHR|S_IRUGO|S_IWUGO, "mmapper"); + return(0); } static void mmapper_exit(void) { - misc_deregister(&mmapper_dev); } module_init(mmapper_init); diff --git a/trunk/arch/um/drivers/net_user.c b/trunk/arch/um/drivers/net_user.c index 3730d4f12713..47229fe4a813 100644 --- a/trunk/arch/um/drivers/net_user.c +++ b/trunk/arch/um/drivers/net_user.c @@ -32,7 +32,7 @@ int tap_open_common(void *dev, char *gate_addr) return(0); } -void tap_check_ips(char *gate_addr, unsigned char *eth_addr) +void tap_check_ips(char *gate_addr, char *eth_addr) { int tap_addr[4]; diff --git a/trunk/arch/um/drivers/slip.h b/trunk/arch/um/drivers/slip.h index d523618cd5ac..495f2f1b1420 100644 --- a/trunk/arch/um/drivers/slip.h +++ b/trunk/arch/um/drivers/slip.h @@ -12,8 +12,8 @@ struct slip_data { char *addr; char *gate_addr; int slave; - unsigned char ibuf[ENC_BUF_SIZE]; - unsigned char obuf[ENC_BUF_SIZE]; + char ibuf[ENC_BUF_SIZE]; + char obuf[ENC_BUF_SIZE]; int more; /* more data: do not read fd until ibuf has been drained */ int pos; int esc; diff --git a/trunk/arch/um/drivers/slip_proto.h b/trunk/arch/um/drivers/slip_proto.h index 4c4d94a33100..7206361ace45 100644 --- a/trunk/arch/um/drivers/slip_proto.h +++ b/trunk/arch/um/drivers/slip_proto.h @@ -12,8 +12,7 @@ #define SLIP_ESC_END 0334 /* ESC ESC_END means END 'data' */ #define SLIP_ESC_ESC 0335 /* ESC ESC_ESC means ESC 'data' */ -static inline int slip_unesc(unsigned char c, unsigned char *buf, int *pos, - int *esc) +static inline int slip_unesc(unsigned char c,char *buf,int *pos, int *esc) { int ret; diff --git a/trunk/arch/um/drivers/slirp.h b/trunk/arch/um/drivers/slirp.h index afa4e30284fd..04e407d1e44a 100644 --- a/trunk/arch/um/drivers/slirp.h +++ b/trunk/arch/um/drivers/slirp.h @@ -24,8 +24,8 @@ struct slirp_data { struct arg_list_dummy_wrapper argw; int pid; int slave; - unsigned char ibuf[ENC_BUF_SIZE]; - unsigned char obuf[ENC_BUF_SIZE]; + char ibuf[ENC_BUF_SIZE]; + char obuf[ENC_BUF_SIZE]; int more; /* more data: do not read fd until ibuf has been drained */ int pos; int esc; diff --git a/trunk/arch/um/drivers/stderr_console.c b/trunk/arch/um/drivers/stderr_console.c index 429ae8e6c7e5..98565b53d170 100644 --- a/trunk/arch/um/drivers/stderr_console.c +++ b/trunk/arch/um/drivers/stderr_console.c @@ -22,9 +22,9 @@ static void stderr_console_write(struct console *console, const char *string, } static struct console stderr_console = { - .name = "stderr", - .write = stderr_console_write, - .flags = CON_PRINTBUFFER, + .name "stderr", + .write stderr_console_write, + .flags CON_PRINTBUFFER, }; static int __init stderr_console_init(void) diff --git a/trunk/arch/um/include/mconsole.h b/trunk/arch/um/include/mconsole.h index cfa368e045a5..9fbe3083fdd8 100644 --- a/trunk/arch/um/include/mconsole.h +++ b/trunk/arch/um/include/mconsole.h @@ -56,7 +56,7 @@ struct mc_request int as_interrupt; int originating_fd; - unsigned int originlen; + int originlen; unsigned char origin[128]; /* sockaddr_un */ struct mconsole_request request; diff --git a/trunk/arch/um/include/net_user.h b/trunk/arch/um/include/net_user.h index 89885a77a771..36807b796e9f 100644 --- a/trunk/arch/um/include/net_user.h +++ b/trunk/arch/um/include/net_user.h @@ -35,7 +35,7 @@ extern void *get_output_buffer(int *len_out); extern void free_output_buffer(void *buffer); extern int tap_open_common(void *dev, char *gate_addr); -extern void tap_check_ips(char *gate_addr, unsigned char *eth_addr); +extern void tap_check_ips(char *gate_addr, char *eth_addr); extern void read_output(int fd, char *output_out, int len); diff --git a/trunk/arch/um/include/os.h b/trunk/arch/um/include/os.h index 881d2988d2d8..d246d5a24609 100644 --- a/trunk/arch/um/include/os.h +++ b/trunk/arch/um/include/os.h @@ -136,7 +136,7 @@ extern int os_seek_file(int fd, __u64 offset); extern int os_open_file(char *file, struct openflags flags, int mode); extern int os_read_file(int fd, void *buf, int len); extern int os_write_file(int fd, const void *buf, int count); -extern int os_file_size(char *file, unsigned long long *size_out); +extern int os_file_size(char *file, long long *size_out); extern int os_file_modtime(char *file, unsigned long *modtime); extern int os_pipe(int *fd, int stream, int close_on_exec); extern int os_set_fd_async(int fd, int owner); diff --git a/trunk/arch/um/include/user_util.h b/trunk/arch/um/include/user_util.h index 7b6a24dfd302..b8c5b8a95250 100644 --- a/trunk/arch/um/include/user_util.h +++ b/trunk/arch/um/include/user_util.h @@ -41,6 +41,9 @@ extern unsigned long highmem; extern char host_info[]; extern char saved_command_line[]; +extern char command_line[]; + +extern char *tempdir; extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end; extern unsigned long _unprotected_end; diff --git a/trunk/arch/um/kernel/skas/process_kern.c b/trunk/arch/um/kernel/skas/process_kern.c index fc71ef295782..ab5d3271da0b 100644 --- a/trunk/arch/um/kernel/skas/process_kern.c +++ b/trunk/arch/um/kernel/skas/process_kern.c @@ -68,11 +68,8 @@ void new_thread_handler(int sig) * 0 if it just exits */ n = run_kernel_thread(fn, arg, ¤t->thread.exec_buf); - if(n == 1){ - /* Handle any immediate reschedules or signals */ - interrupt_end(); + if(n == 1) userspace(¤t->thread.regs.regs); - } else do_exit(0); } @@ -99,8 +96,6 @@ void fork_handler(int sig) schedule_tail(current->thread.prev_sched); current->thread.prev_sched = NULL; - /* Handle any immediate reschedules or signals */ - interrupt_end(); userspace(¤t->thread.regs.regs); } diff --git a/trunk/arch/um/os-Linux/elf_aux.c b/trunk/arch/um/os-Linux/elf_aux.c index f0d6060e3e57..9aee0b62ebca 100644 --- a/trunk/arch/um/os-Linux/elf_aux.c +++ b/trunk/arch/um/os-Linux/elf_aux.c @@ -45,11 +45,7 @@ __init void scan_elf_aux( char **envp) elf_aux_hwcap = auxv->a_un.a_val; break; case AT_PLATFORM: - /* elf.h removed the pointer elements from - * a_un, so we have to use a_val, which is - * all that's left. - */ - elf_aux_platform = (char *) auxv->a_un.a_val; + elf_aux_platform = auxv->a_un.a_ptr; break; case AT_PAGESZ: page_size = auxv->a_un.a_val; diff --git a/trunk/arch/um/os-Linux/file.c b/trunk/arch/um/os-Linux/file.c index fd45bb260907..77d4066d1af8 100644 --- a/trunk/arch/um/os-Linux/file.c +++ b/trunk/arch/um/os-Linux/file.c @@ -363,7 +363,7 @@ int os_write_file(int fd, const void *buf, int len) (int (*)(int, void *, int)) write, copy_to_user_proc)); } -int os_file_size(char *file, unsigned long long *size_out) +int os_file_size(char *file, long long *size_out) { struct uml_stat buf; int err; diff --git a/trunk/arch/x86_64/kernel/aperture.c b/trunk/arch/x86_64/kernel/aperture.c index 504e63474993..a491f72cc966 100644 --- a/trunk/arch/x86_64/kernel/aperture.c +++ b/trunk/arch/x86_64/kernel/aperture.c @@ -33,11 +33,13 @@ int fallback_aper_force __initdata = 0; int fix_aperture __initdata = 1; -/* This code runs before the PCI subsystem is initialized, so just - access the northbridge directly. */ - #define NB_ID_3 (PCI_VENDOR_ID_AMD | (0x1103<<16)) +static struct resource aper_res = { + .name = "Aperture", + .flags = IORESOURCE_MEM, +}; + static u32 __init allocate_aperture(void) { #ifdef CONFIG_DISCONTIGMEM @@ -53,11 +55,24 @@ static u32 __init allocate_aperture(void) aper_size = (32 * 1024 * 1024) << fallback_aper_order; /* - * Aperture has to be naturally aligned. This means an 2GB aperture won't - * have much chances to find a place in the lower 4GB of memory. - * Unfortunately we cannot move it up because that would make the - * IOMMU useless. + * Aperture has to be naturally aligned. This means an 2GB + * aperture won't have much chances to find a place in the + * lower 4GB of memory. Unfortunately we cannot move it up + * because that would make the IOMMU useless. */ + + /* First try to find some free unused space */ + if (!allocate_resource(&iomem_resource, &aper_res, + aper_size, + 0, 0xffffffff, + aper_size, + NULL, NULL)) { + printk(KERN_INFO "Putting aperture at %lx-%lx\n", + aper_res.start, aper_res.end); + return aper_res.start; + } + + /* No free space found. Go on to waste some memory... */ p = __alloc_bootmem_node(nd0, aper_size, aper_size, 0); if (!p || __pa(p)+aper_size > 0xffffffff) { printk("Cannot allocate aperture memory hole (%p,%uK)\n", @@ -66,7 +81,7 @@ static u32 __init allocate_aperture(void) free_bootmem_node(nd0, (unsigned long)p, aper_size); return 0; } - printk("Mapping aperture over %d KB of RAM @ %lx\n", + printk("Mapping aperture over %d KB of precious RAM @ %lx\n", aper_size >> 10, __pa(p)); return (u32)__pa(p); } @@ -87,10 +102,16 @@ static int __init aperture_valid(char *name, u64 aper_base, u32 aper_size) printk("Aperture from %s pointing to e820 RAM. Ignoring.\n",name); return 0; } + /* Don't check the resource here because the aperture is usually + in an e820 reserved area, and we allocated these earlier. */ return 1; } -/* Find a PCI capability */ +/* + * Find a PCI capability. + * This code runs before the PCI subsystem is initialized, so just + * access the northbridge directly. + */ static __u32 __init find_cap(int num, int slot, int func, int cap) { u8 pos; @@ -255,8 +276,6 @@ void __init iommu_hole_init(void) fallback_aper_force) { printk("Your BIOS doesn't leave a aperture memory hole\n"); printk("Please enable the IOMMU option in the BIOS setup\n"); - printk("This costs you %d MB of RAM\n", - 32 << fallback_aper_order); aper_order = fallback_aper_order; aper_alloc = allocate_aperture(); diff --git a/trunk/drivers/md/dm-mpath.c b/trunk/drivers/md/dm-mpath.c index 0c1b8520ef86..1e97b3c12bd5 100644 --- a/trunk/drivers/md/dm-mpath.c +++ b/trunk/drivers/md/dm-mpath.c @@ -985,9 +985,6 @@ static int do_end_io(struct multipath *m, struct bio *bio, if (!error) return 0; /* I/O complete */ - if ((error == -EWOULDBLOCK) && bio_rw_ahead(bio)) - return error; - spin_lock(&m->lock); if (!m->nr_valid_paths) { if (!m->queue_if_no_path || m->suspended) { diff --git a/trunk/drivers/net/tg3.c b/trunk/drivers/net/tg3.c index e944aac258e3..77337c3b4285 100644 --- a/trunk/drivers/net/tg3.c +++ b/trunk/drivers/net/tg3.c @@ -9695,10 +9695,24 @@ static int __devinit tg3_test_dma(struct tg3 *tp) } if ((tp->dma_rwctrl & DMA_RWCTRL_WRITE_BNDRY_MASK) != DMA_RWCTRL_WRITE_BNDRY_16) { + static struct pci_device_id dma_wait_state_chipsets[] = { + { PCI_DEVICE(PCI_VENDOR_ID_APPLE, + PCI_DEVICE_ID_APPLE_UNI_N_PCI15) }, + { }, + }; + /* DMA test passed without adjusting DMA boundary, - * just restore the calculated DMA boundary + * now look for chipsets that are known to expose the + * DMA bug without failing the test. */ - tp->dma_rwctrl = saved_dma_rwctrl; + if (pci_dev_present(dma_wait_state_chipsets)) { + tp->dma_rwctrl &= ~DMA_RWCTRL_WRITE_BNDRY_MASK; + tp->dma_rwctrl |= DMA_RWCTRL_WRITE_BNDRY_16; + } + else + /* Safe to use the calculated DMA boundary. */ + tp->dma_rwctrl = saved_dma_rwctrl; + tw32(TG3PCI_DMA_RW_CTRL, tp->dma_rwctrl); } diff --git a/trunk/drivers/serial/sa1100.c b/trunk/drivers/serial/sa1100.c index 98641c3f5ab9..22565a67a57c 100644 --- a/trunk/drivers/serial/sa1100.c +++ b/trunk/drivers/serial/sa1100.c @@ -197,7 +197,7 @@ static void sa1100_rx_chars(struct sa1100_port *sport, struct pt_regs *regs) { struct tty_struct *tty = sport->port.info->tty; - unsigned int status, ch, flg; + unsigned int status, ch, flg, ignored = 0; status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) | UTSR0_TO_SM(UART_GET_UTSR0(sport)); diff --git a/trunk/include/asm-arm/arch-pxa/pxa-regs.h b/trunk/include/asm-arm/arch-pxa/pxa-regs.h index b5e54a9e9fa7..39741d3c9a34 100644 --- a/trunk/include/asm-arm/arch-pxa/pxa-regs.h +++ b/trunk/include/asm-arm/arch-pxa/pxa-regs.h @@ -1296,7 +1296,6 @@ #define GPIO111_MMCDAT3 111 /* MMC DAT3 (PXA27x) */ #define GPIO111_MMCCS1 111 /* MMC Chip Select 1 (PXA27x) */ #define GPIO112_MMCCMD 112 /* MMC CMD (PXA27x) */ -#define GPIO113_I2S_SYSCLK 113 /* I2S System Clock (PXA27x) */ #define GPIO113_AC97_RESET_N 113 /* AC97 NRESET on (PXA27x) */ /* GPIO alternate function mode & direction */ @@ -1429,7 +1428,6 @@ #define GPIO111_MMCDAT3_MD (111 | GPIO_ALT_FN_1_OUT) #define GPIO110_MMCCS1_MD (111 | GPIO_ALT_FN_1_OUT) #define GPIO112_MMCCMD_MD (112 | GPIO_ALT_FN_1_OUT) -#define GPIO113_I2S_SYSCLK_MD (113 | GPIO_ALT_FN_1_OUT) #define GPIO113_AC97_RESET_N_MD (113 | GPIO_ALT_FN_2_OUT) #define GPIO117_I2CSCL_MD (117 | GPIO_ALT_FN_1_OUT) #define GPIO118_I2CSDA_MD (118 | GPIO_ALT_FN_1_IN) diff --git a/trunk/include/asm-ia64/pgtable.h b/trunk/include/asm-ia64/pgtable.h index fcc9c3344ab4..ea121a002309 100644 --- a/trunk/include/asm-ia64/pgtable.h +++ b/trunk/include/asm-ia64/pgtable.h @@ -8,7 +8,7 @@ * This hopefully works with any (fixed) IA-64 page-size, as defined * in . * - * Copyright (C) 1998-2005 Hewlett-Packard Co + * Copyright (C) 1998-2004 Hewlett-Packard Co * David Mosberger-Tang */ @@ -551,11 +551,7 @@ do { \ /* These tell get_user_pages() that the first gate page is accessible from user-level. */ #define FIXADDR_USER_START GATE_ADDR -#ifdef HAVE_BUGGY_SEGREL -# define FIXADDR_USER_END (GATE_ADDR + 2*PAGE_SIZE) -#else -# define FIXADDR_USER_END (GATE_ADDR + 2*PERCPU_PAGE_SIZE) -#endif +#define FIXADDR_USER_END (GATE_ADDR + 2*PERCPU_PAGE_SIZE) #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY diff --git a/trunk/include/asm-ia64/processor.h b/trunk/include/asm-ia64/processor.h index 91bbd1f22461..9e1ba8b7fb68 100644 --- a/trunk/include/asm-ia64/processor.h +++ b/trunk/include/asm-ia64/processor.h @@ -403,10 +403,7 @@ extern void ia64_setreg_unknown_kr (void); * task_struct at this point. */ -/* - * Return TRUE if task T owns the fph partition of the CPU we're running on. - * Must be called from code that has preemption disabled. - */ +/* Return TRUE if task T owns the fph partition of the CPU we're running on. */ #define ia64_is_local_fpu_owner(t) \ ({ \ struct task_struct *__ia64_islfo_task = (t); \ @@ -414,10 +411,7 @@ extern void ia64_setreg_unknown_kr (void); && __ia64_islfo_task == (struct task_struct *) ia64_get_kr(IA64_KR_FPU_OWNER)); \ }) -/* - * Mark task T as owning the fph partition of the CPU we're running on. - * Must be called from code that has preemption disabled. - */ +/* Mark task T as owning the fph partition of the CPU we're running on. */ #define ia64_set_local_fpu_owner(t) do { \ struct task_struct *__ia64_slfo_task = (t); \ __ia64_slfo_task->thread.last_fph_cpu = smp_processor_id(); \ diff --git a/trunk/include/asm-sparc/uaccess.h b/trunk/include/asm-sparc/uaccess.h index 0a780e84a12b..f461144067ee 100644 --- a/trunk/include/asm-sparc/uaccess.h +++ b/trunk/include/asm-sparc/uaccess.h @@ -41,11 +41,10 @@ * No one can read/write anything from userland in the kernel space by setting * large size and address near to PAGE_OFFSET - a fault will break his intentions. */ -#define __user_ok(addr, size) ({ (void)(size); (addr) < STACK_TOP; }) +#define __user_ok(addr,size) ((addr) < STACK_TOP) #define __kernel_ok (segment_eq(get_fs(), KERNEL_DS)) #define __access_ok(addr,size) (__user_ok((addr) & get_fs().seg,(size))) -#define access_ok(type, addr, size) \ - ({ (void)(type); __access_ok((unsigned long)(addr), size); }) +#define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size)) /* this function will go away soon - use access_ok() instead */ static inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size) diff --git a/trunk/include/linux/pci_ids.h b/trunk/include/linux/pci_ids.h index 18f734ec9181..b8b4ebf9abf1 100644 --- a/trunk/include/linux/pci_ids.h +++ b/trunk/include/linux/pci_ids.h @@ -874,6 +874,7 @@ #define PCI_DEVICE_ID_APPLE_KL_USB_P 0x0026 #define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027 #define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d +#define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e #define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030 #define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032 #define PCI_DEVIEC_ID_APPLE_UNI_N_ATA 0x0033