littlekernel / lk

LK embedded kernel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

arch_in_int_handler not working on multicore ARCH

uandkiran opened this issue · comments

on multicore processor, arch_in_int_handler call on CoreX returns 1, when interrupt hanlder is actually active on CoreY.
Sol:
__arm_in_handler needs to be percore variable rather than single variable shared across core(s)

static inline bool arch_in_int_handler(void) {
#if ARM_ISA_ARMV7M
uint32_t ipsr;
__asm volatile ("MRS %0, ipsr" : "=r" (ipsr) );
return (ipsr & IPSR_ISR_Msk);
#else
/* set by the interrupt glue to track that the cpu is inside a handler */
extern bool __arm_in_handler;

return __arm_in_handler;

#endif
}

This is very true. Need to add a per cpu structure and put the bool there, if necessary.