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

Subversion Repositories thor

[/] [thor/] [trunk/] [software/] [FMTK/] [source/] [kernel/] [PIC.c] - Rev 23

Compare with Previous | Blame | View Log

 
#define PIC               0xFFDC0FC0
#define PIC_IE            0xFFDC0FC8
#define PIC_ES            0xFFDC0FE0
#define PIC_RSTE          0xFFDC0FE8
 
// ----------------------------------------------------------------------------
// Get the vector base register
// ----------------------------------------------------------------------------
 
unsigned int *GetVBR()
{
    asm {
        mfspr r1,c12
    }
}
 
 
// ----------------------------------------------------------------------------
// Set an IRQ vector
// ----------------------------------------------------------------------------
 
pascal void set_vector(unsigned int vecno, unsigned int rout)
{
     if (vecno > 255) return;
     if (rout == 0) return;
	 asm __leafs {
			lw		r2,32[bp]
			lw		r1,40[bp]
			jsr		set_vector
	 }
//     GetVBR()[vecno] = rout;
}
 
// ----------------------------------------------------------------------------
// 0 is highest priority, 15 is lowest
// 0    NMI (parity error)
// 1    1024 Hz timer interrupt
// 2    30Hz timer interrupt
// 3    Keyboard interrupt
// ...
// 15
// 
// ----------------------------------------------------------------------------
void InitPIC()
{
     outh(PIC_ES, 0x0007);  // nmi,timer interrupt(s) are edge sensitive
     outh(PIC_IE, 0x000F);  //enable keyboard reset, timer interrupts
}
 
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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