15 #include <smp/atomic.h>
16 #include <smp/spinlock.h>
32 #define AP_SIPI_VECTOR 0x1000
48 gdt_base = (
void *)&gdt_limit[1];
56 unsigned long code_size;
71 die(
"Out of backup memory\n");
92 int loops = timeout_ms * 10;
101 }
while (send_status && (--loops > 0));
108 const int timeout_100ms = 100;
109 uint32_t send_status, accept_status;
126 "Disabling\n", apicid);
146 "Disabling\n", apicid);
158 for (j = 1; j <= CONFIG_NUM_IPI_STARTS; j++) {
192 if (send_status || accept_status)
201 if (send_status || accept_status)
229 unsigned long apicid;
245 stack_base =
stack_top - CONFIG_STACK_SIZE;
343 int old_active_count, active_count;
348 old_active_count = 1;
350 while (active_count > 1) {
351 if (active_count != old_active_count) {
354 old_active_count = active_count;
403 if (
CONFIG(SMM_LEGACY_ASEG))
416 if (
CONFIG(SMM_LEGACY_ASEG))
static int acpi_is_wakeup_s3(void)
void cpu_initialize(unsigned int index)
void cpu_add_map_entry(unsigned int index)
static struct cpu_info * cpu_info(void)
void * memcpy(void *dest, const void *src, size_t n)
#define printk(level,...)
void __noreturn die(const char *fmt,...)
#define SPEEDSTEP_APIC_MAGIC
static __always_inline void write_cr4(CRx_TYPE data)
static __always_inline CRx_TYPE read_cr4(void)
void mdelay(unsigned int msecs)
struct device * alloc_find_dev(struct bus *parent, struct device_path *path)
See if a device structure already exists and if not allocate it.
static struct smmstore_params_info info
char _secondary_gdt_addr[]
char _secondary_start_end[]
#define atomic_dec(v)
atomic_dec - decrement atomic variable
#define atomic_inc(v)
atomic_inc - increment atomic variable
#define spin_unlock(lock)
void * malloc(size_t size)
void setup_lapic_interrupts(void)
static __always_inline unsigned int lapicid(void)
static __always_inline int lapic_busy(void)
static __always_inline void lapic_write(unsigned int reg, uint32_t v)
static __always_inline uint32_t lapic_read(unsigned int reg)
static __always_inline void lapic_send_ipi(uint32_t icrlow, uint32_t apicid)
static void copy_secondary_start_to_lowest_1M(void)
void initialize_cpus(struct bus *cpu_bus)
static void * stacks[CONFIG_MAX_CPUS]
static uint32_t wait_for_ipi_completion(const int timeout_ms)
asmlinkage void secondary_cpu_init(unsigned int index)
DECLARE_SPIN_LOCK(start_cpu_lock)
static char * lowmem_backup_ptr
volatile unsigned int secondary_cpu_index
static int lapic_start_cpu(unsigned long apicid)
static void start_other_cpus(struct bus *cpu_bus, struct device *bsp_cpu)
static unsigned int last_cpu_index
static char * lowmem_backup
static int lowmem_backup_size
static void wait_other_cpus_stop(struct bus *cpu_bus)
static void recover_lowest_1M(void)
volatile unsigned long secondary_stack
static atomic_t active_cpus
static void setup_secondary_gdt(void)
static int start_cpu(struct device *cpu)
void stop_this_cpu(void)
Normally this function is defined in lapic.h as an always inline function that just keeps the CPU in ...
#define LAPIC_INT_LEVELTRIG
int checkstack(void *top_of_stack, int core)
#define BIOS_INFO
BIOS_INFO - Expected events.
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
#define BIOS_SPEW
BIOS_SPEW - Excessively verbose output.
#define BIOS_WARNING
BIOS_WARNING - Bad configuration.
static int is_smp_boot(void)
void smm_init_completion(void)
static uintptr_t stack_top
DEVTREE_CONST struct device * children
enum device_path_type type
DEVTREE_CONST struct device * sibling