47typedef void (*tlib_isr_t)(
void *data);
50 TLIB_FLAGS_BROADCAST = 0x01
55 void (*reset)(
struct tlib_dev *hand);
58 unsigned int *basefreq,
59 unsigned int *tickrate);
60 int (*set_freq)(
struct tlib_dev *hand,
unsigned int tickrate);
61 void (*irq_reg)(
struct tlib_dev *hand, tlib_isr_t func,
void *data,
int flags);
62 void (*irq_unreg)(
struct tlib_dev *hand, tlib_isr_t func,
void *data);
63 void (*start)(
struct tlib_dev *hand,
int once);
65 void (*restart)(
struct tlib_dev *hand);
66 void (*get_counter)(
struct tlib_dev *hand,
unsigned int *counter);
67 int (*custom)(
struct tlib_dev *hand,
int cmd,
void *arg);
68 int (*int_pend)(
struct tlib_dev *hand,
int ack);
69 void (*get_widthmask)(
struct tlib_dev *hand,
unsigned int *widthmask);
81#ifdef RTEMS_DRVMGR_STARTUP
86extern void Clock_timer_register(
int timer_number);
94extern int tlib_dev_reg(
struct tlib_dev *newdev);
100extern void *tlib_open(
int timer_no);
103extern void tlib_close(
void *hand);
106extern int tlib_ntimer(
void);
108static inline void tlib_reset(
void *hand)
112 dev->drv->reset(dev);
118static inline void tlib_get_freq(
120 unsigned int *basefreq,
121 unsigned int *tickrate)
125 dev->drv->get_freq(dev, basefreq, tickrate);
129static inline int tlib_set_freq(
void *hand,
unsigned int tickrate)
133 return dev->drv->set_freq(dev, tickrate);
137static inline void tlib_irq_unregister(
void *hand)
141 if ( dev->isr_func ) {
142 dev->drv->irq_unreg(dev, dev->isr_func, dev->isr_data);
143 dev->isr_func = NULL;
148static inline void tlib_irq_register(
void *hand, tlib_isr_t func,
void *data,
int flags)
153 tlib_irq_unregister(hand);
154 dev->isr_func = func;
155 dev->isr_data = data;
156 dev->drv->irq_reg(dev, func, data, flags);
164static inline void tlib_start(
void *hand,
int once)
168 dev->drv->start(dev, once);
172static inline void tlib_stop(
void *hand)
180static inline void tlib_restart(
void *hand)
184 dev->drv->restart(dev);
188static inline void tlib_get_counter(
void *hand,
unsigned int *counter)
192 dev->drv->get_counter(dev, counter);
196static inline void tlib_custom(
void *hand,
int cmd,
void *arg)
200 dev->drv->custom(dev, cmd, arg);
203static inline int tlib_interrupt_pending(
void *hand,
int ack)
207 return dev->drv->int_pend(dev, ack);
210static inline void tlib_get_widthmask(
void *hand,
unsigned int *widthmask)
214 dev->drv->get_widthmask(dev, widthmask);