mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-26 06:08:20 +00:00
2007-12-06 Till Straumann <strauman@slac.stanford.edu>
* shared/openpic/openpic.c, shared/openpic/openpic.h: added routines to set timer period and interupt mask and to read current count.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2007-12-06 Till Straumann <strauman@slac.stanford.edu>
|
||||
|
||||
* shared/openpic/openpic.c, shared/openpic/openpic.h:
|
||||
added routines to set timer period and interupt mask
|
||||
and to read current count.
|
||||
|
||||
2007-12-06 Till Straumann <strauman@slac.stanford.edu>
|
||||
|
||||
* virtex/irq/irq_init.c: use new ASM_xxx_VECTOR names.
|
||||
|
||||
@@ -492,6 +492,28 @@ void openpic_maptimer(unsigned int timer, unsigned int cpumask)
|
||||
openpic_write(&OpenPIC->Global.Timer[timer].Destination, cpumask);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set base count and / or enable / disable interrupt.
|
||||
*/
|
||||
|
||||
|
||||
void openpic_settimer(unsigned int timer, unsigned int base_count, int irq_enable)
|
||||
{
|
||||
check_arg_timer(timer);
|
||||
if ( base_count )
|
||||
openpic_write(&OpenPIC->Global.Timer[timer].Base_Count, base_count);
|
||||
if ( irq_enable )
|
||||
openpic_clearfield(&OpenPIC->Global.Timer[timer].Vector_Priority, OPENPIC_MASK);
|
||||
else
|
||||
openpic_setfield(&OpenPIC->Global.Timer[timer].Vector_Priority, OPENPIC_MASK);
|
||||
}
|
||||
|
||||
unsigned int openpic_gettimer(unsigned int timer)
|
||||
{
|
||||
check_arg_timer(timer);
|
||||
return (openpic_read(&OpenPIC->Global.Timer[timer]) & ~OPENPIC_MASK);
|
||||
}
|
||||
|
||||
/* -------- Interrupt Sources ---------------------------------------------- */
|
||||
|
||||
/*
|
||||
|
||||
@@ -363,6 +363,8 @@ extern void openpic_cause_IPI(unsigned int cpu, unsigned int ipi, unsigned int c
|
||||
|
||||
/* Timer Interrupts */
|
||||
extern void openpic_inittimer(unsigned int timer, unsigned int pri, unsigned int vector);
|
||||
extern void openpic_settimer(unsigned int timer, unsigned int base_count, int irq_enable);
|
||||
extern unsigned int openpic_gettimer(unsigned int timer);
|
||||
extern void openpic_maptimer(unsigned int timer, unsigned int cpumask);
|
||||
|
||||
/* Interrupt Sources */
|
||||
|
||||
Reference in New Issue
Block a user