diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-03-07 15:45:24 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-03-07 15:45:24 +0000 |
commit | 9f9f3e6e8548a596697778337110a423c384b6f3 (patch) | |
tree | 5dd4b290ef532cf5ecb058e1a92cd3435afeac8c /arch/arm/kernel | |
parent | d5c9a365ee7d2fded249aa5abfc5e89587583029 (diff) |
Merge with Linux 2.3.49.
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/arthur.c | 60 | ||||
-rw-r--r-- | arch/arm/kernel/entry-armo.S | 20 | ||||
-rw-r--r-- | arch/arm/kernel/entry-armv.S | 20 | ||||
-rw-r--r-- | arch/arm/kernel/entry-common.S | 47 | ||||
-rw-r--r-- | arch/arm/kernel/hw-footbridge.c | 16 | ||||
-rw-r--r-- | arch/arm/kernel/irq.c | 4 | ||||
-rw-r--r-- | arch/arm/kernel/leds-footbridge.c | 4 | ||||
-rw-r--r-- | arch/arm/kernel/setup.c | 2 | ||||
-rw-r--r-- | arch/arm/kernel/sys_arm.c | 23 |
9 files changed, 103 insertions, 93 deletions
diff --git a/arch/arm/kernel/arthur.c b/arch/arm/kernel/arthur.c index 9994fdd4a..77c7d7396 100644 --- a/arch/arm/kernel/arthur.c +++ b/arch/arm/kernel/arthur.c @@ -1,6 +1,6 @@ /* * Arthur personality - * Copyright (C) 1998 Philip Blundell + * Copyright (C) 1998-1999 Philip Blundell */ #include <linux/personality.h> @@ -8,35 +8,36 @@ #include <linux/stddef.h> #include <linux/signal.h> #include <linux/sched.h> +#include <linux/init.h> #include <asm/ptrace.h> -/* RISC OS doesn't have many signals, and a lot of those that it does +/* Arthur doesn't have many signals, and a lot of those that it does have don't map easily to any Linux equivalent. Never mind. */ -#define RISCOS_SIGABRT 1 -#define RISCOS_SIGFPE 2 -#define RISCOS_SIGILL 3 -#define RISCOS_SIGINT 4 -#define RISCOS_SIGSEGV 5 -#define RISCOS_SIGTERM 6 -#define RISCOS_SIGSTAK 7 -#define RISCOS_SIGUSR1 8 -#define RISCOS_SIGUSR2 9 -#define RISCOS_SIGOSERROR 10 +#define ARTHUR_SIGABRT 1 +#define ARTHUR_SIGFPE 2 +#define ARTHUR_SIGILL 3 +#define ARTHUR_SIGINT 4 +#define ARTHUR_SIGSEGV 5 +#define ARTHUR_SIGTERM 6 +#define ARTHUR_SIGSTAK 7 +#define ARTHUR_SIGUSR1 8 +#define ARTHUR_SIGUSR2 9 +#define ARTHUR_SIGOSERROR 10 -static unsigned long riscos_to_linux_signals[32] = { +static unsigned long arthur_to_linux_signals[32] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }; -static unsigned long linux_to_riscos_signals[32] = { - 0, -1, RISCOS_SIGINT, -1, - RISCOS_SIGILL, 5, RISCOS_SIGABRT, 7, - RISCOS_SIGFPE, 9, RISCOS_SIGUSR1, RISCOS_SIGSEGV, - RISCOS_SIGUSR2, 13, 14, RISCOS_SIGTERM, +static unsigned long linux_to_arthur_signals[32] = { + 0, -1, ARTHUR_SIGINT, -1, + ARTHUR_SIGILL, 5, ARTHUR_SIGABRT, 7, + ARTHUR_SIGFPE, 9, ARTHUR_SIGUSR1, ARTHUR_SIGSEGV, + ARTHUR_SIGUSR2, 13, 14, ARTHUR_SIGTERM, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, @@ -52,12 +53,12 @@ static void arthur_lcall7(int nr, struct pt_regs *regs) send_sig_info(SIGSWI, &info, current); } -static struct exec_domain riscos_exec_domain = { +static struct exec_domain arthur_exec_domain = { "Arthur", /* name */ (lcall7_func)arthur_lcall7, PER_RISCOS, PER_RISCOS, - riscos_to_linux_signals, - linux_to_riscos_signals, + arthur_to_linux_signals, + linux_to_arthur_signals, #ifdef MODULE &__this_module, /* No usage counter. */ #else @@ -71,18 +72,15 @@ static struct exec_domain riscos_exec_domain = { * processes are using it. */ -#ifdef MODULE -int init_module(void) -#else -int initialise_arthur(void) -#endif +int __init arthur_init(void) { - return register_exec_domain(&riscos_exec_domain); + return register_exec_domain(&arthur_exec_domain); } -#ifdef MODULE -void cleanup_module(void) +void __exit arthur_exit(void) { - unregister_exec_domain(&riscos_exec_domain); + unregister_exec_domain(&arthur_exec_domain); } -#endif + +module_init(arthur_init); +module_exit(arthur_exit); diff --git a/arch/arm/kernel/entry-armo.S b/arch/arm/kernel/entry-armo.S index f2dc9e36c..d6fa94867 100644 --- a/arch/arm/kernel/entry-armo.S +++ b/arch/arm/kernel/entry-armo.S @@ -22,6 +22,7 @@ * adhering to the above criteria. */ #include <linux/linkage.h> +#include <linux/config.h> #include <asm/assembler.h> #include <asm/errno.h> @@ -29,6 +30,12 @@ #include "../lib/constants.h" + .macro zero_fp +#ifdef CONFIG_FRAME_POINTER + mov fp, #0 +#endif + .endm + .text @ Offsets into task structure @@ -213,7 +220,7 @@ irq_prio_h: .byte 0, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10 stmfd sp!, {r0 - r12} ;\ mov r0, #-1 ;\ str r0, [sp, #S_OLD_R0] ;\ - mov fp, #0 + zero_fp #define SVC_IRQ_SAVE_ALL \ str sp, [sp, #-16]! ;\ @@ -224,7 +231,7 @@ irq_prio_h: .byte 0, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10 stmfd sp!, {r0 - r12} ;\ mov r0, #-1 ;\ str r0, [sp, #S_OLD_R0] ;\ - mov fp, #0 + zero_fp #define SVC_RESTORE_ALL \ ldmfd sp, {r0 - pc}^ @@ -261,7 +268,7 @@ vector_undefinstr: tst lr,#3 bne __und_svc save_user_regs - mov fp, #0 + zero_fp teqp pc, #I_BIT | MODE_SVC .Lbug_undef: ldr r4, .LC2 @@ -283,6 +290,10 @@ __und_svc: SVC_SAVE_ALL @ Non-user mode bl SYMBOL_NAME(do_undefinstr) SVC_RESTORE_ALL +#ifdef CONFIG_NWFPE + /* The FPE is always present */ + .equ fpe_not_present, 0 +#else /* We get here if an undefined instruction happens and the floating * point emulator is not present. If the offending instruction was * a WFS, we just perform a normal return as if we had emulated the @@ -319,6 +330,7 @@ wfs_mask_data: .word 0x0e200110 @ WFS/RFS .word 0x0d0d0100 @ LDF [sp]/STF [sp] .word 0x0d0b0100 @ LDF [fp]/STF [fp] .word 0x0f0f0f00 +#endif .LC2: .word SYMBOL_NAME(fp_enter) @@ -686,7 +698,7 @@ ENTRY(__switch_to) /* * initialise the trap system */ -ENTRY(trap_init) +ENTRY(__trap_init) stmfd sp!, {r4 - r7, lr} adr r1, .Ljump_addresses ldmia r1, {r1 - r7, ip, lr} diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index f4f03ee93..fe3939888 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -24,6 +24,12 @@ #define MODE_SVC 0x13 #endif + .macro zero_fp +#ifdef CONFIG_FRAME_POINTER + mov fp, #0 +#endif + .endm + .text #define PF_TRACESYS 0x20 @@ -421,7 +427,7 @@ __und_invalid: sub sp, sp, #S_FRAME_SIZE ldr r4, .LCund mov r1, #BAD_UNDEFINSTR @ int reason -1: mov fp, #0 +1: zero_fp ldmia r4, {r5 - r7} @ Get XXX pc, cpsr, old_r0 add r4, sp, #S_PC stmia r4, {r5 - r7} @ Save XXX pc, cpsr, old_r0 @@ -573,7 +579,7 @@ __dabt_usr: sub sp, sp, #S_FRAME_SIZE @ Allocate frame size in one go stmia r3, {r0 - r2} @ Save USR pc, cpsr, old_r0 stmdb r3, {sp, lr}^ alignment_trap r4, r7, __temp_abt - mov fp, #0 + zero_fp #ifdef MULTI_CPU ldr r2, .LCprocfns mov lr, pc @@ -595,7 +601,7 @@ __irq_usr: sub sp, sp, #S_FRAME_SIZE stmia r8, {r5 - r7} @ save pc, psr, old_r0 stmdb r8, {sp, lr}^ alignment_trap r4, r7, __temp_irq - mov fp, #0 + zero_fp 1: get_irqnr_and_base r0, r6, r5 movne r1, sp adrsvc ne, lr, 1b @@ -615,7 +621,7 @@ __und_usr: sub sp, sp, #S_FRAME_SIZE @ Allocate frame size in one go stmia r8, {r5 - r7} @ Save USR pc, cpsr, old_r0 stmdb r8, {sp, lr}^ @ Save user r0 - r12 alignment_trap r4, r7, __temp_und - mov fp, #0 + zero_fp adrsvc al, r9, ret_from_sys_call @ r9 = normal FP return adrsvc al, lr, fpundefinstr @ lr = undefined instr return @@ -641,7 +647,7 @@ __pabt_usr: sub sp, sp, #S_FRAME_SIZE @ Allocate frame size in one go stmia r8, {r5 - r7} @ Save USR pc, cpsr, old_r0 stmdb r8, {sp, lr}^ @ Save sp_usr lr_usr alignment_trap r4, r7, __temp_abt - mov fp, #0 + zero_fp msr cpsr_c, #MODE_SVC @ Enable interrupts mov r0, r5 @ address (pc) mov r1, sp @ regs @@ -688,11 +694,11 @@ t: .ascii "Prefetch -> undefined instruction\n\0" ENTRY(__switch_to) stmfd sp!, {r4 - sl, fp, lr} @ Store most regs on stack mrs ip, cpsr - stmfd sp!, {ip} @ Save cpsr_SVC + str ip, [sp, #-4]! @ Save cpsr_SVC str sp, [r0, #TSS_SAVE] @ Save sp_SVC ldr sp, [r1, #TSS_SAVE] @ Get saved sp_SVC ldr r2, [r1, #TSS_DOMAIN] - ldmfd sp!, {ip} + ldr ip, [sp], #4 mcr p15, 0, r2, c3, c0 @ Set domain register msr spsr, ip @ Save tasks CPSR into SPSR for this return ldmfd sp!, {r4 - sl, fp, pc}^ @ Load all regs saved previously diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 5dc61c6d7..97dfef0c1 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -4,16 +4,6 @@ */ #define S_OFF 8 -#define SYSCALL_REGS r4, r5 - -/* - * Define to favour ARM8, ARM9 and StrongARM cpus. This says that it is - * cheaper to use two LDR instructions than a two-register LDM, if the - * latter would entail calculating an address specially. - */ -#if defined(CONFIG_CPU_SA110) -#define HARVARD_CACHE -#endif .macro get_softirq, rd #ifdef __SMP__ @@ -85,7 +75,7 @@ tip .req r7 @ temporary IP .align 5 vector_swi: save_user_regs mask_pc lr, lr - mov fp, #0 + zero_fp ldr scno, [lr, #-4] @ get SWI instruction arm700_bug_check scno, ip #ifdef CONFIG_ALIGNMENT_TRAP @@ -95,9 +85,7 @@ vector_swi: save_user_regs #endif enable_irqs ip - stmdb sp!, {SYSCALL_REGS} @ new style: (r0 = arg1, r4 = arg5, r5 = arg6) - @ Note that we dont have to handle - @ sys_syscalls arg7 here + str r4, [sp, #-S_OFF]! @ push fifth arg adrsvc al, lr, fast_syscall_return bic scno, scno, #0xff000000 @ mask off SWI op-code @@ -141,10 +129,11 @@ vector_swi: save_user_regs b SYMBOL_NAME(deferred) .align 5 - + .type __softirq_state, #object __softirq_state: .word SYMBOL_NAME(softirq_state) + .type sys_call_table, #object ENTRY(sys_call_table) #include "calls.S" @@ -153,15 +142,18 @@ ENTRY(sys_call_table) */ @ r0 = syscall number @ r5 = syscall table + .type sys_syscall, #function SYMBOL_NAME(sys_syscall): eor scno, r0, #OS_NUMBER << 20 cmp scno, #NR_syscalls @ check range add ip, sp, #S_OFF - ldmleib ip, {r0 - r3, SYSCALL_REGS} @ get our args - stmleia sp, {SYSCALL_REGS} @ Put our arg on the stack + stmleia sp, {r5, r6} @ shuffle args + movle r0, r1 + movle r1, r2 + movle r2, r3 + movle r3, r4 ldrle pc, [tbl, scno, lsl #2] - mov r0, #-ENOSYS - RETINSTR(mov,pc,lr) + b sys_ni_syscall sys_fork_wrapper: add r0, sp, #S_OFF @@ -199,6 +191,23 @@ sys_sigaltstack_wrapper: ldr r2, [sp, #S_OFF + S_SP] b do_sigaltstack +/* + * Note: off_4k (r5) is always units of 4K. If we can't do the requested + * offset, we return EINVAL. + */ +sys_mmap2: +#if PAGE_SHIFT > 12 + tst r5, #PGOFF_MASK + moveq r5, r5, lsr #PGOFF_SHIFT + streq r5, [sp, #4] + beq do_mmap2 + mov r0, #-EINVAL + RETINSTR(mov,pc, lr) +#else + str r5, [sp, #4] + b do_mmap2 +#endif + .data ENTRY(fp_enter) diff --git a/arch/arm/kernel/hw-footbridge.c b/arch/arm/kernel/hw-footbridge.c index e06c8092d..8dcad0b93 100644 --- a/arch/arm/kernel/hw-footbridge.c +++ b/arch/arm/kernel/hw-footbridge.c @@ -68,13 +68,13 @@ static inline void wb977_ww(int reg, int val) /* * This is a lock for accessing ports GP1_IO_BASE and GP2_IO_BASE */ -spinlock_t __netwinder_data gpio_lock = SPIN_LOCK_UNLOCKED; +spinlock_t gpio_lock = SPIN_LOCK_UNLOCKED; -static unsigned int __netwinder_data current_gpio_op = 0; -static unsigned int __netwinder_data current_gpio_io = 0; -static unsigned int __netwinder_data current_cpld = 0; +static unsigned int current_gpio_op = 0; +static unsigned int current_gpio_io = 0; +static unsigned int current_cpld = 0; -void __netwinder_text gpio_modify_op(int mask, int set) +void gpio_modify_op(int mask, int set) { unsigned int new_gpio, changed; @@ -119,7 +119,7 @@ static inline void __gpio_modify_io(int mask, int in) } } -void __netwinder_text gpio_modify_io(int mask, int in) +void gpio_modify_io(int mask, int in) { /* Open up the SuperIO chip */ wb977_open(); @@ -130,7 +130,7 @@ void __netwinder_text gpio_modify_io(int mask, int in) wb977_close(); } -int __netwinder_text gpio_read(void) +int gpio_read(void) { return inb(GP1_IO_BASE) | inb(GP2_IO_BASE) << 8; } @@ -360,7 +360,7 @@ static void __init wb977_init(void) wb977_close(); } -void __netwinder_text cpld_modify(int mask, int set) +void cpld_modify(int mask, int set) { int msk; diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index 6e3c863d5..699cea4ab 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c @@ -471,6 +471,10 @@ out: return irq_found; } +void __init init_irq_proc(void) +{ +} + void __init init_IRQ(void) { extern void init_dma(void); diff --git a/arch/arm/kernel/leds-footbridge.c b/arch/arm/kernel/leds-footbridge.c index 90f2fe109..05f232f57 100644 --- a/arch/arm/kernel/leds-footbridge.c +++ b/arch/arm/kernel/leds-footbridge.c @@ -37,7 +37,7 @@ extern spinlock_t gpio_lock; #ifdef CONFIG_FOOTBRIDGE -static void __ebsa285_text ebsa285_leds_event(led_event_t evt) +static void ebsa285_leds_event(led_event_t evt) { unsigned long flags; @@ -129,7 +129,7 @@ static void __ebsa285_text ebsa285_leds_event(led_event_t evt) #ifdef CONFIG_ARCH_NETWINDER -static void __netwinder_text netwinder_leds_event(led_event_t evt) +static void netwinder_leds_event(led_event_t evt) { unsigned long flags; diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index a2f7292f6..5815529aa 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -767,6 +767,8 @@ void __init setup_arch(char **cmdline_p) setup_bootmem(); request_standard_resources(mdesc); + paging_init(); + #ifdef CONFIG_VT #if defined(CONFIG_VGA_CONSOLE) conswitchp = &vga_con; diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c index 47b2930c2..9abb9e617 100644 --- a/arch/arm/kernel/sys_arm.c +++ b/arch/arm/kernel/sys_arm.c @@ -50,7 +50,7 @@ asmlinkage int sys_pipe(unsigned long * fildes) } /* common code for old and new mmaps */ -static inline long do_mmap2( +inline long do_mmap2( unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff) @@ -79,27 +79,6 @@ out: return error; } -#define PGOFF_SHIFT (PAGE_SHIFT - 12) -#define PGOFF_MASK (~((1 << PGOFF_SHIFT) - 1)) - -/* - * Note: off_4k is always units of 4K. If we can't do the requested - * offset, we return EINVAL. - */ -asmlinkage long -sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, - unsigned long flags, unsigned long fd, unsigned long off_4k) -{ - unsigned long pgoff; - - if (off_4k & ~PGOFF_MASK) - return -EINVAL; - - pgoff = off_4k >> PGOFF_SHIFT; - - return do_mmap2(addr, len, prot, flags, fd, pgoff); -} - struct mmap_arg_struct { unsigned long addr; unsigned long len; |