Changeset 6fdded2c in rtems
- Timestamp:
- May 10, 2017, 10:39:23 AM (3 years ago)
- Branches:
- master
- Children:
- 818f10bc
- Parents:
- 3feae3b
- git-author:
- Daniel Hellstrom <daniel@…> (05/10/17 10:39:23)
- git-committer:
- Daniel Hellstrom <daniel@…> (05/14/17 10:32:00)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/sparc/shared/1553/gr1553bm.c
r3feae3b r6fdded2c 24 24 #define GR1553BM_READ_REG(adr) (*(volatile uint32_t *)(adr)) 25 25 26 #ifndef IRQ_GLOBAL_PREPARE 27 #define IRQ_GLOBAL_PREPARE(level) rtems_interrupt_level level 26 /* Use interrupt lock privmitives compatible with SMP defined in 27 * RTEMS 4.11.99 and higher. 28 */ 29 #if (((__RTEMS_MAJOR__ << 16) | (__RTEMS_MINOR__ << 8) | __RTEMS_REVISION__) >= 0x040b63) 30 31 /* map via rtems_interrupt_lock_* API: */ 32 #define SPIN_DECLARE(lock) RTEMS_INTERRUPT_LOCK_MEMBER(lock) 33 #define SPIN_INIT(lock, name) rtems_interrupt_lock_initialize(lock, name) 34 #define SPIN_LOCK(lock, level) rtems_interrupt_lock_acquire_isr(lock, &level) 35 #define SPIN_LOCK_IRQ(lock, level) rtems_interrupt_lock_acquire(lock, &level) 36 #define SPIN_UNLOCK(lock, level) rtems_interrupt_lock_release_isr(lock, &level) 37 #define SPIN_UNLOCK_IRQ(lock, level) rtems_interrupt_lock_release(lock, &level) 38 #define SPIN_IRQFLAGS(k) rtems_interrupt_lock_context k 39 #define SPIN_ISR_IRQFLAGS(k) SPIN_IRQFLAGS(k) 40 #define SPIN_FREE(lock) rtems_interrupt_lock_destroy(lock) 41 42 #else 43 44 /* maintain single-core compatibility with older versions of RTEMS: */ 45 #define SPIN_DECLARE(name) 46 #define SPIN_INIT(lock, name) 47 #define SPIN_LOCK(lock, level) 48 #define SPIN_LOCK_IRQ(lock, level) rtems_interrupt_disable(level) 49 #define SPIN_UNLOCK(lock, level) 50 #define SPIN_UNLOCK_IRQ(lock, level) rtems_interrupt_enable(level) 51 #define SPIN_IRQFLAGS(k) rtems_interrupt_level k 52 #define SPIN_ISR_IRQFLAGS(k) 53 #define SPIN_FREE(lock) 54 55 #ifdef RTEMS_SMP 56 #error SMP mode not compatible with these interrupt lock primitives 28 57 #endif 29 58 30 #ifndef IRQ_GLOBAL_DISABLE31 #define IRQ_GLOBAL_DISABLE(level) rtems_interrupt_disable(level)32 #endif33 34 #ifndef IRQ_GLOBAL_ENABLE35 #define IRQ_GLOBAL_ENABLE(level) rtems_interrupt_enable(level)36 59 #endif 37 60 … … 39 62 struct drvmgr_dev **pdev; 40 63 struct gr1553b_regs *regs; 64 SPIN_DECLARE(devlock); 41 65 42 66 void *buffer; … … 81 105 static void gr1553bm_hw_start(struct gr1553bm_priv *priv) 82 106 { 83 IRQ_GLOBAL_PREPARE(oldLevel);107 SPIN_IRQFLAGS(irqflags); 84 108 85 109 /* Enable IRQ source and mark running state */ 86 IRQ_GLOBAL_DISABLE(oldLevel);110 SPIN_LOCK_IRQ(&priv->devlock, irqflags); 87 111 88 112 priv->started = 1; … … 104 128 | GR1553B_BM_CTRL_BMEN; 105 129 106 IRQ_GLOBAL_ENABLE(oldLevel);130 SPIN_UNLOCK_IRQ(&priv->devlock, irqflags); 107 131 } 108 132 109 133 static void gr1553bm_hw_stop(struct gr1553bm_priv *priv) 110 134 { 111 IRQ_GLOBAL_PREPARE(oldLevel);112 113 IRQ_GLOBAL_DISABLE(oldLevel);135 SPIN_IRQFLAGS(irqflags); 136 137 SPIN_LOCK_IRQ(&priv->devlock, irqflags); 114 138 115 139 /* Stop Logging */ … … 124 148 priv->started = 0; 125 149 126 IRQ_GLOBAL_ENABLE(oldLevel);150 SPIN_UNLOCK_IRQ(&priv->devlock, irqflags); 127 151 } 128 152 … … 153 177 pnpinfo = &ambadev->info; 154 178 priv->regs = (struct gr1553b_regs *)pnpinfo->apb_slv->start; 179 SPIN_INIT(&priv->devlock, "gr1553bm"); 155 180 156 181 /* Start with default configuration */
Note: See TracChangeset
for help on using the changeset viewer.