kernel - irqs_disabled() vs in_interrupt() in linux -
kernel - irqs_disabled() vs in_interrupt() in linux -
what difference between these 2 functions in linux. know irqs_disabled() homecoming whether irqs disabled or not , in_interrupt() homecoming whether in interrupt context or not. default if in interrupt context doesn't mean irqs disabled?
what scenarios utilize these functions specifically?
consider these 2 cases:
1) there platform back upwards nested interrupts, 1 interrupt can occur when hasn't returned yet. priorities configured in interrupt controller registers.
2) multi core cpu can process 2 interrupts @ same time, on @ each core.
there many reasons check if function running in interrupt context, i.e: functions uses thread locking, shall not executed in interrupt context otherwise deadlock occur. these functions might want check if interrupt context , abort error.
also, there many reasons disable interrupts, i.e.: when writing memory construction consumed interrupt handler, might fill info in atomic mode (irqs disabled).
one place both functions used in spinlock function family because spinlocks used in interrupt context.
linux-kernel kernel linux-device-driver
Comments
Post a Comment