aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips/smtc_ipi.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-mips/smtc_ipi.h')
-rw-r--r--include/asm-mips/smtc_ipi.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/asm-mips/smtc_ipi.h b/include/asm-mips/smtc_ipi.h
index 55f3419f6546..a52a4a7a36e0 100644
--- a/include/asm-mips/smtc_ipi.h
+++ b/include/asm-mips/smtc_ipi.h
@@ -4,6 +4,8 @@
4#ifndef __ASM_SMTC_IPI_H 4#ifndef __ASM_SMTC_IPI_H
5#define __ASM_SMTC_IPI_H 5#define __ASM_SMTC_IPI_H
6 6
7#include <linux/spinlock.h>
8
7//#define SMTC_IPI_DEBUG 9//#define SMTC_IPI_DEBUG
8 10
9#ifdef SMTC_IPI_DEBUG 11#ifdef SMTC_IPI_DEBUG
@@ -63,12 +65,10 @@ static inline void smtc_ipi_nq(struct smtc_ipi_q *q, struct smtc_ipi *p)
63 spin_unlock_irqrestore(&q->lock, flags); 65 spin_unlock_irqrestore(&q->lock, flags);
64} 66}
65 67
66static inline struct smtc_ipi *smtc_ipi_dq(struct smtc_ipi_q *q) 68static inline struct smtc_ipi *__smtc_ipi_dq(struct smtc_ipi_q *q)
67{ 69{
68 struct smtc_ipi *p; 70 struct smtc_ipi *p;
69 long flags;
70 71
71 spin_lock_irqsave(&q->lock, flags);
72 if (q->head == NULL) 72 if (q->head == NULL)
73 p = NULL; 73 p = NULL;
74 else { 74 else {
@@ -79,7 +79,19 @@ static inline struct smtc_ipi *smtc_ipi_dq(struct smtc_ipi_q *q)
79 if (q->head == NULL) 79 if (q->head == NULL)
80 q->tail = NULL; 80 q->tail = NULL;
81 } 81 }
82
83 return p;
84}
85
86static inline struct smtc_ipi *smtc_ipi_dq(struct smtc_ipi_q *q)
87{
88 unsigned long flags;
89 struct smtc_ipi *p;
90
91 spin_lock_irqsave(&q->lock, flags);
92 p = __smtc_ipi_dq(q);
82 spin_unlock_irqrestore(&q->lock, flags); 93 spin_unlock_irqrestore(&q->lock, flags);
94
83 return p; 95 return p;
84} 96}
85 97