OpenCores
URL https://opencores.org/ocsvn/minsoc/minsoc/trunk

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [sw/] [support/] [int.c] - Diff between revs 2 and 11

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 2 Rev 11
Line 64... Line 64...
}
}
 
 
/* Main interrupt handler */
/* Main interrupt handler */
void int_main()
void int_main()
{
{
  unsigned long picsr = mfspr(SPR_PICSR);
  unsigned long picsr = mfspr(SPR_PICSR);   //process only the interrupts asserted at signal catch, ignore all during process
  unsigned long i = 0;
  unsigned long i = 0;
 
 
  mtspr(SPR_PICSR, 0);
 
 
 
  while(i < 32) {
  while(i < 32) {
    if((picsr & (0x01L << i)) && (int_handlers[i].handler != 0)) {
    if((picsr & (0x01L << i)) && (int_handlers[i].handler != 0)) {
      (*int_handlers[i].handler)(int_handlers[i].arg);
      (*int_handlers[i].handler)(int_handlers[i].arg);
    }
    }
    i++;
    i++;
  }
  }
}
 
 
  mtspr(SPR_PICSR, 0);      //clear interrupt status: all modules have level interrupts, which have to be cleared by software,
 
}                           //thus this is safe, since non processed interrupts will get re-asserted soon enough
 
 
 
 
#endif
#endif
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.