arch: move up_interrupt_context to arch specific irq.h
Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
parent
a754c517cc
commit
6a3a32b185
|
@ -267,6 +267,22 @@ static inline_function void up_set_current_regs(uint32_t *regs)
|
|||
g_current_regs[up_cpu_index()] = regs;
|
||||
}
|
||||
|
||||
noinstrument_function
|
||||
static inline_function bool up_interrupt_context(void)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
irqstate_t flags = up_irq_save();
|
||||
#endif
|
||||
|
||||
bool ret = up_current_regs() != NULL;
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
up_irq_restore(flags);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
|
|
@ -391,6 +391,22 @@ static inline_function void up_set_current_regs(uint32_t *regs)
|
|||
g_current_regs[up_cpu_index()] = regs;
|
||||
}
|
||||
|
||||
noinstrument_function
|
||||
static inline_function bool up_interrupt_context(void)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
irqstate_t flags = up_irq_save();
|
||||
#endif
|
||||
|
||||
bool ret = up_current_regs() != NULL;
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
up_irq_restore(flags);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
|
|
@ -519,6 +519,12 @@ static inline_function void up_set_current_regs(uint32_t *regs)
|
|||
);
|
||||
}
|
||||
|
||||
noinstrument_function
|
||||
static inline_function bool up_interrupt_context(void)
|
||||
{
|
||||
return up_current_regs() != NULL;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
|
|
@ -596,6 +596,22 @@ static inline_function void up_set_current_regs(uint32_t *regs)
|
|||
g_current_regs[up_cpu_index()] = regs;
|
||||
}
|
||||
|
||||
noinstrument_function
|
||||
static inline_function bool up_interrupt_context(void)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
irqstate_t flags = up_irq_save();
|
||||
#endif
|
||||
|
||||
bool ret = up_current_regs() != NULL;
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
up_irq_restore(flags);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
|
|
@ -501,6 +501,12 @@ static inline_function void up_set_current_regs(uint32_t *regs)
|
|||
);
|
||||
}
|
||||
|
||||
noinstrument_function
|
||||
static inline_function bool up_interrupt_context(void)
|
||||
{
|
||||
return up_current_regs() != NULL;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
|
|
@ -569,6 +569,22 @@ static inline_function void up_set_current_regs(uint32_t *regs)
|
|||
g_current_regs[up_cpu_index()] = regs;
|
||||
}
|
||||
|
||||
noinstrument_function
|
||||
static inline_function bool up_interrupt_context(void)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
irqstate_t flags = up_irq_save();
|
||||
#endif
|
||||
|
||||
bool ret = up_current_regs() != NULL;
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
up_irq_restore(flags);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
|
|
@ -501,6 +501,12 @@ static inline_function void up_set_current_regs(uint32_t *regs)
|
|||
);
|
||||
}
|
||||
|
||||
noinstrument_function
|
||||
static inline_function bool up_interrupt_context(void)
|
||||
{
|
||||
return up_current_regs() != NULL;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
|
|
@ -84,34 +84,6 @@ extern "C"
|
|||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Inline functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_interrupt_context
|
||||
*
|
||||
* Description:
|
||||
* Return true is we are currently executing in the interrupt
|
||||
* handler context.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
noinstrument_function
|
||||
static inline bool up_interrupt_context(void)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
irqstate_t flags = up_irq_save();
|
||||
#endif
|
||||
|
||||
bool ret = up_current_regs() != NULL;
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
up_irq_restore(flags);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#undef EXTERN
|
||||
|
|
|
@ -296,6 +296,22 @@ static inline_function void up_set_current_regs(uint32_t *regs)
|
|||
g_current_regs[up_cpu_index()] = regs;
|
||||
}
|
||||
|
||||
noinstrument_function
|
||||
static inline_function bool up_interrupt_context(void)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
irqstate_t flags = up_irq_save();
|
||||
#endif
|
||||
|
||||
bool ret = up_current_regs() != NULL;
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
up_irq_restore(flags);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
|
|
@ -433,17 +433,7 @@ static inline_function void up_set_current_regs(uint64_t *regs)
|
|||
|
||||
static inline bool up_interrupt_context(void)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
irqstate_t flags = up_irq_save();
|
||||
#endif
|
||||
|
||||
bool ret = (up_current_regs() != NULL);
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
up_irq_restore(flags);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
return up_current_regs() != NULL;
|
||||
}
|
||||
|
||||
#undef EXTERN
|
||||
|
|
Loading…
Reference in New Issue