···50505151EXPORT_SYMBOL(shm_align_mask);52525353+#ifdef CONFIG_MMU5354/*5455 * To avoid cache aliases, we map the shared page with same color.5556 */···136135 addr = COLOUR_ALIGN(addr, pgoff);137136 }138137}138138+#endif /* CONFIG_MMU */139139140140static inline long141141do_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
+5-58
arch/sh/kernel/timers/timer-cmt.c
···9696 return count;9797}98989999-static irqreturn_t cmt_timer_interrupt(int irq, void *dev_id,100100- struct pt_regs *regs)9999+static irqreturn_t cmt_timer_interrupt(int irq, void *dev_id)101100{102101 unsigned long timer_status;103102···113114 * locally disabled. -arca114115 */115116 write_seqlock(&xtime_lock);116116- handle_timer_tick(regs);117117+ handle_timer_tick();117118 write_sequnlock(&xtime_lock);118119119120 return IRQ_HANDLED;···122123static struct irqaction cmt_irq = {123124 .name = "timer",124125 .handler = cmt_timer_interrupt,125125- .flags = SA_INTERRUPT,126126+ .flags = IRQF_DISABLED,126127 .mask = CPU_MASK_NONE,127128};128128-129129-/*130130- * Hah! We'll see if this works (switching from usecs to nsecs).131131- */132132-static unsigned long cmt_timer_get_frequency(void)133133-{134134- u32 freq;135135- struct timespec ts1, ts2;136136- unsigned long diff_nsec;137137- unsigned long factor;138138-139139- /* Setup the timer: We don't want to generate interrupts, just140140- * have it count down at its natural rate.141141- */142142-143143- ctrl_outw(ctrl_inw(CMT_CMSTR) & ~0x01, CMT_CMSTR);144144- ctrl_outw(CMT_CMCSR_CALIB, CMT_CMCSR_0);145145- ctrl_outw(0xffff, CMT_CMCOR_0);146146- ctrl_outw(0xffff, CMT_CMCNT_0);147147-148148- rtc_sh_get_time(&ts2);149149-150150- do {151151- rtc_sh_get_time(&ts1);152152- } while (ts1.tv_nsec == ts2.tv_nsec && ts1.tv_sec == ts2.tv_sec);153153-154154- /* actually start the timer */155155- ctrl_outw(ctrl_inw(CMT_CMSTR) | 0x01, CMT_CMSTR);156156-157157- do {158158- rtc_sh_get_time(&ts2);159159- } while (ts1.tv_nsec == ts2.tv_nsec && ts1.tv_sec == ts2.tv_sec);160160-161161- freq = 0xffff - ctrl_inw(CMT_CMCNT_0);162162- if (ts2.tv_nsec < ts1.tv_nsec) {163163- ts2.tv_nsec += 1000000000;164164- ts2.tv_sec--;165165- }166166-167167- diff_nsec = (ts2.tv_sec - ts1.tv_sec) * 1000000000 + (ts2.tv_nsec - ts1.tv_nsec);168168-169169- /* this should work well if the RTC has a precision of n Hz, where170170- * n is an integer. I don't think we have to worry about the other171171- * cases. */172172- factor = (1000000000 + diff_nsec/2) / diff_nsec;173173-174174- if (factor * diff_nsec > 1100000000 ||175175- factor * diff_nsec < 900000000)176176- panic("weird RTC (diff_nsec %ld)", diff_nsec);177177-178178- return freq * factor;179179-}180129181130static void cmt_clk_init(struct clk *clk)182131{···192245 .init = cmt_timer_init,193246 .start = cmt_timer_start,194247 .stop = cmt_timer_stop,195195- .get_frequency = cmt_timer_get_frequency,248248+#ifndef CONFIG_GENERIC_TIME196249 .get_offset = cmt_timer_get_offset,250250+#endif197251};198252199253struct sys_timer cmt_timer = {200254 .name = "cmt",201255 .ops = &cmt_timer_ops,202256};203203-
+5-57
arch/sh/kernel/timers/timer-mtu2.c
···9898 return count;9999}100100101101-static irqreturn_t mtu2_timer_interrupt(int irq, void *dev_id,102102- struct pt_regs *regs)101101+static irqreturn_t mtu2_timer_interrupt(int irq, void *dev_id)103102{104103 unsigned long timer_status;105104···109110110111 /* Do timer tick */111112 write_seqlock(&xtime_lock);112112- handle_timer_tick(regs);113113+ handle_timer_tick();113114 write_sequnlock(&xtime_lock);114115115116 return IRQ_HANDLED;···118119static struct irqaction mtu2_irq = {119120 .name = "timer",120121 .handler = mtu2_timer_interrupt,121121- .flags = SA_INTERRUPT,122122+ .flags = IRQF_DISABLED,122123 .mask = CPU_MASK_NONE,123124};124124-125125-/*126126- * Hah! We'll see if this works (switching from usecs to nsecs).127127- */128128-static unsigned long mtu2_timer_get_frequency(void)129129-{130130- u32 freq;131131- struct timespec ts1, ts2;132132- unsigned long diff_nsec;133133- unsigned long factor;134134-135135- /* Setup the timer: We don't want to generate interrupts, just136136- * have it count down at its natural rate.137137- */138138-139139- ctrl_outb(ctrl_inb(MTU2_TSTR) & ~MTU2_TSTR_CST1, MTU2_TSTR);140140- ctrl_outb(MTU2_TCR_CALIB, MTU2_TCR_1);141141- ctrl_outb(ctrl_inb(MTU2_TIER_1) & ~MTU2_TIER_TGIEA, MTU2_TIER_1);142142- ctrl_outw(0, MTU2_TCNT_1);143143-144144- rtc_get_time(&ts2);145145-146146- do {147147- rtc_get_time(&ts1);148148- } while (ts1.tv_nsec == ts2.tv_nsec && ts1.tv_sec == ts2.tv_sec);149149-150150- /* actually start the timer */151151- ctrl_outw(ctrl_inw(CMT_CMSTR) | 0x01, CMT_CMSTR);152152-153153- do {154154- rtc_get_time(&ts2);155155- } while (ts1.tv_nsec == ts2.tv_nsec && ts1.tv_sec == ts2.tv_sec);156156-157157- freq = ctrl_inw(MTU2_TCNT_0);158158- if (ts2.tv_nsec < ts1.tv_nsec) {159159- ts2.tv_nsec += 1000000000;160160- ts2.tv_sec--;161161- }162162-163163- diff_nsec = (ts2.tv_sec - ts1.tv_sec) * 1000000000 + (ts2.tv_nsec - ts1.tv_nsec);164164-165165- /* this should work well if the RTC has a precision of n Hz, where166166- * n is an integer. I don't think we have to worry about the other167167- * cases. */168168- factor = (1000000000 + diff_nsec/2) / diff_nsec;169169-170170- if (factor * diff_nsec > 1100000000 ||171171- factor * diff_nsec < 900000000)172172- panic("weird RTC (diff_nsec %ld)", diff_nsec);173173-174174- return freq * factor;175175-}176125177126static unsigned int divisors[] = { 1, 4, 16, 64, 1, 1, 256 };178127···197250 .init = mtu2_timer_init,198251 .start = mtu2_timer_start,199252 .stop = mtu2_timer_stop,200200- .get_frequency = mtu2_timer_get_frequency,253253+#ifndef CONFIG_GENERIC_TIME201254 .get_offset = mtu2_timer_get_offset,255255+#endif202256};203257204258struct sys_timer mtu2_timer = {
+10-2
arch/sh/kernel/traps.c
···107107 die(str, regs, err);108108}109109110110-static int handle_unaligned_notify_count = 10;111111-112110/*113111 * try and fix up kernelspace address errors114112 * - userspace errors just cause EFAULT to be returned, resulting in SEGV···345347#define SH_PC_8BIT_OFFSET(instr) ((((signed char)(instr))*2) + 4)346348#define SH_PC_12BIT_OFFSET(instr) ((((signed short)(instr<<4))>>3) + 4)347349350350+/*351351+ * XXX: SH-2A needs this too, but it needs an overhaul thanks to mixed 32-bit352352+ * opcodes..353353+ */354354+#ifndef CONFIG_CPU_SH2A355355+static int handle_unaligned_notify_count = 10;356356+348357static int handle_unaligned_access(u16 instruction, struct pt_regs *regs)349358{350359 u_int rm;···488483 regs->pc += 2;489484 return ret;490485}486486+#endif /* CONFIG_CPU_SH2A */491487492488#ifdef CONFIG_CPU_HAS_SR_RB493489#define lookup_exception_vector(x) \···507501{508502 unsigned long error_code = 0;509503 mm_segment_t oldfs;504504+#ifndef CONFIG_CPU_SH2A510505 u16 instruction;511506 int tmp;507507+#endif512508513509 /* Intentional ifdef */514510#ifdef CONFIG_CPU_HAS_SR_RB