freemyipod r219 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r218‎ | r219 | r220 >
Date:17:54, 9 October 2010
Author:theseven
Status:new
Tags:
Comment:
Mask all interrupts in the interrupt controller (not just in the CPU) before executing firmware (fixes diagmode on nano2g)
Modified paths:
  • /embios/trunk/arm/contextswitch.S (modified) (history)
  • /embios/trunk/interrupt.h (modified) (history)
  • /embios/trunk/target/ipodnano2g/interrupt.c (modified) (history)
  • /embios/trunk/target/ipodnano4g/interrupt.c (modified) (history)

Diff [purge]

Index: embios/trunk/target/ipodnano2g/interrupt.c
@@ -151,3 +151,8 @@
152152 {
153153 INTMSK = (1 << IRQ_TIMER) | (1 << IRQ_DMA);
154154 }
 155+
 156+void interrupt_shutdown(void)
 157+{
 158+ INTMSK = 0;
 159+}
Index: embios/trunk/target/ipodnano4g/interrupt.c
@@ -177,3 +177,9 @@
178178 {
179179 VIC0INTENABLE = 1 << IRQ_TIMER;
180180 }
 181+
 182+void interrupt_shutdown(void)
 183+{
 184+ VIC0INTENCLEAR = 0xffffffff;
 185+ VIC1INTENCLEAR = 0xffffffff;
 186+}
Index: embios/trunk/arm/contextswitch.S
@@ -149,6 +149,7 @@
150150 .type execfirmware, %function
151151 execfirmware:
152152 str r0, [sp,#-4]!
 153+ bl interrupt_shutdown
153154 bl clean_dcache
154155 ldr r1, [sp], #4
155156 msr cpsr_c, #0xd3
Index: embios/trunk/interrupt.h
@@ -30,6 +30,7 @@
3131
3232 void irqhandler(void) ICODE_ATTR;
3333 void interrupt_init(void) INITCODE_ATTR;
 34+void interrupt_shutdown(void);
3435 void interrupt_enable(int irq, bool state);
3536 void interrupt_set_handler(int irq, void* handler);
3637 void int_timer_set_handler(int timer, void* handler);