diff options
Diffstat (limited to 'arch/m68k')
33 files changed, 413 insertions, 355 deletions
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 1dd5d18b220..96b91982805 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -10,10 +10,6 @@ config MMU bool default y -config UID16 - bool - default y - config RWSEM_GENERIC_SPINLOCK bool default y diff --git a/arch/m68k/amiga/amiints.c b/arch/m68k/amiga/amiints.c index d9edf2d1a49..b0aa61bf870 100644 --- a/arch/m68k/amiga/amiints.c +++ b/arch/m68k/amiga/amiints.c @@ -126,9 +126,9 @@ void __init amiga_init_IRQ(void) gayle.inten = GAYLE_IRQ_IDE; /* turn off all interrupts and enable the master interrupt bit */ - custom.intena = 0x7fff; - custom.intreq = 0x7fff; - custom.intena = IF_SETCLR | IF_INTEN; + amiga_custom.intena = 0x7fff; + amiga_custom.intreq = 0x7fff; + amiga_custom.intena = IF_SETCLR | IF_INTEN; cia_init_IRQ(&ciaa_base); cia_init_IRQ(&ciab_base); @@ -245,7 +245,7 @@ int amiga_request_irq(unsigned int irq, /* enable the interrupt */ if (irq < IRQ_AMIGA_PORTS && !ami_ablecount[irq]) - custom.intena = IF_SETCLR | amiga_intena_vals[irq]; + amiga_custom.intena = IF_SETCLR | amiga_intena_vals[irq]; return error; } @@ -274,7 +274,7 @@ void amiga_free_irq(unsigned int irq, void *dev_id) amiga_delete_irq(&ami_irq_list[irq], dev_id); /* if server list empty, disable the interrupt */ if (!ami_irq_list[irq] && irq < IRQ_AMIGA_PORTS) - custom.intena = amiga_intena_vals[irq]; + amiga_custom.intena = amiga_intena_vals[irq]; } else { if (ami_irq_list[irq]->dev_id != dev_id) printk("%s: removing probably wrong IRQ %d from %s\n", @@ -283,7 +283,7 @@ void amiga_free_irq(unsigned int irq, void *dev_id) ami_irq_list[irq]->flags = 0; ami_irq_list[irq]->dev_id = NULL; ami_irq_list[irq]->devname = NULL; - custom.intena = amiga_intena_vals[irq]; + amiga_custom.intena = amiga_intena_vals[irq]; } } @@ -327,7 +327,7 @@ void amiga_enable_irq(unsigned int irq) } /* enable the interrupt */ - custom.intena = IF_SETCLR | amiga_intena_vals[irq]; + amiga_custom.intena = IF_SETCLR | amiga_intena_vals[irq]; } void amiga_disable_irq(unsigned int irq) @@ -358,7 +358,7 @@ void amiga_disable_irq(unsigned int irq) } /* disable the interrupt */ - custom.intena = amiga_intena_vals[irq]; + amiga_custom.intena = amiga_intena_vals[irq]; } inline void amiga_do_irq(int irq, struct pt_regs *fp) @@ -373,7 +373,7 @@ void amiga_do_irq_list(int irq, struct pt_regs *fp) kstat_cpu(0).irqs[SYS_IRQS + irq]++; - custom.intreq = amiga_intena_vals[irq]; + amiga_custom.intreq = amiga_intena_vals[irq]; for (node = ami_irq_list[irq]; node; node = node->next) node->handler(irq, node->dev_id, fp); @@ -385,23 +385,23 @@ void amiga_do_irq_list(int irq, struct pt_regs *fp) static irqreturn_t ami_int1(int irq, void *dev_id, struct pt_regs *fp) { - unsigned short ints = custom.intreqr & custom.intenar; + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; /* if serial transmit buffer empty, interrupt */ if (ints & IF_TBE) { - custom.intreq = IF_TBE; + amiga_custom.intreq = IF_TBE; amiga_do_irq(IRQ_AMIGA_TBE, fp); } /* if floppy disk transfer complete, interrupt */ if (ints & IF_DSKBLK) { - custom.intreq = IF_DSKBLK; + amiga_custom.intreq = IF_DSKBLK; amiga_do_irq(IRQ_AMIGA_DSKBLK, fp); } /* if software interrupt set, interrupt */ if (ints & IF_SOFT) { - custom.intreq = IF_SOFT; + amiga_custom.intreq = IF_SOFT; amiga_do_irq(IRQ_AMIGA_SOFT, fp); } return IRQ_HANDLED; @@ -409,17 +409,17 @@ static irqreturn_t ami_int1(int irq, void *dev_id, struct pt_regs *fp) static irqreturn_t ami_int3(int irq, void *dev_id, struct pt_regs *fp) { - unsigned short ints = custom.intreqr & custom.intenar; + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; /* if a blitter interrupt */ if (ints & IF_BLIT) { - custom.intreq = IF_BLIT; + amiga_custom.intreq = IF_BLIT; amiga_do_irq(IRQ_AMIGA_BLIT, fp); } /* if a copper interrupt */ if (ints & IF_COPER) { - custom.intreq = IF_COPER; + amiga_custom.intreq = IF_COPER; amiga_do_irq(IRQ_AMIGA_COPPER, fp); } @@ -431,29 +431,29 @@ static irqreturn_t ami_int3(int irq, void *dev_id, struct pt_regs *fp) static irqreturn_t ami_int4(int irq, void *dev_id, struct pt_regs *fp) { - unsigned short ints = custom.intreqr & custom.intenar; + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; /* if audio 0 interrupt */ if (ints & IF_AUD0) { - custom.intreq = IF_AUD0; + amiga_custom.intreq = IF_AUD0; amiga_do_irq(IRQ_AMIGA_AUD0, fp); } /* if audio 1 interrupt */ if (ints & IF_AUD1) { - custom.intreq = IF_AUD1; + amiga_custom.intreq = IF_AUD1; amiga_do_irq(IRQ_AMIGA_AUD1, fp); } /* if audio 2 interrupt */ if (ints & IF_AUD2) { - custom.intreq = IF_AUD2; + amiga_custom.intreq = IF_AUD2; amiga_do_irq(IRQ_AMIGA_AUD2, fp); } /* if audio 3 interrupt */ if (ints & IF_AUD3) { - custom.intreq = IF_AUD3; + amiga_custom.intreq = IF_AUD3; amiga_do_irq(IRQ_AMIGA_AUD3, fp); } return IRQ_HANDLED; @@ -461,7 +461,7 @@ static irqreturn_t ami_int4(int irq, void *dev_id, struct pt_regs *fp) static irqreturn_t ami_int5(int irq, void *dev_id, struct pt_regs *fp) { - unsigned short ints = custom.intreqr & custom.intenar; + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; /* if serial receive buffer full interrupt */ if (ints & IF_RBF) { @@ -471,7 +471,7 @@ static irqreturn_t ami_int5(int irq, void *dev_id, struct pt_regs *fp) /* if a disk sync interrupt */ if (ints & IF_DSKSYN) { - custom.intreq = IF_DSKSYN; + amiga_custom.intreq = IF_DSKSYN; amiga_do_irq(IRQ_AMIGA_DSKSYN, fp); } return IRQ_HANDLED; diff --git a/arch/m68k/amiga/amisound.c b/arch/m68k/amiga/amisound.c index bd5d134e9f1..ae94db5d93b 100644 --- a/arch/m68k/amiga/amisound.c +++ b/arch/m68k/amiga/amisound.c @@ -24,6 +24,8 @@ static const signed char sine_data[] = { }; #define DATA_SIZE (sizeof(sine_data)/sizeof(sine_data[0])) +#define custom amiga_custom + /* * The minimum period for audio may be modified by the frame buffer * device since it depends on htotal (for OCS/ECS/AGA) diff --git a/arch/m68k/amiga/cia.c b/arch/m68k/amiga/cia.c index 7d55682615e..9476eb9440f 100644 --- a/arch/m68k/amiga/cia.c +++ b/arch/m68k/amiga/cia.c @@ -60,7 +60,7 @@ unsigned char cia_set_irq(struct ciabase *base, unsigned char mask) else base->icr_data &= ~mask; if (base->icr_data & base->icr_mask) - custom.intreq = IF_SETCLR | base->int_mask; + amiga_custom.intreq = IF_SETCLR | base->int_mask; return old & base->icr_mask; } @@ -89,7 +89,7 @@ unsigned char cia_able_irq(struct ciabase *base, unsigned char mask) } } if (base->icr_data & base->icr_mask) - custom.intreq = IF_SETCLR | base->int_mask; + amiga_custom.intreq = IF_SETCLR | base->int_mask; return old; } @@ -133,7 +133,7 @@ static irqreturn_t cia_handler(int irq, void *dev_id, struct pt_regs *fp) mach_irq = base->cia_irq; irq = SYS_IRQS + mach_irq; ints = cia_set_irq(base, CIA_ICR_ALL); - custom.intreq = base->int_mask; + amiga_custom.intreq = base->int_mask; for (i = 0; i < CIA_IRQS; i++, irq++, mach_irq++) { if (ints & 1) { kstat_cpu(0).irqs[irq]++; @@ -162,7 +162,7 @@ void __init cia_init_IRQ(struct ciabase *base) /* install CIA handler */ request_irq(base->handler_irq, cia_handler, 0, base->name, base); - custom.intena = IF_SETCLR | base->int_mask; + amiga_custom.intena = IF_SETCLR | base->int_mask; } int cia_get_irq_list(struct ciabase *base, struct seq_file *p) diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index 4775e18a78f..12e3706fe02 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c @@ -105,9 +105,6 @@ static int a2000_hwclk (int, struct rtc_time *); static int amiga_set_clock_mmss (unsigned long); static unsigned int amiga_get_ss (void); extern void amiga_mksound( unsigned int count, unsigned int ticks ); -#ifdef CONFIG_AMIGA_FLOPPY -extern void amiga_floppy_setup(char *, int *); -#endif static void amiga_reset (void); extern void amiga_init_sound(void); static void amiga_savekmsg_init(void); @@ -290,7 +287,7 @@ static void __init amiga_identify(void) case CS_OCS: case CS_ECS: case CS_AGA: - switch (custom.deniseid & 0xf) { + switch (amiga_custom.deniseid & 0xf) { case 0x0c: AMIGAHW_SET(DENISE_HR); break; @@ -303,7 +300,7 @@ static void __init amiga_identify(void) AMIGAHW_SET(DENISE); break; } - switch ((custom.vposr>>8) & 0x7f) { + switch ((amiga_custom.vposr>>8) & 0x7f) { case 0x00: AMIGAHW_SET(AGNUS_PAL); break; @@ -427,13 +424,7 @@ void __init config_amiga(void) mach_set_clock_mmss = amiga_set_clock_mmss; mach_get_ss = amiga_get_ss; -#ifdef CONFIG_AMIGA_FLOPPY - mach_floppy_setup = amiga_floppy_setup; -#endif mach_reset = amiga_reset; -#ifdef CONFIG_DUMMY_CONSOLE - conswitchp = &dummy_con; -#endif #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) mach_beep = amiga_mksound; #endif @@ -447,9 +438,9 @@ void __init config_amiga(void) amiga_colorclock = 5*amiga_eclock; /* 3.5 MHz */ /* clear all DMA bits */ - custom.dmacon = DMAF_ALL; + amiga_custom.dmacon = DMAF_ALL; /* ensure that the DMA master bit is set */ - custom.dmacon = DMAF_SETCLR | DMAF_MASTER; + amiga_custom.dmacon = DMAF_SETCLR | DMAF_MASTER; /* don't use Z2 RAM as system memory on Z3 capable machines */ if (AMIGAHW_PRESENT(ZORRO3)) { @@ -830,8 +821,8 @@ static void amiga_savekmsg_init(void) static void amiga_serial_putc(char c) { - custom.serdat = (unsigned char)c | 0x100; - while (!(custom.serdatr & 0x2000)) + amiga_custom.serdat = (unsigned char)c | 0x100; + while (!(amiga_custom.serdatr & 0x2000)) ; } @@ -855,11 +846,11 @@ int amiga_serial_console_wait_key(struct console *co) { int ch; - while (!(custom.intreqr & IF_RBF)) + while (!(amiga_custom.intreqr & IF_RBF)) barrier(); - ch = custom.serdatr & 0xff; + ch = amiga_custom.serdatr & 0xff; /* clear the interrupt, so that another character can be read */ - custom.intreq = IF_RBF; + amiga_custom.intreq = IF_RBF; return ch; } diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c index 26492947125..d401962d9b2 100644 --- a/arch/m68k/apollo/config.c +++ b/arch/m68k/apollo/config.c @@ -176,9 +176,6 @@ void config_apollo(void) { mach_set_clock_mmss = dn_dummy_set_clock_mmss; /* */ mach_process_int = dn_process_int; mach_reset = dn_dummy_reset; /* */ -#ifdef CONFIG_DUMMY_CONSOLE - conswitchp = &dummy_con; -#endif #ifdef CONFIG_HEARTBEAT mach_heartbeat = dn_heartbeat; #endif diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c index 9261d2deeaf..1012b08e552 100644 --- a/arch/m68k/atari/config.c +++ b/arch/m68k/atari/config.c @@ -52,9 +52,6 @@ int atari_rtc_year_offset; /* local function prototypes */ static void atari_reset( void ); -#ifdef CONFIG_ATARI_FLOPPY -extern void atari_floppy_setup(char *, int *); -#endif static void atari_get_model(char *model); static int atari_get_hardware_list(char *buffer); @@ -244,12 +241,6 @@ void __init config_atari(void) mach_get_irq_list = show_atari_interrupts; mach_gettimeoffset = atari_gettimeoffset; mach_reset = atari_reset; -#ifdef CONFIG_ATARI_FLOPPY - mach_floppy_setup = atari_floppy_setup; -#endif -#ifdef CONFIG_DUMMY_CONSOLE - conswitchp = &dummy_con; -#endif mach_max_dma_address = 0xffffff; #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) mach_beep = atari_mksound; diff --git a/arch/m68k/bvme6000/rtc.c b/arch/m68k/bvme6000/rtc.c index eb63ca6ed94..703cbc6dc9c 100644 --- a/arch/m68k/bvme6000/rtc.c +++ b/arch/m68k/bvme6000/rtc.c @@ -11,6 +11,7 @@ #include <linux/miscdevice.h> #include <linux/slab.h> #include <linux/ioport.h> +#include <linux/capability.h> #include <linux/fcntl.h> #include <linux/init.h> #include <linux/poll.h> @@ -46,6 +47,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned char msr; unsigned long flags; struct rtc_time wtime; + void __user *argp = (void __user *)arg; switch (cmd) { case RTC_RD_TIME: /* Read the time/date from RTC */ @@ -68,7 +70,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, } while (wtime.tm_sec != BCD2BIN(rtc->bcd_sec)); rtc->msr = msr; local_irq_restore(flags); - return copy_to_user((void *)arg, &wtime, sizeof wtime) ? + return copy_to_user(argp, &wtime, sizeof wtime) ? -EFAULT : 0; } case RTC_SET_TIME: /* Set the RTC */ @@ -80,8 +82,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, if (!capable(CAP_SYS_ADMIN)) return -EACCES; - if (copy_from_user(&rtc_tm, (struct rtc_time*)arg, - sizeof(struct rtc_time))) + if (copy_from_user(&rtc_tm, argp, sizeof(struct rtc_time))) return -EFAULT; yrs = rtc_tm.tm_year; diff --git a/arch/m68k/fpsp040/skeleton.S b/arch/m68k/fpsp040/skeleton.S index 9571a21d6ad..a1629194e3f 100644 --- a/arch/m68k/fpsp040/skeleton.S +++ b/arch/m68k/fpsp040/skeleton.S @@ -381,10 +381,8 @@ fpsp_done: .Lnotkern: SAVE_ALL_INT GET_CURRENT(%d0) - tstb %curptr@(TASK_NEEDRESCHED) - jne ret_from_exception | deliver signals, - | reschedule etc.. - RESTORE_ALL + | deliver signals, reschedule etc.. + jra ret_from_exception | | mem_write --- write to user or supervisor address space diff --git a/arch/m68k/hp300/config.c b/arch/m68k/hp300/config.c index a0b854f3f94..6d129eef370 100644 --- a/arch/m68k/hp300/config.c +++ b/arch/m68k/hp300/config.c @@ -261,9 +261,6 @@ void __init config_hp300(void) #ifdef CONFIG_HEARTBEAT mach_heartbeat = hp300_pulse; #endif -#ifdef CONFIG_DUMMY_CONSOLE - conswitchp = &dummy_con; -#endif mach_max_dma_address = 0xffffffff; if (hp300_model >= HP_330 && hp300_model <= HP_433S && hp300_model != HP_350) { diff --git a/arch/m68k/ifpsp060/iskeleton.S b/arch/m68k/ifpsp060/iskeleton.S index 4ba2c74da93..b2dbdf5ee30 100644 --- a/arch/m68k/ifpsp060/iskeleton.S +++ b/arch/m68k/ifpsp060/iskeleton.S @@ -75,10 +75,8 @@ _060_isp_done: .Lnotkern: SAVE_ALL_INT GET_CURRENT(%d0) - tstb %curptr@(TASK_NEEDRESCHED) - jne ret_from_exception | deliver signals, - | reschedule etc.. - RESTORE_ALL + | deliver signals, reschedule etc.. + jra ret_from_exception | | _060_real_chk(): diff --git a/arch/m68k/kernel/asm-offsets.c b/arch/m68k/kernel/asm-offsets.c index cee3317b866..246a8820c22 100644 --- a/arch/m68k/kernel/asm-offsets.c +++ b/arch/m68k/kernel/asm-offsets.c @@ -25,12 +25,8 @@ int main(void) DEFINE(TASK_STATE, offsetof(struct task_struct, state)); DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags)); DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace)); - DEFINE(TASK_WORK, offsetof(struct task_struct, thread.work)); - DEFINE(TASK_NEEDRESCHED, offsetof(struct task_struct, thread.work.need_resched)); - DEFINE(TASK_SYSCALL_TRACE, offsetof(struct task_struct, thread.work.syscall_trace)); - DEFINE(TASK_SIGPENDING, offsetof(struct task_struct, thread.work.sigpending)); - DEFINE(TASK_NOTIFY_RESUME, offsetof(struct task_struct, thread.work.notify_resume)); DEFINE(TASK_THREAD, offsetof(struct task_struct, thread)); + DEFINE(TASK_INFO, offsetof(struct task_struct, thread.info)); DEFINE(TASK_MM, offsetof(struct task_struct, mm)); DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm)); @@ -45,6 +41,10 @@ int main(void) DEFINE(THREAD_FPCNTL, offsetof(struct thread_struct, fpcntl)); DEFINE(THREAD_FPSTATE, offsetof(struct thread_struct, fpstate)); + /* offsets into the thread_info struct */ + DEFINE(TINFO_PREEMPT, offsetof(struct thread_info, preempt_count)); + DEFINE(TINFO_FLAGS, offsetof(struct thread_info, flags)); + /* offsets into the pt_regs */ DEFINE(PT_D0, offsetof(struct pt_regs, d0)); DEFINE(PT_ORIG_D0, offsetof(struct pt_regs, orig_d0)); @@ -92,7 +92,7 @@ int main(void) DEFINE(TRAP_TRACE, TRAP_TRACE); /* offsets into the custom struct */ - DEFINE(CUSTOMBASE, &custom); + DEFINE(CUSTOMBASE, &amiga_custom); DEFINE(C_INTENAR, offsetof(struct CUSTOM, intenar)); DEFINE(C_INTREQR, offsetof(struct CUSTOM, intreqr)); DEFINE(C_INTENA, offsetof(struct CUSTOM, intena)); diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S index 23ca60a4555..320fde05dc6 100644 --- a/arch/m68k/kernel/entry.S +++ b/arch/m68k/kernel/entry.S @@ -44,9 +44,7 @@ #include <asm/asm-offsets.h> -.globl system_call, buserr, trap -.globl resume, ret_from_exception -.globl ret_from_signal +.globl system_call, buserr, trap, resume .globl inthandler, sys_call_table .globl sys_fork, sys_clone, sys_vfork .globl ret_from_interrupt, bad_interrupt @@ -58,7 +56,7 @@ ENTRY(buserr) movel %sp,%sp@- | stack frame pointer argument bsrl buserr_c addql #4,%sp - jra ret_from_exception + jra .Lret_from_exception ENTRY(trap) SAVE_ALL_INT @@ -66,7 +64,7 @@ ENTRY(trap) movel %sp,%sp@- | stack frame pointer argument bsrl trap_c addql #4,%sp - jra ret_from_exception + jra .Lret_from_exception | After a fork we jump here directly from resume, | so that %d1 contains the previous task @@ -75,30 +73,31 @@ ENTRY(ret_from_fork) movel %d1,%sp@- jsr schedule_tail addql #4,%sp - jra ret_from_exception + jra .Lret_from_exception -badsys: - movel #-ENOSYS,%sp@(PT_D0) - jra ret_from_exception - -do_trace: +do_trace_entry: movel #-ENOSYS,%sp@(PT_D0) | needed for strace subql #4,%sp SAVE_SWITCH_STACK jbsr syscall_trace RESTORE_SWITCH_STACK addql #4,%sp - movel %sp@(PT_ORIG_D0),%d1 - movel #-ENOSYS,%d0 - cmpl #NR_syscalls,%d1 - jcc 1f - jbsr @(sys_call_table,%d1:l:4)@(0) -1: movel %d0,%sp@(PT_D0) | save the return value - subql #4,%sp | dummy return address + movel %sp@(PT_ORIG_D0),%d0 + cmpl #NR_syscalls,%d0 + jcs syscall +badsys: + movel #-ENOSYS,%sp@(PT_D0) + jra ret_from_syscall + +do_trace_exit: + subql #4,%sp SAVE_SWITCH_STACK jbsr syscall_trace + RESTORE_SWITCH_STACK + addql #4,%sp + jra .Lret_from_exception -ret_from_signal: +ENTRY(ret_from_signal) RESTORE_SWITCH_STACK addql #4,%sp /* on 68040 complete pending writebacks if any */ @@ -111,7 +110,7 @@ ret_from_signal: addql #4,%sp 1: #endif - jra ret_from_exception + jra .Lret_from_exception ENTRY(system_call) SAVE_ALL_SYS @@ -120,30 +119,34 @@ ENTRY(system_call) | save top of frame movel %sp,%curptr@(TASK_THREAD+THREAD_ESP0) - tstb %curptr@(TASK_SYSCALL_TRACE) - jne do_trace + | syscall trace? + tstb %curptr@(TASK_INFO+TINFO_FLAGS+2) + jmi do_trace_entry cmpl #NR_syscalls,%d0 jcc badsys +syscall: jbsr @(sys_call_table,%d0:l:4)@(0) movel %d0,%sp@(PT_D0) | save the return value - +ret_from_syscall: |oriw #0x0700,%sr - movel %curptr@(TASK_WORK),%d0 + movew %curptr@(TASK_INFO+TINFO_FLAGS+2),%d0 jne syscall_exit_work 1: RESTORE_ALL syscall_exit_work: btst #5,%sp@(PT_SR) | check if returning to kernel bnes 1b | if so, skip resched, signals - tstw %d0 - jeq do_signal_return - tstb %d0 - jne do_delayed_trace - + lslw #1,%d0 + jcs do_trace_exit + jmi do_delayed_trace + lslw #8,%d0 + jmi do_signal_return pea resume_userspace - jmp schedule + jra schedule + -ret_from_exception: +ENTRY(ret_from_exception) +.Lret_from_exception: btst #5,%sp@(PT_SR) | check if returning to kernel bnes 1f | if so, skip resched, signals | only allow interrupts when we are really the last one on the @@ -152,19 +155,18 @@ ret_from_exception: andw #ALLOWINT,%sr resume_userspace: - movel %curptr@(TASK_WORK),%d0 - lsrl #8,%d0 + moveb %curptr@(TASK_INFO+TINFO_FLAGS+3),%d0 jne exit_work 1: RESTORE_ALL exit_work: | save top of frame movel %sp,%curptr@(TASK_THREAD+THREAD_ESP0) - tstb %d0 - jeq do_signal_return - + lslb #1,%d0 + jmi do_signal_return pea resume_userspace - jmp schedule + jra schedule + do_signal_return: |andw #ALLOWINT,%sr @@ -254,7 +256,7 @@ ret_from_interrupt: /* check if we need to do software interrupts */ tstl irq_stat+CPUSTAT_SOFTIRQ_PENDING - jeq ret_from_exception + jeq .Lret_from_exception pea ret_from_exception jra do_softirq diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S index d4336d846df..70002c146ee 100644 --- a/arch/m68k/kernel/head.S +++ b/arch/m68k/kernel/head.S @@ -273,8 +273,10 @@ * Macintosh console support */ +#ifdef CONFIG_FRAMEBUFFER_CONSOLE #define CONSOLE #define CONSOLE_PENGUIN +#endif /* * Macintosh serial debug support; outputs boot info to the printer diff --git a/arch/m68k/kernel/m68k_ksyms.c b/arch/m68k/kernel/m68k_ksyms.c index 73e2f5e168d..3d7f2000b71 100644 --- a/arch/m68k/kernel/m68k_ksyms.c +++ b/arch/m68k/kernel/m68k_ksyms.c @@ -23,8 +23,6 @@ asmlinkage long long __lshrdi3 (long long, int); asmlinkage long long __muldi3 (long long, long long); extern char m68k_debug_device[]; -extern void dump_thread(struct pt_regs *, struct user *); - /* platform dependent support */ EXPORT_SYMBOL(m68k_machtype); diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c index 13d109328a4..3f9cb55d035 100644 --- a/arch/m68k/kernel/process.c +++ b/arch/m68k/kernel/process.c @@ -238,10 +238,9 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, { struct pt_regs * childregs; struct switch_stack * childstack, *stack; - unsigned long stack_offset, *retp; + unsigned long *retp; - stack_offset = THREAD_SIZE - sizeof(struct pt_regs); - childregs = (struct pt_regs *) ((unsigned long) (p->thread_info) + stack_offset); + childregs = (struct pt_regs *) (task_stack_page(p) + THREAD_SIZE) - 1; *childregs = *regs; childregs->d0 = 0; @@ -386,7 +385,7 @@ unsigned long get_wchan(struct task_struct *p) if (!p || p == current || p->state == TASK_RUNNING) return 0; - stack_page = (unsigned long)(p->thread_info); + stack_page = (unsigned long)task_stack_page(p); fp = ((struct switch_stack *)p->thread.ksp)->a6; do { if (fp < stack_page+sizeof(struct thread_info) || diff --git a/arch/m68k/kernel/ptrace.c b/arch/m68k/kernel/ptrace.c index 7e54422685c..540638ca81f 100644 --- a/arch/m68k/kernel/ptrace.c +++ b/arch/m68k/kernel/ptrace.c @@ -109,7 +109,7 @@ static inline void singlestep_disable(struct task_struct *child) { unsigned long tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16); put_reg(child, PT_SR, tmp); - child->thread.work.delayed_trace = 0; + clear_tsk_thread_flag(child, TIF_DELAYED_TRACE); } /* @@ -118,7 +118,7 @@ static inline void singlestep_disable(struct task_struct *child) void ptrace_disable(struct task_struct *child) { singlestep_disable(child); - child->thread.work.syscall_trace = 0; + clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); } long arch_ptrace(struct task_struct *child, long request, long addr, long data) @@ -198,9 +198,9 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) goto out_eio; if (request == PTRACE_SYSCALL) - child->thread.work.syscall_trace = ~0; + set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); else - child->thread.work.syscall_trace = 0; + clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); child->exit_code = data; singlestep_disable(child); wake_up_process(child); @@ -223,10 +223,10 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) if (!valid_signal(data)) goto out_eio; - child->thread.work.syscall_trace = 0; + clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); tmp = get_reg(child, PT_SR) | (TRACE_BITS << 16); put_reg(child, PT_SR, tmp); - child->thread.work.delayed_trace = 1; + set_tsk_thread_flag(child, TIF_DELAYED_TRACE); child->exit_code = data; /* give it a chance to run. */ @@ -288,9 +288,6 @@ out_eio: asmlinkage void syscall_trace(void) { - if (!current->thread.work.delayed_trace && - !current->thread.work.syscall_trace) - return; ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) ? 0x80 : 0)); /* diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c index d6ca99242e5..750d5b3c971 100644 --- a/arch/m68k/kernel/setup.c +++ b/arch/m68k/kernel/setup.c @@ -84,9 +84,6 @@ void (*mach_reset)( void ); void (*mach_halt)( void ); void (*mach_power_off)( void ); long mach_max_dma_address = 0x00ffffff; /* default set to the lower 16MB */ -#if defined(CONFIG_AMIGA_FLOPPY) || defined(CONFIG_ATARI_FLOPPY) -void (*mach_floppy_setup) (char *, int *) __initdata = NULL; -#endif #ifdef CONFIG_HEARTBEAT void (*mach_heartbeat) (int); EXPORT_SYMBOL(mach_heartbeat); @@ -100,6 +97,8 @@ void (*mach_beep)(unsigned int, unsigned int); #if defined(CONFIG_ISA) && defined(MULTI_ISA) int isa_type; int isa_sex; +EXPORT_SYMBOL(isa_type); +EXPORT_SYMBOL(isa_sex); #endif extern int amiga_parse_bootinfo(const struct bi_record *); @@ -280,6 +279,10 @@ void __init setup_arch(char **cmdline_p) } } +#ifdef CONFIG_DUMMY_CONSOLE + conswitchp = &dummy_con; +#endif + switch (m68k_machtype) { #ifdef CONFIG_AMIGA case MACH_AMIGA: @@ -521,16 +524,6 @@ int get_hardware_list(char *buffer) return(len); } - -#if defined(CONFIG_AMIGA_FLOPPY) || defined(CONFIG_ATARI_FLOPPY) -void __init floppy_setup(char *str, int *ints) -{ - if (mach_floppy_setup) - mach_floppy_setup (str, ints); -} - -#endif - void check_bugs(void) { #ifndef CONFIG_M68KFPU_EMU diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c index 9c636a4c238..866917bfa02 100644 --- a/arch/m68k/kernel/signal.c +++ b/arch/m68k/kernel/signal.c @@ -96,7 +96,7 @@ asmlinkage int do_sigsuspend(struct pt_regs *regs) asmlinkage int do_rt_sigsuspend(struct pt_regs *regs) { - sigset_t *unewset = (sigset_t *)regs->d1; + sigset_t __user *unewset = (sigset_t __user *)regs->d1; size_t sigsetsize = (size_t)regs->d2; sigset_t saveset, newset; @@ -122,8 +122,8 @@ do_rt_sigsuspend(struct pt_regs *regs) } asmlinkage int -sys_sigaction(int sig, const struct old_sigaction *act, - struct old_sigaction *oact) +sys_sigaction(int sig, const struct old_sigaction __user *act, + struct old_sigaction __user *oact) { struct k_sigaction new_ka, old_ka; int ret; @@ -154,7 +154,7 @@ sys_sigaction(int sig, const struct old_sigaction *act, } asmlinkage int -sys_sigaltstack(const stack_t *uss, stack_t *uoss) +sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) { return do_sigaltstack(uss, uoss, rdusp()); } @@ -169,10 +169,10 @@ sys_sigaltstack(const stack_t *uss, stack_t *uoss) struct sigframe { - char *pretcode; + char __user *pretcode; int sig; int code; - struct sigcontext *psc; + struct sigcontext __user *psc; char retcode[8]; unsigned long extramask[_NSIG_WORDS-1]; struct sigcontext sc; @@ -180,10 +180,10 @@ struct sigframe struct rt_sigframe { - char *pretcode; + char __user *pretcode; int sig; - struct siginfo *pinfo; - void *puc; + struct siginfo __user *pinfo; + void __user *puc; char retcode[8]; struct siginfo info; struct ucontext uc; @@ -248,7 +248,7 @@ out: #define uc_formatvec uc_filler[FPCONTEXT_SIZE/4] #define uc_extra uc_filler[FPCONTEXT_SIZE/4+1] -static inline int rt_restore_fpu_state(struct ucontext *uc) +static inline int rt_restore_fpu_state(struct ucontext __user *uc) { unsigned char fpstate[FPCONTEXT_SIZE]; int context_size = CPU_IS_060 ? 8 : 0; @@ -267,7 +267,7 @@ static inline int rt_restore_fpu_state(struct ucontext *uc) return 0; } - if (__get_user(*(long *)fpstate, (long *)&uc->uc_fpstate)) + if (__get_user(*(long *)fpstate, (long __user *)&uc->uc_fpstate)) goto out; if (CPU_IS_060 ? fpstate[2] : fpstate[0]) { if (!CPU_IS_060) @@ -306,7 +306,7 @@ static inline int rt_restore_fpu_state(struct ucontext *uc) "m" (*fpregs.f_fpcntl)); } if (context_size && - __copy_from_user(fpstate + 4, (long *)&uc->uc_fpstate + 1, + __copy_from_user(fpstate + 4, (long __user *)&uc->uc_fpstate + 1, context_size)) goto out; __asm__ volatile (".chip 68k/68881\n\t" @@ -319,7 +319,7 @@ out: } static inline int -restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc, void *fp, +restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *usc, void __user *fp, int *pd0) { int fsize, formatvec; @@ -404,10 +404,10 @@ badframe: static inline int rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw, - struct ucontext *uc, int *pd0) + struct ucontext __user *uc, int *pd0) { int fsize, temp; - greg_t *gregs = uc->uc_mcontext.gregs; + greg_t __user *gregs = uc->uc_mcontext.gregs; unsigned long usp; int err; @@ -506,7 +506,7 @@ asmlinkage int do_sigreturn(unsigned long __unused) struct switch_stack *sw = (struct switch_stack *) &__unused; struct pt_regs *regs = (struct pt_regs *) (sw + 1); unsigned long usp = rdusp(); - struct sigframe *frame = (struct sigframe *)(usp - 4); + struct sigframe __user *frame = (struct sigframe __user *)(usp - 4); sigset_t set; int d0; @@ -536,7 +536,7 @@ asmlinkage int do_rt_sigreturn(unsigned long __unused) struct switch_stack *sw = (struct switch_stack *) &__unused; struct pt_regs *regs = (struct pt_regs *) (sw + 1); unsigned long usp = rdusp(); - struct rt_sigframe *frame = (struct rt_sigframe *)(usp - 4); + struct rt_sigframe __user *frame = (struct rt_sigframe __user *)(usp - 4); sigset_t set; int d0; @@ -596,7 +596,7 @@ static inline void save_fpu_state(struct sigcontext *sc, struct pt_regs *regs) } } -static inline int rt_save_fpu_state(struct ucontext *uc, struct pt_regs *regs) +static inline int rt_save_fpu_state(struct ucontext __user *uc, struct pt_regs *regs) { unsigned char fpstate[FPCONTEXT_SIZE]; int context_size = CPU_IS_060 ? 8 : 0; @@ -617,7 +617,7 @@ static inline int rt_save_fpu_state(struct ucontext *uc, struct pt_regs *regs) ".chip 68k" : : "m" (*fpstate) : "memory"); - err |= __put_user(*(long *)fpstate, (long *)&uc->uc_fpstate); + err |= __put_user(*(long *)fpstate, (long __user *)&uc->uc_fpstate); if (CPU_IS_060 ? fpstate[2] : fpstate[0]) { fpregset_t fpregs; if (!CPU_IS_060) @@ -642,7 +642,7 @@ static inline int rt_save_fpu_state(struct ucontext *uc, struct pt_regs *regs) sizeof(fpregs)); } if (context_size) - err |= copy_to_user((long *)&uc->uc_fpstate + 1, fpstate + 4, + err |= copy_to_user((long __user *)&uc->uc_fpstate + 1, fpstate + 4, context_size); return err; } @@ -662,10 +662,10 @@ static void setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs, save_fpu_state(sc, regs); } -static inline int rt_setup_ucontext(struct ucontext *uc, struct pt_regs *regs) +static inline int rt_setup_ucontext(struct ucontext __user *uc, struct pt_regs *regs) { struct switch_stack *sw = (struct switch_stack *)regs - 1; - greg_t *gregs = uc->uc_mcontext.gregs; + greg_t __user *gregs = uc->uc_mcontext.gregs; int err = 0; err |= __put_user(MCONTEXT_VERSION, &uc->uc_mcontext.version); @@ -753,7 +753,7 @@ static inline void push_cache (unsigned long vaddr) } } -static inline void * +static inline void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size) { unsigned long usp; @@ -766,13 +766,13 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size) if (!on_sig_stack(usp)) usp = current->sas_ss_sp + current->sas_ss_size; } - return (void *)((usp - frame_size) & -8UL); + return (void __user *)((usp - frame_size) & -8UL); } static void setup_frame (int sig, struct k_sigaction *ka, sigset_t *set, struct pt_regs *regs) { - struct sigframe *frame; + struct sigframe __user *frame; int fsize = frame_extra_sizes[regs->format]; struct sigcontext context; int err = 0; @@ -813,7 +813,7 @@ static void setup_frame (int sig, struct k_sigaction *ka, err |= __put_user(frame->retcode, &frame->pretcode); /* moveq #,d0; trap #0 */ err |= __put_user(0x70004e40 + (__NR_sigreturn << 16), - (long *)(frame->retcode)); + (long __user *)(frame->retcode)); if (err) goto give_sigsegv; @@ -849,7 +849,7 @@ give_sigsegv: static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *set, struct pt_regs *regs) { - struct rt_sigframe *frame; + struct rt_sigframe __user *frame; int fsize = frame_extra_sizes[regs->format]; int err = 0; @@ -880,8 +880,8 @@ static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info, /* Create the ucontext. */ err |= __put_user(0, &frame->uc.uc_flags); - err |= __put_user(0, &frame->uc.uc_link); - err |= __put_user((void *)current->sas_ss_sp, + err |= __put_user(NULL, &frame->uc.uc_link); + err |= __put_user((void __user *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); err |= __put_user(sas_ss_flags(rdusp()), &frame->uc.uc_stack.ss_flags); @@ -893,8 +893,8 @@ static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info, err |= __put_user(frame->retcode, &frame->pretcode); /* moveq #,d0; notb d0; trap #0 */ err |= __put_user(0x70004600 + ((__NR_rt_sigreturn ^ 0xff) << 16), - (long *)(frame->retcode + 0)); - err |= __put_user(0x4e40, (short *)(frame->retcode + 4)); + (long __user *)(frame->retcode + 0)); + err |= __put_user(0x4e40, (short __user *)(frame->retcode + 4)); if (err) goto give_sigsegv; diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c index 2ed7b783f65..143c552d38f 100644 --- a/arch/m68k/kernel/sys_m68k.c +++ b/arch/m68k/kernel/sys_m68k.c @@ -6,6 +6,7 @@ * platform. */ +#include <linux/capability.h> #include <linux/errno.h> #include <linux/sched.h> #include <linux/mm.h> @@ -31,7 +32,7 @@ * sys_pipe() is the normal C calling standard for creating * a pipe. It's not the way unix traditionally does this, though. */ -asmlinkage int sys_pipe(unsigned long * fildes) +asmlinkage int sys_pipe(unsigned long __user * fildes) { int fd[2]; int error; @@ -93,7 +94,7 @@ struct mmap_arg_struct { unsigned long offset; }; -asmlinkage int old_mmap(struct mmap_arg_struct *arg) +asmlinkage int old_mmap(struct mmap_arg_struct __user *arg) { struct mmap_arg_struct a; int error = -EFAULT; @@ -159,11 +160,11 @@ out: struct sel_arg_struct { unsigned long n; - fd_set *inp, *outp, *exp; - struct timeval *tvp; + fd_set __user *inp, *outp, *exp; + struct timeval __user *tvp; }; -asmlinkage int old_select(struct sel_arg_struct *arg) +asmlinkage int old_select(struct sel_arg_struct __user *arg) { struct sel_arg_struct a; @@ -179,7 +180,7 @@ asmlinkage int old_select(struct sel_arg_struct *arg) * This is really horribly ugly. */ asmlinkage int sys_ipc (uint call, int first, int second, - int third, void *ptr, long fifth) + int third, void __user *ptr, long fifth) { int version, ret; @@ -189,14 +190,14 @@ asmlinkage int sys_ipc (uint call, int first, int second, if (call <= SEMCTL) switch (call) { case SEMOP: - return sys_semop (first, (struct sembuf *)ptr, second); + return sys_semop (first, ptr, second); case SEMGET: return sys_semget (first, second, third); case SEMCTL: { union semun fourth; if (!ptr) return -EINVAL; - if (get_user(fourth.__pad, (void **) ptr)) + if (get_user(fourth.__pad, (void __user *__user *) ptr)) return -EFAULT; return sys_semctl (first, second, third, fourth); } @@ -206,31 +207,26 @@ asmlinkage int sys_ipc (uint call, int first, int second, if (call <= MSGCTL) switch (call) { case MSGSND: - return sys_msgsnd (first, (struct msgbuf *) ptr, - second, third); + return sys_msgsnd (first, ptr, second, third); case MSGRCV: switch (version) { case 0: { struct ipc_kludge tmp; if (!ptr) return -EINVAL; - if (copy_from_user (&tmp, - (struct ipc_kludge *)ptr, - sizeof (tmp))) + if (copy_from_user (&tmp, ptr, sizeof (tmp))) return -EFAULT; return sys_msgrcv (first, tmp.msgp, second, tmp.msgtyp, third); } default: - return sys_msgrcv (first, - (struct msgbuf *) ptr, + return sys_msgrcv (first, ptr, second, fifth, third); } case MSGGET: return sys_msgget ((key_t) first, second); case MSGCTL: - return sys_msgctl (first, second, - (struct msqid_ds *) ptr); + return sys_msgctl (first, second, ptr); default: return -ENOSYS; } @@ -240,20 +236,18 @@ asmlinkage int sys_ipc (uint call, int first, int second, switch (version) { default: { ulong raddr; - ret = do_shmat (first, (char *) ptr, - second, &raddr); + ret = do_shmat (first, ptr, second, &raddr); if (ret) return ret; - return put_user (raddr, (ulong *) third); + return put_user (raddr, (ulong __user *) third); } } case SHMDT: - return sys_shmdt ((char *)ptr); + return sys_shmdt (ptr); case SHMGET: return sys_shmget (first, second, third); case SHMCTL: - return sys_shmctl (first, second, - (struct shmid_ds *) ptr); + return sys_shmctl (first, second, ptr); default: return -ENOSYS; } diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c index deb36e8b04a..cdf58fbb3e7 100644 --- a/arch/m68k/kernel/traps.c +++ b/arch/m68k/kernel/traps.c @@ -169,25 +169,25 @@ void __init trap_init (void) if (CPU_IS_060 && !FPU_IS_EMU) { /* set up IFPSP entry points */ - asmlinkage void snan_vec(void) asm ("_060_fpsp_snan"); - asmlinkage void operr_vec(void) asm ("_060_fpsp_operr"); - asmlinkage void ovfl_vec(void) asm ("_060_fpsp_ovfl"); - asmlinkage void unfl_vec(void) asm ("_060_fpsp_unfl"); - asmlinkage void dz_vec(void) asm ("_060_fpsp_dz"); - asmlinkage void inex_vec(void) asm ("_060_fpsp_inex"); - asmlinkage void fline_vec(void) asm ("_060_fpsp_fline"); - asmlinkage void unsupp_vec(void) asm ("_060_fpsp_unsupp"); - asmlinkage void effadd_vec(void) asm ("_060_fpsp_effadd"); - - vectors[VEC_FPNAN] = snan_vec; - vectors[VEC_FPOE] = operr_vec; - vectors[VEC_FPOVER] = ovfl_vec; - vectors[VEC_FPUNDER] = unfl_vec; - vectors[VEC_FPDIVZ] = dz_vec; - vectors[VEC_FPIR] = inex_vec; - vectors[VEC_LINE11] = fline_vec; - vectors[VEC_FPUNSUP] = unsupp_vec; - vectors[VEC_UNIMPEA] = effadd_vec; + asmlinkage void snan_vec6(void) asm ("_060_fpsp_snan"); + asmlinkage void operr_vec6(void) asm ("_060_fpsp_operr"); + asmlinkage void ovfl_vec6(void) asm ("_060_fpsp_ovfl"); + asmlinkage void unfl_vec6(void) asm ("_060_fpsp_unfl"); + asmlinkage void dz_vec6(void) asm ("_060_fpsp_dz"); + asmlinkage void inex_vec6(void) asm ("_060_fpsp_inex"); + asmlinkage void fline_vec6(void) asm ("_060_fpsp_fline"); + asmlinkage void unsupp_vec6(void) asm ("_060_fpsp_unsupp"); + asmlinkage void effadd_vec6(void) asm ("_060_fpsp_effadd"); + + vectors[VEC_FPNAN] = snan_vec6; + vectors[VEC_FPOE] = operr_vec6; + vectors[VEC_FPOVER] = ovfl_vec6; + vectors[VEC_FPUNDER] = unfl_vec6; + vectors[VEC_FPDIVZ] = dz_vec6; + vectors[VEC_FPIR] = inex_vec6; + vectors[VEC_LINE11] = fline_vec6; + vectors[VEC_FPUNSUP] = unsupp_vec6; + vectors[VEC_UNIMPEA] = effadd_vec6; } /* if running on an amiga, make the NMI interrupt do nothing */ diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds index e58654f3f8d..69d1d3d30c7 100644 --- a/arch/m68k/kernel/vmlinux-std.lds +++ b/arch/m68k/kernel/vmlinux-std.lds @@ -13,6 +13,7 @@ SECTIONS .text : { *(.text) SCHED_TEXT + LOCK_TEXT *(.fixup) *(.gnu.warning) } :text = 0x4e75 diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds index cc37e8d3c1e..65cc39c2418 100644 --- a/arch/m68k/kernel/vmlinux-sun3.lds +++ b/arch/m68k/kernel/vmlinux-sun3.lds @@ -14,6 +14,7 @@ SECTIONS *(.head) *(.text) SCHED_TEXT + LOCK_TEXT *(.fixup) *(.gnu.warning) } :text = 0x4e75 @@ -66,7 +67,7 @@ __init_begin = .; __initramfs_end = .; . = ALIGN(8192); __init_end = .; - .init.task : { *(init_task) } + .data.init.task : { *(.data.init_task) } .bss : { *(.bss) } /* BSS */ diff --git a/arch/m68k/lib/checksum.c b/arch/m68k/lib/checksum.c index 4a5c5445c61..cb13c6e3cca 100644 --- a/arch/m68k/lib/checksum.c +++ b/arch/m68k/lib/checksum.c @@ -134,7 +134,7 @@ EXPORT_SYMBOL(csum_partial); */ unsigned int -csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst, +csum_partial_copy_from_user(const unsigned char __user *src, unsigned char *dst, int len, int sum, int *csum_err) { /* diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index cd19cbb213e..14f8d3f4e19 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -212,9 +212,6 @@ void __init config_mac(void) mach_reset = mac_reset; mach_halt = mac_poweroff; mach_power_off = mac_poweroff; -#ifdef CONFIG_DUMMY_CONSOLE - conswitchp = &dummy_con; -#endif mach_max_dma_address = 0xffffffff; #if 0 mach_debug_init = mac_debug_init; diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c index d889ba80ccd..9179a379840 100644 --- a/arch/m68k/mac/iop.c +++ b/arch/m68k/mac/iop.c @@ -293,8 +293,8 @@ void __init iop_init(void) } for (i = 0 ; i < NUM_IOP_CHAN ; i++) { - iop_send_queue[IOP_NUM_SCC][i] = 0; - iop_send_queue[IOP_NUM_ISM][i] = 0; + iop_send_queue[IOP_NUM_SCC][i] = NULL; + iop_send_queue[IOP_NUM_ISM][i] = NULL; iop_listeners[IOP_NUM_SCC][i].devname = NULL; iop_listeners[IOP_NUM_SCC][i].handler = NULL; iop_listeners[IOP_NUM_ISM][i].devname = NULL; diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c index 5b80d7cd954..bbb0c3b95e9 100644 --- a/arch/m68k/mac/misc.c +++ b/arch/m68k/mac/misc.c @@ -39,72 +39,163 @@ extern struct mac_booter_data mac_bi_data; static void (*rom_reset)(void); -#ifdef CONFIG_ADB -/* - * Return the current time as the number of seconds since January 1, 1904. - */ - -static long adb_read_time(void) +#ifdef CONFIG_ADB_CUDA +static long cuda_read_time(void) { - volatile struct adb_request req; + struct adb_request req; long time; - adb_request((struct adb_request *) &req, NULL, - ADBREQ_RAW|ADBREQ_SYNC, - 2, CUDA_PACKET, CUDA_GET_TIME); + if (cuda_request(&req, NULL, 2, CUDA_PACKET, CUDA_GET_TIME) < 0) + return 0; + while (!req.complete) + cuda_poll(); time = (req.reply[3] << 24) | (req.reply[4] << 16) | (req.reply[5] << 8) | req.reply[6]; return time - RTC_OFFSET; } -/* - * Set the current system time - */ +static void cuda_write_time(long data) +{ + struct adb_request req; + data += RTC_OFFSET; + if (cuda_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME, + (data >> 24) & 0xFF, (data >> 16) & 0xFF, + (data >> 8) & 0xFF, data & 0xFF) < 0) + return; + while (!req.complete) + cuda_poll(); +} -static void adb_write_time(long data) +static __u8 cuda_read_pram(int offset) { - volatile struct adb_request req; + struct adb_request req; + if (cuda_request(&req, NULL, 4, CUDA_PACKET, CUDA_GET_PRAM, + (offset >> 8) & 0xFF, offset & 0xFF) < 0) + return 0; + while (!req.complete) + cuda_poll(); + return req.reply[3]; +} - data += RTC_OFFSET; +static void cuda_write_pram(int offset, __u8 data) +{ + struct adb_request req; + if (cuda_request(&req, NULL, 5, CUDA_PACKET, CUDA_SET_PRAM, + (offset >> 8) & 0xFF, offset & 0xFF, data) < 0) + return; + while (!req.complete) + cuda_poll(); +} +#else +#define cuda_read_time() 0 +#define cuda_write_time(n) +#define cuda_read_pram NULL +#define cuda_write_pram NULL +#endif + +#ifdef CONFIG_ADB_PMU68K +static long pmu_read_time(void) +{ + struct adb_request req; + long time; + + if (pmu_request(&req, NULL, 1, PMU_READ_RTC) < 0) + return 0; + while (!req.complete) + pmu_poll(); - adb_request((struct adb_request *) &req, NULL, - ADBREQ_RAW|ADBREQ_SYNC, - 6, CUDA_PACKET, CUDA_SET_TIME, + time = (req.reply[0] << 24) | (req.reply[1] << 16) + | (req.reply[2] << 8) | req.reply[3]; + return time - RTC_OFFSET; +} + +static void pmu_write_time(long data) +{ + struct adb_request req; + data += RTC_OFFSET; + if (pmu_request(&req, NULL, 5, PMU_SET_RTC, (data >> 24) & 0xFF, (data >> 16) & 0xFF, - (data >> 8) & 0xFF, data & 0xFF); + (data >> 8) & 0xFF, data & 0xFF) < 0) + return; + while (!req.complete) + pmu_poll(); } -/* - * Get a byte from the NVRAM - */ +static __u8 pmu_read_pram(int offset) +{ + struct adb_request req; + if (pmu_request(&req, NULL, 3, PMU_READ_NVRAM, + (offset >> 8) & 0xFF, offset & 0xFF) < 0) + return 0; + while (!req.complete) + pmu_poll(); + return req.reply[3]; +} -static __u8 adb_read_pram(int offset) +static void pmu_write_pram(int offset, __u8 data) { - volatile struct adb_request req; + struct adb_request req; + if (pmu_request(&req, NULL, 4, PMU_WRITE_NVRAM, + (offset >> 8) & 0xFF, offset & 0xFF, data) < 0) + return; + while (!req.complete) + pmu_poll(); +} +#else +#define pmu_read_time() 0 +#define pmu_write_time(n) +#define pmu_read_pram NULL +#define pmu_write_pram NULL +#endif - adb_request((struct adb_request *) &req, NULL, - ADBREQ_RAW|ADBREQ_SYNC, - 4, CUDA_PACKET, CUDA_GET_PRAM, - (offset >> 8) & 0xFF, offset & 0xFF); - return req.reply[3]; +#ifdef CONFIG_ADB_MACIISI +extern int maciisi_request(struct adb_request *req, + void (*done)(struct adb_request *), int nbytes, ...); + +static long maciisi_read_time(void) +{ + struct adb_request req; + long time; + + if (maciisi_request(&req, NULL, 2, CUDA_PACKET, CUDA_GET_TIME)) + return 0; + + time = (req.reply[3] << 24) | (req.reply[4] << 16) + | (req.reply[5] << 8) | req.reply[6]; + return time - RTC_OFFSET; } -/* - * Write a byte to the NVRAM - */ +static void maciisi_write_time(long data) +{ + struct adb_request req; + data += RTC_OFFSET; + maciisi_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME, + (data >> 24) & 0xFF, (data >> 16) & 0xFF, + (data >> 8) & 0xFF, data & 0xFF); +} -static void adb_write_pram(int offset, __u8 data) +static __u8 maciisi_read_pram(int offset) { - volatile struct adb_request req; + struct adb_request req; + if (maciisi_request(&req, NULL, 4, CUDA_PACKET, CUDA_GET_PRAM, + (offset >> 8) & 0xFF, offset & 0xFF)) + return 0; + return req.reply[3]; +} - adb_request((struct adb_request *) &req, NULL, - ADBREQ_RAW|ADBREQ_SYNC, - 5, CUDA_PACKET, CUDA_SET_PRAM, - (offset >> 8) & 0xFF, offset & 0xFF, - data); +static void maciisi_write_pram(int offset, __u8 data) +{ + struct adb_request req; + maciisi_request(&req, NULL, 5, CUDA_PACKET, CUDA_SET_PRAM, + (offset >> 8) & 0xFF, offset & 0xFF, data); } -#endif /* CONFIG_ADB */ +#else +#define maciisi_read_time() 0 +#define maciisi_write_time(n) +#define maciisi_read_pram NULL +#define maciisi_write_pram NULL +#endif /* * VIA PRAM/RTC access routines @@ -305,42 +396,55 @@ static void oss_shutdown(void) static void cuda_restart(void) { - adb_request(NULL, NULL, ADBREQ_RAW|ADBREQ_SYNC, - 2, CUDA_PACKET, CUDA_RESET_SYSTEM); + struct adb_request req; + if (cuda_request(&req, NULL, 2, CUDA_PACKET, CUDA_RESET_SYSTEM) < 0) + return; + while (!req.complete) + cuda_poll(); } static void cuda_shutdown(void) { - adb_request(NULL, NULL, ADBREQ_RAW|ADBREQ_SYNC, - 2, CUDA_PACKET, CUDA_POWERDOWN); + struct adb_request req; + if (cuda_request(&req, NULL, 2, CUDA_PACKET, CUDA_POWERDOWN) < 0) + return; + while (!req.complete) + cuda_poll(); } #endif /* CONFIG_ADB_CUDA */ -#ifdef CONFIG_ADB_PMU +#ifdef CONFIG_ADB_PMU68K void pmu_restart(void) { - adb_request(NULL, NULL, ADBREQ_RAW|ADBREQ_SYNC, - 3, PMU_PACKET, PMU_SET_INTR_MASK, - PMU_INT_ADB|PMU_INT_TICK); - - adb_request(NULL, NULL, ADBREQ_RAW|ADBREQ_SYNC, - 2, PMU_PACKET, PMU_RESET); + struct adb_request req; + if (pmu_request(&req, NULL, + 2, PMU_SET_INTR_MASK, PMU_INT_ADB|PMU_INT_TICK) < 0) + return; + while (!req.complete) + pmu_poll(); + if (pmu_request(&req, NULL, 1, PMU_RESET) < 0) + return; + while (!req.complete) + pmu_poll(); } void pmu_shutdown(void) { - adb_request(NULL, NULL, ADBREQ_RAW|ADBREQ_SYNC, - 3, PMU_PACKET, PMU_SET_INTR_MASK, - PMU_INT_ADB|PMU_INT_TICK); - - adb_request(NULL, NULL, ADBREQ_RAW|ADBREQ_SYNC, - 6, PMU_PACKET, PMU_SHUTDOWN, - 'M', 'A', 'T', 'T'); + struct adb_request req; + if (pmu_request(&req, NULL, + 2, PMU_SET_INTR_MASK, PMU_INT_ADB|PMU_INT_TICK) < 0) + return; + while (!req.complete) + pmu_poll(); + if (pmu_request(&req, NULL, 5, PMU_SHUTDOWN, 'M', 'A', 'T', 'T') < 0) + return; + while (!req.complete) + pmu_poll(); } -#endif /* CONFIG_ADB_PMU */ +#endif /* *------------------------------------------------------------------- @@ -351,21 +455,22 @@ void pmu_shutdown(void) void mac_pram_read(int offset, __u8 *buffer, int len) { - __u8 (*func)(int) = NULL; + __u8 (*func)(int); int i; - if (macintosh_config->adb_type == MAC_ADB_IISI || - macintosh_config->adb_type == MAC_ADB_PB1 || - macintosh_config->adb_type == MAC_ADB_PB2 || - macintosh_config->adb_type == MAC_ADB_CUDA) { -#ifdef CONFIG_ADB - func = adb_read_pram; -#else - return; -#endif - } else { + switch(macintosh_config->adb_type) { + case MAC_ADB_IISI: + func = maciisi_read_pram; break; + case MAC_ADB_PB1: + case MAC_ADB_PB2: + func = pmu_read_pram; break; + case MAC_ADB_CUDA: + func = cuda_read_pram; break; + default: func = via_read_pram; } + if (!func) + return; for (i = 0 ; i < len ; i++) { buffer[i] = (*func)(offset++); } @@ -373,21 +478,22 @@ void mac_pram_read(int offset, __u8 *buffer, int len) void mac_pram_write(int offset, __u8 *buffer, int len) { - void (*func)(int, __u8) = NULL; + void (*func)(int, __u8); int i; - if (macintosh_config->adb_type == MAC_ADB_IISI || - macintosh_config->adb_type == MAC_ADB_PB1 || - macintosh_config->adb_type == MAC_ADB_PB2 || - macintosh_config->adb_type == MAC_ADB_CUDA) { -#ifdef CONFIG_ADB - func = adb_write_pram; -#else - return; -#endif - } else { + switch(macintosh_config->adb_type) { + case MAC_ADB_IISI: + func = maciisi_write_pram; break; + case MAC_ADB_PB1: + case MAC_ADB_PB2: + func = pmu_write_pram; break; + case MAC_ADB_CUDA: + func = cuda_write_pram; break; + default: func = via_write_pram; } + if (!func) + return; for (i = 0 ; i < len ; i++) { (*func)(offset++, buffer[i]); } @@ -408,7 +514,7 @@ void mac_poweroff(void) } else if (macintosh_config->adb_type == MAC_ADB_CUDA) { cuda_shutdown(); #endif -#ifdef CONFIG_ADB_PMU +#ifdef CONFIG_ADB_PMU68K } else if (macintosh_config->adb_type == MAC_ADB_PB1 || macintosh_config->adb_type == MAC_ADB_PB2) { pmu_shutdown(); @@ -448,7 +554,7 @@ void mac_reset(void) } else if (macintosh_config->adb_type == MAC_ADB_CUDA) { cuda_restart(); #endif -#ifdef CONFIG_ADB_PMU +#ifdef CONFIG_ADB_PMU68K } else if (macintosh_config->adb_type == MAC_ADB_PB1 || macintosh_config->adb_type == MAC_ADB_PB2) { pmu_restart(); @@ -466,12 +572,13 @@ void mac_reset(void) /* make a 1-to-1 mapping, using the transparent tran. reg. */ unsigned long virt = (unsigned long) mac_reset; unsigned long phys = virt_to_phys(mac_reset); + unsigned long addr = (phys&0xFF000000)|0x8777; unsigned long offset = phys-virt; local_irq_disable(); /* lets not screw this up, ok? */ __asm__ __volatile__(".chip 68030\n\t" "pmove %0,%/tt0\n\t" ".chip 68k" - : : "m" ((phys&0xFF000000)|0x8777)); + : : "m" (addr)); /* Now jump to physical address so we can disable MMU */ __asm__ __volatile__( ".chip 68030\n\t" @@ -588,20 +695,22 @@ int mac_hwclk(int op, struct rtc_time *t) unsigned long now; if (!op) { /* read */ - if (macintosh_config->adb_type == MAC_ADB_II) { + switch (macintosh_config->adb_type) { + case MAC_ADB_II: + case MAC_ADB_IOP: now = via_read_time(); - } else -#ifdef CONFIG_ADB - if ((macintosh_config->adb_type == MAC_ADB_IISI) || - (macintosh_config->adb_type == MAC_ADB_PB1) || - (macintosh_config->adb_type == MAC_ADB_PB2) || - (macintosh_config->adb_type == MAC_ADB_CUDA)) { - now = adb_read_time(); - } else -#endif - if (macintosh_config->adb_type == MAC_ADB_IOP) { - now = via_read_time(); - } else { + break; + case MAC_ADB_IISI: + now = maciisi_read_time(); + break; + case MAC_ADB_PB1: + case MAC_ADB_PB2: + now = pmu_read_time(); + break; + case MAC_ADB_CUDA: + now = cuda_read_time(); + break; + default: now = 0; } @@ -619,15 +728,20 @@ int mac_hwclk(int op, struct rtc_time *t) now = mktime(t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); - if (macintosh_config->adb_type == MAC_ADB_II) { - via_write_time(now); - } else if ((macintosh_config->adb_type == MAC_ADB_IISI) || - (macintosh_config->adb_type == MAC_ADB_PB1) || - (macintosh_config->adb_type == MAC_ADB_PB2) || - (macintosh_config->adb_type == MAC_ADB_CUDA)) { - adb_write_time(now); - } else if (macintosh_config->adb_type == MAC_ADB_IOP) { + switch (macintosh_config->adb_type) { + case MAC_ADB_II: + case MAC_ADB_IOP: via_write_time(now); + break; + case MAC_ADB_CUDA: + cuda_write_time(now); + break; + case MAC_ADB_PB1: + case MAC_ADB_PB2: + pmu_write_time(now); + break; + case MAC_ADB_IISI: + maciisi_write_time(now); } #endif } diff --git a/arch/m68k/math-emu/multi_arith.h b/arch/m68k/math-emu/multi_arith.h index 02251e5afd8..4ad0ca918e2 100644 --- a/arch/m68k/math-emu/multi_arith.h +++ b/arch/m68k/math-emu/multi_arith.h @@ -366,7 +366,7 @@ static inline void fp_submant(struct fp_ext *dest, struct fp_ext *src1, #define fp_mul64(desth, destl, src1, src2) ({ \ asm ("mulu.l %2,%1:%0" : "=d" (destl), "=d" (desth) \ - : "g" (src1), "0" (src2)); \ + : "dm" (src1), "0" (src2)); \ }) #define fp_div64(quot, rem, srch, srcl, div) \ asm ("divu.l %2,%1:%0" : "=d" (quot), "=d" (rem) \ diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c index fe2383e36b0..85ad19a0ac7 100644 --- a/arch/m68k/mm/kmap.c +++ b/arch/m68k/mm/kmap.c @@ -102,7 +102,7 @@ static inline void free_io_area(void *addr) */ /* Rewritten by Andreas Schwab to remove all races. */ -void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag) +void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag) { struct vm_struct *area; unsigned long virtaddr, retaddr; @@ -121,7 +121,7 @@ void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag) if (MACH_IS_AMIGA) { if ((physaddr >= 0x40000000) && (physaddr + size < 0x60000000) && (cacheflag == IOMAP_NOCACHE_SER)) - return (void *)physaddr; + return (void __iomem *)physaddr; } #endif @@ -218,21 +218,21 @@ void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag) #endif flush_tlb_all(); - return (void *)retaddr; + return (void __iomem *)retaddr; } /* * Unmap a ioremap()ed region again */ -void iounmap(void *addr) +void iounmap(void __iomem *addr) { #ifdef CONFIG_AMIGA if ((!MACH_IS_AMIGA) || (((unsigned long)addr < 0x40000000) || ((unsigned long)addr > 0x60000000))) - free_io_area(addr); + free_io_area((__force void *)addr); #else - free_io_area(addr); + free_io_area((__force void *)addr); #endif } diff --git a/arch/m68k/mvme16x/rtc.c b/arch/m68k/mvme16x/rtc.c index 7977eae50af..a69fe3048ed 100644 --- a/arch/m68k/mvme16x/rtc.c +++ b/arch/m68k/mvme16x/rtc.c @@ -11,6 +11,7 @@ #include <linux/miscdevice.h> #include <linux/slab.h> #include <linux/ioport.h> +#include <linux/capability.h> #include <linux/fcntl.h> #include <linux/init.h> #include <linux/poll.h> @@ -44,6 +45,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, volatile MK48T08ptr_t rtc = (MK48T08ptr_t)MVME_RTC_BASE; unsigned long flags; struct rtc_time wtime; + void __user *argp = (void __user *)arg; switch (cmd) { case RTC_RD_TIME: /* Read the time/date from RTC */ @@ -63,7 +65,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, wtime.tm_wday = BCD2BIN(rtc->bcd_dow)-1; rtc->ctrl = 0; local_irq_restore(flags); - return copy_to_user((void *)arg, &wtime, sizeof wtime) ? + return copy_to_user(argp, &wtime, sizeof wtime) ? -EFAULT : 0; } case RTC_SET_TIME: /* Set the RTC */ @@ -75,8 +77,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, if (!capable(CAP_SYS_ADMIN)) return -EACCES; - if (copy_from_user(&rtc_tm, (struct rtc_time*)arg, - sizeof(struct rtc_time))) + if (copy_from_user(&rtc_tm, argp, sizeof(struct rtc_time))) return -EFAULT; yrs = rtc_tm.tm_year; diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c index 02b626bae4a..5e0f9b04d45 100644 --- a/arch/m68k/q40/config.c +++ b/arch/m68k/q40/config.c @@ -36,8 +36,6 @@ #include <asm/machdep.h> #include <asm/q40_master.h> -extern void floppy_setup(char *str, int *ints); - extern irqreturn_t q40_process_int (int level, struct pt_regs *regs); extern irqreturn_t (*q40_default_handler[]) (int, void *, struct pt_regs *); /* added just for debugging */ extern void q40_init_IRQ (void); @@ -194,9 +192,6 @@ void __init config_q40(void) mach_heartbeat = q40_heartbeat; #endif mach_halt = q40_halt; -#ifdef CONFIG_DUMMY_CONSOLE - conswitchp = &dummy_con; -#endif /* disable a few things that SMSQ might have left enabled */ q40_disable_irqs(); diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c index 77d05bcc322..f1ca0dfbaa6 100644 --- a/arch/m68k/sun3/config.c +++ b/arch/m68k/sun3/config.c @@ -160,9 +160,6 @@ void __init config_sun3(void) mach_hwclk = sun3_hwclk; mach_halt = sun3_halt; mach_get_hardware_list = sun3_get_hardware_list; -#if defined(CONFIG_DUMMY_CONSOLE) - conswitchp = &dummy_con; -#endif memory_start = ((((int)&_end) + 0x2000) & ~0x1fff); // PROM seems to want the last couple of physical pages. --m diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c index 0ef547f5494..0920f5d3360 100644 --- a/arch/m68k/sun3x/config.c +++ b/arch/m68k/sun3x/config.c @@ -71,10 +71,6 @@ void __init config_sun3x(void) mach_get_model = sun3_get_model; mach_get_hardware_list = sun3x_get_hardware_list; -#ifdef CONFIG_DUMMY_CONSOLE - conswitchp = &dummy_con; -#endif - sun3_intreg = (unsigned char *)SUN3X_INTREG; /* only the serial console is known to work anyway... */ |