diff options
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/coldfire/pit.c | 2 | ||||
-rw-r--r-- | arch/m68k/ifpsp060/src/ilsp.S | 2 | ||||
-rw-r--r-- | arch/m68k/ifpsp060/src/isp.S | 2 | ||||
-rw-r--r-- | arch/m68k/include/asm/Kbuild | 1 | ||||
-rw-r--r-- | arch/m68k/include/asm/processor.h | 10 | ||||
-rw-r--r-- | arch/m68k/include/asm/uaccess.h | 1 | ||||
-rw-r--r-- | arch/m68k/include/asm/uaccess_mm.h | 103 | ||||
-rw-r--r-- | arch/m68k/include/asm/uaccess_no.h | 43 | ||||
-rw-r--r-- | arch/m68k/include/uapi/asm/Kbuild | 24 | ||||
-rw-r--r-- | arch/m68k/kernel/signal.c | 2 | ||||
-rw-r--r-- | arch/m68k/kernel/traps.c | 9 | ||||
-rw-r--r-- | arch/m68k/lib/uaccess.c | 12 | ||||
-rw-r--r-- | arch/m68k/mac/config.c | 61 | ||||
-rw-r--r-- | arch/m68k/mac/iop.c | 93 | ||||
-rw-r--r-- | arch/m68k/mac/misc.c | 23 | ||||
-rw-r--r-- | arch/m68k/mm/fault.c | 2 |
16 files changed, 142 insertions, 248 deletions
diff --git a/arch/m68k/coldfire/pit.c b/arch/m68k/coldfire/pit.c index 175553d5b8ed..6c0878018b44 100644 --- a/arch/m68k/coldfire/pit.c +++ b/arch/m68k/coldfire/pit.c @@ -149,8 +149,10 @@ void hw_timer_init(irq_handler_t handler) cf_pit_clockevent.mult = div_sc(FREQ, NSEC_PER_SEC, 32); cf_pit_clockevent.max_delta_ns = clockevent_delta2ns(0xFFFF, &cf_pit_clockevent); + cf_pit_clockevent.max_delta_ticks = 0xFFFF; cf_pit_clockevent.min_delta_ns = clockevent_delta2ns(0x3f, &cf_pit_clockevent); + cf_pit_clockevent.min_delta_ticks = 0x3f; clockevents_register_device(&cf_pit_clockevent); setup_irq(MCF_IRQ_PIT1, &pit_irq); diff --git a/arch/m68k/ifpsp060/src/ilsp.S b/arch/m68k/ifpsp060/src/ilsp.S index 970abaf3303e..dd5b2c357e95 100644 --- a/arch/m68k/ifpsp060/src/ilsp.S +++ b/arch/m68k/ifpsp060/src/ilsp.S @@ -776,7 +776,7 @@ muls64_zero: # ALGORITHM *********************************************************** # # In the interest of simplicity, all operands are converted to # # longword size whether the operation is byte, word, or long. The # -# bounds are sign extended accordingly. If Rn is a data regsiter, Rn is # +# bounds are sign extended accordingly. If Rn is a data register, Rn is # # also sign extended. If Rn is an address register, it need not be sign # # extended since the full register is always used. # # The condition codes are set correctly before the final "rts". # diff --git a/arch/m68k/ifpsp060/src/isp.S b/arch/m68k/ifpsp060/src/isp.S index b865c1a052ba..29a9f8629b9d 100644 --- a/arch/m68k/ifpsp060/src/isp.S +++ b/arch/m68k/ifpsp060/src/isp.S @@ -1876,7 +1876,7 @@ movp_read_err: # word, or longword sized operands. Then, in the interest of # # simplicity, all operands are converted to longword size whether the # # operation is byte, word, or long. The bounds are sign extended # -# accordingly. If Rn is a data regsiter, Rn is also sign extended. If # +# accordingly. If Rn is a data register, Rn is also sign extended. If # # Rn is an address register, it need not be sign extended since the # # full register is always used. # # The comparisons are made and the condition codes calculated. # diff --git a/arch/m68k/include/asm/Kbuild b/arch/m68k/include/asm/Kbuild index d4f9ccbfa85c..82005d2ff717 100644 --- a/arch/m68k/include/asm/Kbuild +++ b/arch/m68k/include/asm/Kbuild @@ -5,6 +5,7 @@ generic-y += device.h generic-y += emergency-restart.h generic-y += errno.h generic-y += exec.h +generic-y += extable.h generic-y += futex.h generic-y += hw_irq.h generic-y += ioctl.h diff --git a/arch/m68k/include/asm/processor.h b/arch/m68k/include/asm/processor.h index f5f790c31bf8..77239e81379b 100644 --- a/arch/m68k/include/asm/processor.h +++ b/arch/m68k/include/asm/processor.h @@ -122,16 +122,6 @@ static inline void start_thread(struct pt_regs * regs, unsigned long pc, wrusp(usp); } -#ifdef CONFIG_MMU -extern int handle_kernel_fault(struct pt_regs *regs); -#else -static inline int handle_kernel_fault(struct pt_regs *regs) -{ - /* Any fault in kernel is fatal on non-mmu */ - return 0; -} -#endif - /* Forward declaration, a strange C thing */ struct task_struct; diff --git a/arch/m68k/include/asm/uaccess.h b/arch/m68k/include/asm/uaccess.h index 3fadc4a93d97..67b3481d6020 100644 --- a/arch/m68k/include/asm/uaccess.h +++ b/arch/m68k/include/asm/uaccess.h @@ -4,6 +4,7 @@ #include <asm/uaccess_mm.h> #endif +#include <asm/extable.h> #ifdef CONFIG_CPU_HAS_NO_UNALIGNED #include <asm-generic/uaccess-unaligned.h> #else diff --git a/arch/m68k/include/asm/uaccess_mm.h b/arch/m68k/include/asm/uaccess_mm.h index d228601b3afc..ef856ffeffdf 100644 --- a/arch/m68k/include/asm/uaccess_mm.h +++ b/arch/m68k/include/asm/uaccess_mm.h @@ -5,14 +5,9 @@ * User space memory access functions */ #include <linux/compiler.h> -#include <linux/errno.h> #include <linux/types.h> -#include <linux/sched.h> #include <asm/segment.h> -#define VERIFY_READ 0 -#define VERIFY_WRITE 1 - /* We let the MMU do all checking */ static inline int access_ok(int type, const void __user *addr, unsigned long size) @@ -36,24 +31,6 @@ static inline int access_ok(int type, const void __user *addr, #define MOVES "move" #endif -/* - * The exception table consists of pairs of addresses: the first is the - * address of an instruction that is allowed to fault, and the second is - * the address at which the program should continue. No registers are - * modified, so it is entirely up to the continuation code to figure out - * what to do. - * - * All the routines below use bits of fixup code that are out of line - * with the main instruction path. This means when everything is well, - * we don't even have to jump over them. Further, they do not intrude - * on our cache or tlb entries. - */ - -struct exception_table_entry -{ - unsigned long insn, fixup; -}; - extern int __put_user_bad(void); extern int __get_user_bad(void); @@ -202,39 +179,55 @@ asm volatile ("\n" \ unsigned long __generic_copy_from_user(void *to, const void __user *from, unsigned long n); unsigned long __generic_copy_to_user(void __user *to, const void *from, unsigned long n); -#define __constant_copy_from_user_asm(res, to, from, tmp, n, s1, s2, s3)\ +#define __suffix0 +#define __suffix1 b +#define __suffix2 w +#define __suffix4 l + +#define ____constant_copy_from_user_asm(res, to, from, tmp, n1, n2, n3, s1, s2, s3)\ asm volatile ("\n" \ "1: "MOVES"."#s1" (%2)+,%3\n" \ " move."#s1" %3,(%1)+\n" \ + " .ifnc \""#s2"\",\"\"\n" \ "2: "MOVES"."#s2" (%2)+,%3\n" \ " move."#s2" %3,(%1)+\n" \ " .ifnc \""#s3"\",\"\"\n" \ "3: "MOVES"."#s3" (%2)+,%3\n" \ " move."#s3" %3,(%1)+\n" \ " .endif\n" \ + " .endif\n" \ "4:\n" \ " .section __ex_table,\"a\"\n" \ " .align 4\n" \ " .long 1b,10f\n" \ + " .ifnc \""#s2"\",\"\"\n" \ " .long 2b,20f\n" \ " .ifnc \""#s3"\",\"\"\n" \ " .long 3b,30f\n" \ " .endif\n" \ + " .endif\n" \ " .previous\n" \ "\n" \ " .section .fixup,\"ax\"\n" \ " .even\n" \ - "10: clr."#s1" (%1)+\n" \ - "20: clr."#s2" (%1)+\n" \ + "10: addq.l #"#n1",%0\n" \ + " .ifnc \""#s2"\",\"\"\n" \ + "20: addq.l #"#n2",%0\n" \ " .ifnc \""#s3"\",\"\"\n" \ - "30: clr."#s3" (%1)+\n" \ + "30: addq.l #"#n3",%0\n" \ + " .endif\n" \ " .endif\n" \ - " moveq.l #"#n",%0\n" \ " jra 4b\n" \ " .previous\n" \ : "+d" (res), "+&a" (to), "+a" (from), "=&d" (tmp) \ : : "memory") +#define ___constant_copy_from_user_asm(res, to, from, tmp, n1, n2, n3, s1, s2, s3)\ + ____constant_copy_from_user_asm(res, to, from, tmp, n1, n2, n3, s1, s2, s3) +#define __constant_copy_from_user_asm(res, to, from, tmp, n1, n2, n3) \ + ___constant_copy_from_user_asm(res, to, from, tmp, n1, n2, n3, \ + __suffix##n1, __suffix##n2, __suffix##n3) + static __always_inline unsigned long __constant_copy_from_user(void *to, const void __user *from, unsigned long n) { @@ -242,37 +235,37 @@ __constant_copy_from_user(void *to, const void __user *from, unsigned long n) switch (n) { case 1: - __get_user_asm(res, *(u8 *)to, (u8 __user *)from, u8, b, d, 1); + __constant_copy_from_user_asm(res, to, from, tmp, 1, 0, 0); break; case 2: - __get_user_asm(res, *(u16 *)to, (u16 __user *)from, u16, w, r, 2); + __constant_copy_from_user_asm(res, to, from, tmp, 2, 0, 0); break; case 3: - __constant_copy_from_user_asm(res, to, from, tmp, 3, w, b,); + __constant_copy_from_user_asm(res, to, from, tmp, 2, 1, 0); break; case 4: - __get_user_asm(res, *(u32 *)to, (u32 __user *)from, u32, l, r, 4); + __constant_copy_from_user_asm(res, to, from, tmp, 4, 0, 0); break; case 5: - __constant_copy_from_user_asm(res, to, from, tmp, 5, l, b,); + __constant_copy_from_user_asm(res, to, from, tmp, 4, 1, 0); break; case 6: - __constant_copy_from_user_asm(res, to, from, tmp, 6, l, w,); + __constant_copy_from_user_asm(res, to, from, tmp, 4, 2, 0); break; case 7: - __constant_copy_from_user_asm(res, to, from, tmp, 7, l, w, b); + __constant_copy_from_user_asm(res, to, from, tmp, 4, 2, 1); break; case 8: - __constant_copy_from_user_asm(res, to, from, tmp, 8, l, l,); + __constant_copy_from_user_asm(res, to, from, tmp, 4, 4, 0); break; case 9: - __constant_copy_from_user_asm(res, to, from, tmp, 9, l, l, b); + __constant_copy_from_user_asm(res, to, from, tmp, 4, 4, 1); break; case 10: - __constant_copy_from_user_asm(res, to, from, tmp, 10, l, l, w); + __constant_copy_from_user_asm(res, to, from, tmp, 4, 4, 2); break; case 12: - __constant_copy_from_user_asm(res, to, from, tmp, 12, l, l, l); + __constant_copy_from_user_asm(res, to, from, tmp, 4, 4, 4); break; default: /* we limit the inlined version to 3 moves */ @@ -363,24 +356,26 @@ __constant_copy_to_user(void __user *to, const void *from, unsigned long n) return res; } -#define __copy_from_user(to, from, n) \ -(__builtin_constant_p(n) ? \ - __constant_copy_from_user(to, from, n) : \ - __generic_copy_from_user(to, from, n)) - -#define __copy_to_user(to, from, n) \ -(__builtin_constant_p(n) ? \ - __constant_copy_to_user(to, from, n) : \ - __generic_copy_to_user(to, from, n)) - -#define __copy_to_user_inatomic __copy_to_user -#define __copy_from_user_inatomic __copy_from_user +static inline unsigned long +raw_copy_from_user(void *to, const void __user *from, unsigned long n) +{ + if (__builtin_constant_p(n)) + return __constant_copy_from_user(to, from, n); + return __generic_copy_from_user(to, from, n); +} -#define copy_from_user(to, from, n) __copy_from_user(to, from, n) -#define copy_to_user(to, from, n) __copy_to_user(to, from, n) +static inline unsigned long +raw_copy_to_user(void __user *to, const void *from, unsigned long n) +{ + if (__builtin_constant_p(n)) + return __constant_copy_to_user(to, from, n); + return __generic_copy_to_user(to, from, n); +} +#define INLINE_COPY_FROM_USER +#define INLINE_COPY_TO_USER #define user_addr_max() \ - (segment_eq(get_fs(), USER_DS) ? TASK_SIZE : ~0UL) + (uaccess_kernel() ? ~0UL : TASK_SIZE) extern long strncpy_from_user(char *dst, const char __user *src, long count); extern __must_check long strlen_user(const char __user *str); diff --git a/arch/m68k/include/asm/uaccess_no.h b/arch/m68k/include/asm/uaccess_no.h index 36deeb36503b..e482c3899ff1 100644 --- a/arch/m68k/include/asm/uaccess_no.h +++ b/arch/m68k/include/asm/uaccess_no.h @@ -4,15 +4,11 @@ /* * User space memory access functions */ -#include <linux/sched.h> #include <linux/mm.h> #include <linux/string.h> #include <asm/segment.h> -#define VERIFY_READ 0 -#define VERIFY_WRITE 1 - #define access_ok(type,addr,size) _access_ok((unsigned long)(addr),(size)) /* @@ -27,25 +23,6 @@ static inline int _access_ok(unsigned long addr, unsigned long size) } /* - * The exception table consists of pairs of addresses: the first is the - * address of an instruction that is allowed to fault, and the second is - * the address at which the program should continue. No registers are - * modified, so it is entirely up to the continuation code to figure out - * what to do. - * - * All the routines below use bits of fixup code that are out of line - * with the main instruction path. This means when everything is well, - * we don't even have to jump over them. Further, they do not intrude - * on our cache or tlb entries. - */ - -struct exception_table_entry -{ - unsigned long insn, fixup; -}; - - -/* * These are the main single-value transfer routines. They automatically * use the right size if we just have the right pointer type. */ @@ -124,13 +101,21 @@ extern int __get_user_bad(void); : "=d" (x) \ : "m" (*__ptr(ptr))) -#define copy_from_user(to, from, n) (memcpy(to, from, n), 0) -#define copy_to_user(to, from, n) (memcpy(to, from, n), 0) +static inline unsigned long +raw_copy_from_user(void *to, const void __user *from, unsigned long n) +{ + memcpy(to, (__force const void *)from, n); + return 0; +} -#define __copy_from_user(to, from, n) copy_from_user(to, from, n) -#define __copy_to_user(to, from, n) copy_to_user(to, from, n) -#define __copy_to_user_inatomic __copy_to_user -#define __copy_from_user_inatomic __copy_from_user +static inline unsigned long +raw_copy_to_user(void __user *to, const void *from, unsigned long n) +{ + memcpy((__force void *)to, from, n); + return 0; +} +#define INLINE_COPY_FROM_USER +#define INLINE_COPY_TO_USER /* * Copy a null terminated string from userspace. diff --git a/arch/m68k/include/uapi/asm/Kbuild b/arch/m68k/include/uapi/asm/Kbuild index 6a2d257bdfb2..64368077235a 100644 --- a/arch/m68k/include/uapi/asm/Kbuild +++ b/arch/m68k/include/uapi/asm/Kbuild @@ -9,27 +9,3 @@ generic-y += socket.h generic-y += sockios.h generic-y += termbits.h generic-y += termios.h - -header-y += a.out.h -header-y += bootinfo.h -header-y += bootinfo-amiga.h -header-y += bootinfo-apollo.h -header-y += bootinfo-atari.h -header-y += bootinfo-hp300.h -header-y += bootinfo-mac.h -header-y += bootinfo-q40.h -header-y += bootinfo-vme.h -header-y += byteorder.h -header-y += cachectl.h -header-y += fcntl.h -header-y += ioctls.h -header-y += param.h -header-y += poll.h -header-y += posix_types.h -header-y += ptrace.h -header-y += setup.h -header-y += sigcontext.h -header-y += signal.h -header-y += stat.h -header-y += swab.h -header-y += unistd.h diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c index 093b7c42fb85..6f945bb5ffbd 100644 --- a/arch/m68k/kernel/signal.c +++ b/arch/m68k/kernel/signal.c @@ -88,7 +88,7 @@ static inline int frame_extra_sizes(int f) return frame_size_change[f]; } -int handle_kernel_fault(struct pt_regs *regs) +int fixup_exception(struct pt_regs *regs) { const struct exception_table_entry *fixup; struct pt_regs *tregs; diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c index a926d2c88898..c1cc4e99aa94 100644 --- a/arch/m68k/kernel/traps.c +++ b/arch/m68k/kernel/traps.c @@ -1016,8 +1016,13 @@ asmlinkage void trap_c(struct frame *fp) /* traced a trapping instruction on a 68020/30, * real exception will be executed afterwards. */ - } else if (!handle_kernel_fault(&fp->ptregs)) - bad_super_trap(fp); + return; + } +#ifdef CONFIG_MMU + if (fixup_exception(&fp->ptregs)) + return; +#endif + bad_super_trap(fp); return; } diff --git a/arch/m68k/lib/uaccess.c b/arch/m68k/lib/uaccess.c index a76b73abaf64..7646e461aa62 100644 --- a/arch/m68k/lib/uaccess.c +++ b/arch/m68k/lib/uaccess.c @@ -30,19 +30,13 @@ unsigned long __generic_copy_from_user(void *to, const void __user *from, "6:\n" " .section .fixup,\"ax\"\n" " .even\n" - "10: move.l %0,%3\n" - "7: clr.l (%2)+\n" - " subq.l #1,%3\n" - " jne 7b\n" - " lsl.l #2,%0\n" + "10: lsl.l #2,%0\n" " btst #1,%5\n" " jeq 8f\n" - "30: clr.w (%2)+\n" - " addq.l #2,%0\n" + "30: addq.l #2,%0\n" "8: btst #0,%5\n" " jeq 6b\n" - "50: clr.b (%2)+\n" - " addq.l #1,%0\n" + "50: addq.l #1,%0\n" " jra 6b\n" " .previous\n" "\n" diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 9dc65a4c28d2..22123f7e8f75 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c @@ -150,7 +150,7 @@ static void mac_cache_card_flush(int writeback) void __init config_mac(void) { if (!MACH_IS_MAC) - printk(KERN_ERR "ERROR: no Mac, but config_mac() called!!\n"); + pr_err("ERROR: no Mac, but config_mac() called!!\n"); mach_sched_init = mac_sched_init; mach_init_IRQ = mac_init_IRQ; @@ -837,8 +837,7 @@ static void __init mac_identify(void) /* no bootinfo model id -> NetBSD booter was used! */ /* XXX FIXME: breaks for model > 31 */ model = (mac_bi_data.cpuid >> 2) & 63; - printk(KERN_WARNING "No bootinfo model ID, using cpuid instead " - "(obsolete bootloader?)\n"); + pr_warn("No bootinfo model ID, using cpuid instead (obsolete bootloader?)\n"); } macintosh_config = mac_data_table; @@ -880,14 +879,13 @@ static void __init mac_identify(void) */ iop_preinit(); - printk(KERN_INFO "Detected Macintosh model: %d\n", model); + pr_info("Detected Macintosh model: %d\n", model); /* * Report booter data: */ printk(KERN_DEBUG " Penguin bootinfo data:\n"); - printk(KERN_DEBUG " Video: addr 0x%lx " - "row 0x%lx depth %lx dimensions %ld x %ld\n", + printk(KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n", mac_bi_data.videoaddr, mac_bi_data.videorow, mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, mac_bi_data.dimensions >> 16); @@ -912,7 +910,7 @@ static void __init mac_identify(void) static void __init mac_report_hardware(void) { - printk(KERN_INFO "Apple Macintosh %s\n", macintosh_config->name); + pr_info("Apple Macintosh %s\n", macintosh_config->name); } static void mac_get_model(char *str) @@ -921,15 +919,6 @@ static void mac_get_model(char *str) strcat(str, macintosh_config->name); } -static struct resource swim_rsrc = { .flags = IORESOURCE_MEM }; - -static struct platform_device swim_pdev = { - .name = "swim", - .id = -1, - .num_resources = 1, - .resource = &swim_rsrc, -}; - static const struct resource mac_scsi_iifx_rsrc[] __initconst = { { .flags = IORESOURCE_IRQ, @@ -994,26 +983,6 @@ static const struct resource mac_scsi_ccl_rsrc[] __initconst = { }, }; -static struct platform_device esp_0_pdev = { - .name = "mac_esp", - .id = 0, -}; - -static struct platform_device esp_1_pdev = { - .name = "mac_esp", - .id = 1, -}; - -static struct platform_device sonic_pdev = { - .name = "macsonic", - .id = -1, -}; - -static struct platform_device mace_pdev = { - .name = "macmace", - .id = -1, -}; - int __init mac_platform_init(void) { u8 *swim_base; @@ -1045,9 +1014,13 @@ int __init mac_platform_init(void) } if (swim_base) { - swim_rsrc.start = (resource_size_t) swim_base, - swim_rsrc.end = (resource_size_t) swim_base + 0x2000, - platform_device_register(&swim_pdev); + struct resource swim_rsrc = { + .flags = IORESOURCE_MEM, + .start = (resource_size_t)swim_base, + .end = (resource_size_t)swim_base + 0x2000, + }; + + platform_device_register_simple("swim", -1, &swim_rsrc, 1); } /* @@ -1057,13 +1030,13 @@ int __init mac_platform_init(void) switch (macintosh_config->scsi_type) { case MAC_SCSI_QUADRA: case MAC_SCSI_QUADRA3: - platform_device_register(&esp_0_pdev); + platform_device_register_simple("mac_esp", 0, NULL, 0); break; case MAC_SCSI_QUADRA2: - platform_device_register(&esp_0_pdev); + platform_device_register_simple("mac_esp", 0, NULL, 0); if ((macintosh_config->ident == MAC_MODEL_Q900) || (macintosh_config->ident == MAC_MODEL_Q950)) - platform_device_register(&esp_1_pdev); + platform_device_register_simple("mac_esp", 1, NULL, 0); break; case MAC_SCSI_IIFX: /* Addresses from The Guide to Mac Family Hardware. @@ -1129,10 +1102,10 @@ int __init mac_platform_init(void) switch (macintosh_config->ether_type) { case MAC_ETHER_SONIC: - platform_device_register(&sonic_pdev); + platform_device_register_simple("macsonic", -1, NULL, 0); break; case MAC_ETHER_MACE: - platform_device_register(&mace_pdev); + platform_device_register_simple("macmace", -1, NULL, 0); break; } diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c index 7990b6f50105..4c1e606e7d03 100644 --- a/arch/m68k/mac/iop.c +++ b/arch/m68k/mac/iop.c @@ -115,7 +115,17 @@ #include <asm/macints.h> #include <asm/mac_iop.h> -/*#define DEBUG_IOP*/ +#ifdef DEBUG +#define iop_pr_debug(fmt, ...) \ + printk(KERN_DEBUG "%s: " fmt, __func__, ##__VA_ARGS__) +#define iop_pr_cont(fmt, ...) \ + printk(KERN_CONT fmt, ##__VA_ARGS__) +#else +#define iop_pr_debug(fmt, ...) \ + no_printk(KERN_DEBUG "%s: " fmt, __func__, ##__VA_ARGS__) +#define iop_pr_cont(fmt, ...) \ + no_printk(KERN_CONT fmt, ##__VA_ARGS__) +#endif /* Non-zero if the IOPs are present */ @@ -200,7 +210,7 @@ static int iop_alive(volatile struct mac_iop *iop) return retval; } -static struct iop_msg *iop_alloc_msg(void) +static struct iop_msg *iop_get_unused_msg(void) { int i; unsigned long flags; @@ -219,11 +229,6 @@ static struct iop_msg *iop_alloc_msg(void) return NULL; } -static void iop_free_msg(struct iop_msg *msg) -{ - msg->status = IOP_MSGSTATUS_UNUSED; -} - /* * This is called by the startup code before anything else. Its purpose * is to find and initialize the IOPs early in the boot sequence, so that @@ -268,10 +273,10 @@ void __init iop_init(void) int i; if (iop_scc_present) { - printk("IOP: detected SCC IOP at %p\n", iop_base[IOP_NUM_SCC]); + pr_info("IOP: detected SCC IOP at %p\n", iop_base[IOP_NUM_SCC]); } if (iop_ism_present) { - printk("IOP: detected ISM IOP at %p\n", iop_base[IOP_NUM_ISM]); + pr_info("IOP: detected ISM IOP at %p\n", iop_base[IOP_NUM_ISM]); iop_start(iop_base[IOP_NUM_ISM]); iop_alive(iop_base[IOP_NUM_ISM]); /* clears the alive flag */ } @@ -310,9 +315,9 @@ void __init iop_register_interrupts(void) pr_err("Couldn't register ISM IOP interrupt\n"); } if (!iop_alive(iop_base[IOP_NUM_ISM])) { - printk("IOP: oh my god, they killed the ISM IOP!\n"); + pr_warn("IOP: oh my god, they killed the ISM IOP!\n"); } else { - printk("IOP: the ISM IOP seems to be alive.\n"); + pr_warn("IOP: the ISM IOP seems to be alive.\n"); } } } @@ -349,9 +354,8 @@ void iop_complete_message(struct iop_msg *msg) int chan = msg->channel; int i,offset; -#ifdef DEBUG_IOP - printk("iop_complete(%p): iop %d chan %d\n", msg, msg->iop_num, msg->channel); -#endif + iop_pr_debug("msg %p iop_num %d channel %d\n", msg, msg->iop_num, + msg->channel); offset = IOP_ADDR_RECV_MSG + (msg->channel * IOP_MSG_LEN); @@ -363,7 +367,7 @@ void iop_complete_message(struct iop_msg *msg) IOP_ADDR_RECV_STATE + chan, IOP_MSG_COMPLETE); iop_interrupt(iop_base[msg->iop_num]); - iop_free_msg(msg); + msg->status = IOP_MSGSTATUS_UNUSED; } /* @@ -394,12 +398,10 @@ static void iop_do_send(struct iop_msg *msg) static void iop_handle_send(uint iop_num, uint chan) { volatile struct mac_iop *iop = iop_base[iop_num]; - struct iop_msg *msg,*msg2; + struct iop_msg *msg; int i,offset; -#ifdef DEBUG_IOP - printk("iop_handle_send: iop %d channel %d\n", iop_num, chan); -#endif + iop_pr_debug("iop_num %d chan %d\n", iop_num, chan); iop_writeb(iop, IOP_ADDR_SEND_STATE + chan, IOP_MSG_IDLE); @@ -411,10 +413,8 @@ static void iop_handle_send(uint iop_num, uint chan) msg->reply[i] = iop_readb(iop, offset); } if (msg->handler) (*msg->handler)(msg); - msg2 = msg; + msg->status = IOP_MSGSTATUS_UNUSED; msg = msg->next; - iop_free_msg(msg2); - iop_send_queue[iop_num][chan] = msg; if (msg) iop_do_send(msg); } @@ -430,11 +430,9 @@ static void iop_handle_recv(uint iop_num, uint chan) int i,offset; struct iop_msg *msg; -#ifdef DEBUG_IOP - printk("iop_handle_recv: iop %d channel %d\n", iop_num, chan); -#endif + iop_pr_debug("iop_num %d chan %d\n", iop_num, chan); - msg = iop_alloc_msg(); + msg = iop_get_unused_msg(); msg->iop_num = iop_num; msg->channel = chan; msg->status = IOP_MSGSTATUS_UNSOL; @@ -454,14 +452,9 @@ static void iop_handle_recv(uint iop_num, uint chan) if (msg->handler) { (*msg->handler)(msg); } else { -#ifdef DEBUG_IOP - printk("iop_handle_recv: unclaimed message on iop %d channel %d\n", iop_num, chan); - printk("iop_handle_recv:"); - for (i = 0 ; i < IOP_MSG_LEN ; i++) { - printk(" %02X", (uint) msg->message[i]); - } - printk("\n"); -#endif + iop_pr_debug("unclaimed message on iop_num %d chan %d\n", + iop_num, chan); + iop_pr_debug("%*ph\n", IOP_MSG_LEN, msg->message); iop_complete_message(msg); } } @@ -484,7 +477,7 @@ int iop_send_message(uint iop_num, uint chan, void *privdata, if (chan >= NUM_IOP_CHAN) return -EINVAL; if (msg_len > IOP_MSG_LEN) return -EINVAL; - msg = iop_alloc_msg(); + msg = iop_get_unused_msg(); if (!msg) return -ENOMEM; msg->next = NULL; @@ -574,50 +567,34 @@ irqreturn_t iop_ism_irq(int irq, void *dev_id) volatile struct mac_iop *iop = iop_base[iop_num]; int i,state; -#ifdef DEBUG_IOP - printk("iop_ism_irq: status = %02X\n", (uint) iop->status_ctrl); -#endif + iop_pr_debug("status %02X\n", iop->status_ctrl); /* INT0 indicates a state change on an outgoing message channel */ if (iop->status_ctrl & IOP_INT0) { iop->status_ctrl = IOP_INT0 | IOP_RUN | IOP_AUTOINC; -#ifdef DEBUG_IOP - printk("iop_ism_irq: new status = %02X, send states", - (uint) iop->status_ctrl); -#endif + iop_pr_debug("new status %02X, send states", iop->status_ctrl); for (i = 0 ; i < NUM_IOP_CHAN ; i++) { state = iop_readb(iop, IOP_ADDR_SEND_STATE + i); -#ifdef DEBUG_IOP - printk(" %02X", state); -#endif + iop_pr_cont(" %02X", state); if (state == IOP_MSG_COMPLETE) { iop_handle_send(iop_num, i); } } -#ifdef DEBUG_IOP - printk("\n"); -#endif + iop_pr_cont("\n"); } if (iop->status_ctrl & IOP_INT1) { /* INT1 for incoming msgs */ iop->status_ctrl = IOP_INT1 | IOP_RUN | IOP_AUTOINC; -#ifdef DEBUG_IOP - printk("iop_ism_irq: new status = %02X, recv states", - (uint) iop->status_ctrl); -#endif + iop_pr_debug("new status %02X, recv states", iop->status_ctrl); for (i = 0 ; i < NUM_IOP_CHAN ; i++) { state = iop_readb(iop, IOP_ADDR_RECV_STATE + i); -#ifdef DEBUG_IOP - printk(" %02X", state); -#endif + iop_pr_cont(" %02X", state); if (state == IOP_MSG_NEW) { iop_handle_recv(iop_num, i); } } -#ifdef DEBUG_IOP - printk("\n"); -#endif + iop_pr_cont("\n"); } return IRQ_HANDLED; } diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c index 5b01704c85eb..8aa8792e3174 100644 --- a/arch/m68k/mac/misc.c +++ b/arch/m68k/mac/misc.c @@ -281,8 +281,7 @@ static long via_read_time(void) last_result.idata = result.idata; } - pr_err("via_read_time: failed to read a stable value; " - "got 0x%08lx then 0x%08lx\n", + pr_err("via_read_time: failed to read a stable value; got 0x%08lx then 0x%08lx\n", last_result.idata, result.idata); return 0; @@ -465,7 +464,7 @@ void mac_poweroff(void) #endif } local_irq_enable(); - printk("It is now safe to turn off your Macintosh.\n"); + pr_crit("It is now safe to turn off your Macintosh.\n"); while(1); } @@ -556,7 +555,7 @@ void mac_reset(void) /* should never get here */ local_irq_enable(); - printk ("Restart failed. Please restart manually.\n"); + pr_crit("Restart failed. Please restart manually.\n"); while(1); } @@ -661,17 +660,13 @@ int mac_hwclk(int op, struct rtc_time *t) unmktime(now, 0, &t->tm_year, &t->tm_mon, &t->tm_mday, &t->tm_hour, &t->tm_min, &t->tm_sec); -#if 0 - printk("mac_hwclk: read %04d-%02d-%-2d %02d:%02d:%02d\n", - t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, - t->tm_hour, t->tm_min, t->tm_sec); -#endif + pr_debug("%s: read %04d-%02d-%-2d %02d:%02d:%02d\n", + __func__, t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, + t->tm_hour, t->tm_min, t->tm_sec); } else { /* write */ -#if 0 - printk("mac_hwclk: tried to write %04d-%02d-%-2d %02d:%02d:%02d\n", - t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, - t->tm_hour, t->tm_min, t->tm_sec); -#endif + pr_debug("%s: tried to write %04d-%02d-%-2d %02d:%02d:%02d\n", + __func__, t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, + t->tm_hour, t->tm_min, t->tm_sec); now = mktime(t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c index bd66a0b20c6b..2795e4ca09d7 100644 --- a/arch/m68k/mm/fault.c +++ b/arch/m68k/mm/fault.c @@ -32,7 +32,7 @@ int send_fault_sig(struct pt_regs *regs) force_sig_info(siginfo.si_signo, &siginfo, current); } else { - if (handle_kernel_fault(regs)) + if (fixup_exception(regs)) return -1; //if (siginfo.si_signo == SIGBUS) |