2 Copyright (C) 2008 Mathias Gottschlag
4 Permission is hereby granted, free of charge, to any person obtaining a copy of
5 this software and associated documentation files (the "Software"), to deal in the
6 Software without restriction, including without limitation the rights to use,
7 copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8 Software, and to permit persons to whom the Software is furnished to do so,
9 subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in all
12 copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 * Advanced programmable interrupt controller
26 #ifndef KE_APIC_H_INCLUDED
27 #define KE_APIC_H_INCLUDED
32 * Initialized the APIC. Is called by the operating system at startup.
37 * Returns the APIC ID of the current CPU.
39 uint32_t keAPICGetCPU(void);
42 * Writes into an APIC register.
44 void keAPICWrite(uint16_t offset
, uint32_t value
);
46 * Reads from an APIC register.
48 uint32_t keAPICRead(uint16_t offset
);
50 * Send an INIT IPI to all CPUs but the currently used.
52 void keAPICWriteInit(void);
54 * Send a STARTUP IPI to all CPUs but the currently used.
56 void keAPICWriteStartup(uintptr_t entry
);
59 * \param intno Interrupt to be triggered.
60 * \param self If set to 1, include currently used CPU.
62 void keAPICBroadcast(uint8_t intno
, int self
);