Changeset 266a5c92 in rtems


Ignore:
Timestamp:
05/20/05 19:22:26 (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
15113c4
Parents:
5c1af4c
Message:

2005-05-20 Jennifer Averett <jennifer@…>

PR 702/bsps

  • include/tm27.h: Add better tm27.h support. Uses decrementer register interrupt -- copied from psim.
Location:
c/src/lib/libbsp/powerpc/mvme5500
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/mvme5500/ChangeLog

    r5c1af4c r266a5c92  
     12005-05-20      Jennifer Averett <jennifer@OARcorp.com>
     2
     3        PR 702/bsps
     4        * include/tm27.h: Add better tm27.h support. Uses decrementer register
     5        interrupt -- copied from psim.
     6
    172005-05-17      Jennifer Averett <jennifer.averett@oarcorp.com>
    28
  • c/src/lib/libbsp/powerpc/mvme5500/include/tm27.h

    r5c1af4c r266a5c92  
    1616#define __tm27_h
    1717
     18#include <bsp/irq.h>
     19
    1820/*
    1921 *  Stuff for Time Test 27
    2022 */
    2123
    22 #define MUST_WAIT_FOR_INTERRUPT 0
     24#define MUST_WAIT_FOR_INTERRUPT 1
    2325
    24 #define Install_tm27_vector( handler ) /* empty */
     26void nullFunc() {}
     27static rtems_irq_connect_data clockIrqData = {BSP_DECREMENTER,
     28                                              0,
     29                                              (rtems_irq_enable)nullFunc,
     30                                              (rtems_irq_disable)nullFunc,
     31                                              (rtems_irq_is_enabled) nullFunc};
    2532
    26 #define Cause_tm27_intr() /* empty */
     33void Install_tm27_vector(void (*_handler)())
     34{
     35  clockIrqData.hdl = _handler;
     36  if (!BSP_install_rtems_irq_handler (&clockIrqData)) {
     37        printk("Error installing clock interrupt handler!\n");
     38        rtems_fatal_error_occurred(1);
     39  }
     40}
    2741
    28 #define Clear_tm27_intr() /* empty */
     42#define Cause_tm27_intr()  \
     43  do { \
     44    uint32_t _clicks = 1; \
     45    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
     46  } while (0)
    2947
    30 #define Lower_tm27_intr() /* empty */
     48
     49#define Clear_tm27_intr() \
     50  do { \
     51    uint32_t _clicks = 0xffffffff; \
     52    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
     53  } while (0)
     54
     55#define Lower_tm27_intr() \
     56  do { \
     57    uint32_t _msr = 0; \
     58    _ISR_Set_level( 0 ); \
     59    asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
     60    _msr |=  0x8002; \
     61    asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
     62  } while (0)
    3163
    3264#endif
Note: See TracChangeset for help on using the changeset viewer.