> That's alright while debugging. But before we commit the source code, we
> need it to be in a way which is the most readable, so people can easily
> work it out.
Ok, then I will modify my code this way.
> ? No. Introducing a variable, remembering that it holds a value, and
> eventually returning it, is much more brain overhead than just directly
> returning the value.
Same
Also, having a few returns early in the function, to eliminate the error
cases and trivial cases, allows to get rid of that from the mind, and
focus on the real stuff for the rest of the function.
> So it's a special address whose accesses are trapped within the chip and
> don't actually get out on the memory bus?
The local APIC's registers are memory-mapped in physical page FEE00xxx
(as seen in table 8-1 of Intel P4 SPG). This address is the same for
each local APIC that exists in a configuration, meaning you are only
able to directly access the registers of the local APIC of the core that
your code is currently executing on.
The physical address is not always the same: each machine can map the Local APIC in a different address. By this reason, I search It in ACPI tables, in MADT (APIC) table.
Thanks for your review :) . This weekend I will try to fix the code.