39 #define MSR_APIC_BASE 0x0000001b 42 #define MSR_APIC_BASE_X2APIC 0x400 45 #define MSR_APIC_BASE_MASK ( ~0xfffULL ) 48 #define APIC_ICR 0x0300 51 #define MSR_X2APIC_ICR 0x830 54 #define APIC_ICR_ALL_NOT_SELF 0x000c0000 57 #define APIC_ICR_LEVEL 0x00008000 60 #define APIC_ICR_LEVEL_ASSERT 0x00004000 63 #define APIC_ICR_INIT 0x00000500 66 #define APIC_ICR_SIPI( vector ) ( 0x00000600 | (vector) ) 69 #define IPI_WAIT_MS 10 77 #define SIPI_VECTOR 0x08 94 "addl $8, %%esp\n\t" )
143 ( x2apic ?
"x2" :
"" ), ( (
unsigned long long )
base ) );
#define IPI_WAIT_MS
Time to wait for an IPI to complete.
#define PHYS_CODE(asm_code_str)
#define APIC_ICR
Interrupt command register.
static mp_address(void *address)
Calculate address as seen by a multiprocessor function.
PROVIDE_MPAPI_INLINE(pcbios, mp_address)
unsigned long long uint64_t
#define SIPI_VECTOR
Startup IPI vector.
#define PAGE_SIZE
Page size.
#define MSR_APIC_BASE_MASK
Local APIC base address mask.
static __always_inline unsigned long virt_to_phys(volatile const void *addr)
Convert virtual address to a physical address.
Access to external ("user") memory.
void mp_start_all(mp_func_t func, void *opaque)
Start a multiprocessor function on all application processors.
void __asmcall mp_call(mp_addr_t func, mp_addr_t opaque)
Call a multiprocessor function from C code on the current CPU.
#define __asmcall
Declare a function with standard calling conventions.
#define APIC_ICR_INIT
Interrupt command register: INIT.
void writel(uint32_t data, volatile uint32_t *io_addr)
Write 32-bit dword to memory-mapped device.
void() mp_func_t(mp_addr_t opaque, unsigned int cpuid)
A multiprocessor function.
static void bios_mp_exec_boot(mp_func_t func, void *opaque)
Execute a multiprocessor function on the boot processor.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
unsigned long mp_addr_t
An address within the address space for a multiprocessor function.
static void bios_mp_start_all(mp_func_t func, void *opaque)
Start a multiprocessor function on all application processors.
#define APIC_ICR_LEVEL
Interrupt command register: level mode.
__asm__ __volatile__("call *%9" :"=a"(result), "=c"(discard_ecx), "=d"(discard_edx) :"d"(0), "a"(code), "b"(0), "c"(in_phys), "D"(0), "S"(out_phys), "m"(hypercall))
#define APIC_ICR_SIPI(vector)
Interrupt command register: SIPI.
Multiprocessor functions.
void setup_sipi(unsigned int vector, uint32_t handler, struct i386_regs *regs)
Set up startup IPI handler.
#define APIC_ICR_ALL_NOT_SELF
Interrupt command register: send to all excluding self.
A 32-bit general register dump.
#define MSR_APIC_BASE
Local APIC base address MSR.
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
void __asmcall mp_jump(mp_addr_t func, mp_addr_t opaque)
Protected-mode startup IPI handler.
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")
#define MSR_X2APIC_ICR
Interrupt command register (x2APIC)
#define MSR_APIC_BASE_X2APIC
Local APIC is in x2APIC mode.
PROVIDE_MPAPI(pcbios, mp_exec_boot, bios_mp_exec_boot)
#define APIC_ICR_LEVEL_ASSERT
Interrupt command register: level asserted.
void iounmap(volatile const void *io_addr)
Unmap I/O address.
void mp_exec_boot(mp_func_t func, void *opaque)
Execute a multiprocessor function on the boot processor.
void * ioremap(unsigned long bus_addr, size_t len)
Map bus address as an I/O address.
static void bios_mp_ipi(void *apic, int x2apic, uint32_t icr)
Send an interprocessor interrupt.
Model-specific registers.