Changeset 78e56096 in rtems


Ignore:
Timestamp:
Apr 10, 2017, 12:52:16 PM (3 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
master
Children:
f600458d
Parents:
ae203e0d
git-author:
Daniel Hellstrom <daniel@…> (04/10/17 12:52:16)
git-committer:
Daniel Hellstrom <daniel@…> (05/02/17 10:34:45)
Message:

leon, tlib: added timer width mask information

Location:
c/src/lib/libbsp/sparc/shared
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/shared/include/tlib.h

    rae203e0d r78e56096  
    4444        int     (*custom)(struct tlib_dev *hand, int cmd, void *arg);
    4545        int     (*int_pend)(struct tlib_dev *hand, int ack);
     46        void    (*get_widthmask)(struct tlib_dev *hand, unsigned int *widthmask);
    4647};
    4748
     
    184185}
    185186
     187static inline void tlib_get_widthmask(void *hand, unsigned int *widthmask)
     188{
     189        struct tlib_dev *dev = hand;
     190
     191        dev->drv->get_widthmask(dev, widthmask);
     192}
     193
    186194#ifdef __cplusplus
    187195}
  • c/src/lib/libbsp/sparc/shared/timer/gptimer.c

    rae203e0d r78e56096  
    9494        unsigned int base_clk;
    9595        unsigned int base_freq;
     96        unsigned int widthmask;
    9697        char separate_interrupt;
    9798        char isr_installed;
     
    266267                irq_ack_mask = ~0;
    267268
     269        /* Probe timer register width mask */
     270        priv->regs->timer[timer_start].value = 0xffffffff;
     271        priv->widthmask = priv->regs->timer[timer_start].value;
     272
    268273        priv->timer_cnt = timer_cnt;
    269274        for (i=0; i<timer_cnt; i++) {
     
    494499}
    495500
     501static void gptimer_tlib_get_widthmask(
     502        struct tlib_dev *hand,
     503        unsigned int *widthmask)
     504{
     505        struct gptimer_timer *timer = (struct gptimer_timer *)hand;
     506        struct gptimer_priv *priv = priv_from_timer(timer);
     507
     508        *widthmask = priv->widthmask;
     509}
     510
    496511static struct tlib_drv gptimer_tlib_drv =
    497512{
     
    507522        .custom = NULL,
    508523        .int_pend = gptimer_tlib_int_pend,
     524        .get_widthmask = gptimer_tlib_get_widthmask,
    509525};
Note: See TracChangeset for help on using the changeset viewer.