Merge branch 'isr_test' of git://github.com/theStack/ppcskel into isr_test
authorBernhard Urban <lewurm@gmx.net>
Wed, 2 Sep 2009 22:46:29 +0000 (00:46 +0200)
committerBernhard Urban <lewurm@gmx.net>
Wed, 2 Sep 2009 22:46:29 +0000 (00:46 +0200)
Conflicts:
ohci.c

1  2 
exception.c
ohci.c

diff --combined exception.c
index f439b149428386c03b14ae53a388526cfe4fa377,4a9eef38b9b469a66e088632993dd67febca26bf..b2c5373b2f50a7eaeee780b57c52774e24b7123a
@@@ -12,7 -12,6 +12,7 @@@ Copyright (C) 2008            Segher Boessenkool 
  
  #include "string.h"
  #include "irq.h"
 +#include "hollywood.h"
  
  extern char exception_2200_start, exception_2200_end;
  
@@@ -20,12 -19,33 +20,18 @@@ void exception_handler(int exception
  {
        // check if the exception was actually an interrupt
        if (exception == 0x500) {
 -              u32 cookie;
 -
 -              _CPU_ISR_Disable(cookie);
 -              printf("\nInterrupt occured ;-) Which one? -> ");
 -              u32 enabled = read32(BW_PI_IRQMASK);
 -              u32 flags = read32(BW_PI_IRQFLAG);
 -              flags = flags & enabled;
 -              if (flags & (1<<1)) { // RESET
 -                      write32(BW_PI_IRQFLAG, 1<<1);
 -                      printf("RESET :)\n");
 -              }
 -              if (flags & (1<<14)) { // Hollywood-PIC IRQ
 -                      write32(BW_PI_IRQFLAG, 1<<14);
 -                      write32(HW_PPCIRQFLAG, ~0); // dirty
 -                      printf("Hollywood-PIC :)\n");
 -              }
 -              _CPU_ISR_Restore(cookie);
 -
 +              u32 cookie = irq_kill();
 +              irq_handler();
 +              irq_restore(cookie);
                return;
        }
  
+       // check if exception happened due to the decrementer
+       if (exception == 0x900) {
+               printf("\nDecrementer exception occured - who cares?\n");
+               return;
+       }
        u32 *x;
        u32 i;
  
diff --combined ohci.c
index 33d6034ae80d451b6fc5faf2e55f68727007b1b5,04550f903bfeec385746e216e2b8678476fb3357..1bab91a5b7bac17c06fdfedd6629b875a0f9531f
--- 1/ohci.c
--- 2/ohci.c
+++ b/ohci.c
@@@ -14,7 -14,8 +14,7 @@@ Copyright (C) 2009     Sebastian Falbes
  #include "irq.h"
  
  #define gecko_printf printf
- #define dma_addr(address) (u32)address
 -#define set32(address, flags) write32(address, read32(address) | flags)
+ #define dma_addr(address) virt_to_phys(address)
  
  
  static struct ohci_hcca hcca_oh0;
@@@ -69,7 -70,10 +69,7 @@@ void ohci_init() 
            within 2msec else HC enters RESUME */
  
  
 -       //u32 cookie = irq_kill();
 -       u32 cookie;
 -       _CPU_ISR_Disable(cookie);
 -
 +         u32 cookie = irq_kill();
  
         /* Tell the controller where the control and bulk lists are
          * The lists are empty now. */
         write32(OHCI0_HC_INT_ENABLE, OHCI_INTR_INIT);
  
  
 -       //irq_restore(cookie);
 -       _CPU_ISR_Restore(cookie);
 -
 +       irq_restore(cookie);
  
         dbg_op_state();
 -
  }