1
0
mirror of https://github.com/0xAX/linux-insides.git synced 2024-12-22 22:58:08 +00:00

Merge pull request #505 from jbcayrou/fix-initialization-4-arch_local_irq_disable

Fix arch_local_irq_disable C code extract
This commit is contained in:
0xAX 2017-08-04 20:28:47 +06:00 committed by GitHub
commit 30c5150968
2 changed files with 4 additions and 3 deletions

View File

@ -218,13 +218,13 @@ this_cpu_write(irq_stack_union.stack_canary, canary); // read below about this_c
Again, we will not dive into details here, we will cover it in the part about [IRQs](http://en.wikipedia.org/wiki/Interrupt_request_%28PC_architecture%29). As canary is set, we disable local and early boot IRQs and register the bootstrap CPU in the CPU maps. We disable local IRQs (interrupts for current CPU) with the `local_irq_disable` macro which expands to the call of the `arch_local_irq_disable` function from [include/linux/percpu-defs.h](https://github.com/torvalds/linux/blob/16f73eb02d7e1765ccab3d2018e0bd98eb93d973/include/linux/percpu-defs.h):
```C
static inline notrace void arch_local_irq_enable(void)
static inline notrace void arch_local_irq_disable(void)
{
native_irq_enable();
native_irq_disable();
}
```
Where `native_irq_enable` is `cli` instruction for `x86_64`. As interrupts are disabled we can register the current CPU with the given ID in the CPU bitmap.
Where `native_irq_disable` is `cli` instruction for `x86_64`. As interrupts are disabled we can register the current CPU with the given ID in the CPU bitmap.
The first processor activation
---------------------------------------------------------------------------------

View File

@ -106,3 +106,4 @@ Thank you to all contributors:
* [Sachin Patil](https://github.com/psachin)
* [Stéphan Gorget](https://github.com/phantez)
* [Adrian Reyes](https://github.com/int3rrupt)
* [JB Cayrou](https://github.com/jbcayrou)