#ifndef _MACHINE_SMP_H_
#define _MACHINE_SMP_H_
#ifdef _KERNEL
#ifndef LOCORE
void initializecpu(int cpu);
#endif
#ifndef LOCORE
extern int current_postcode;
#define POSTCODE(X) current_postcode = (X), \
outb(0x80, current_postcode)
#define POSTCODE_LO(X) current_postcode &= 0xf0, \
current_postcode |= ((X) & 0x0f), \
outb(0x80, current_postcode)
#define POSTCODE_HI(X) current_postcode &= 0x0f, \
current_postcode |= (((X) << 4) & 0xf0), \
outb(0x80, current_postcode)
#include <machine_base/apic/apicreg.h>
#include <machine/pcb.h>
extern char mptramp_start[];
extern char mptramp_end[];
extern u_int32_t mptramp_pagetables;
void bootMP (void);
extern volatile cpumask_t stopped_cpus;
extern volatile cpumask_t started_cpus;
extern void (*cpustop_restartfunc) (void);
extern struct pcb stoppcbs[];
u_int mp_bootaddress (u_int);
void mp_start (void);
void mp_announce (void);
void init_secondary (void);
int stop_cpus (cpumask_t);
void ap_init (void);
int restart_cpus (cpumask_t);
void cpu_send_ipiq (int);
int cpu_send_ipiq_passive (int);
extern cpumask_t smp_active_mask;
void detect_cpu_topology(void);
int fix_amd_topology(void);
int get_chip_ID(int cpuid);
int get_chip_ID_from_APICID(int apicid);
int get_core_number_within_chip(int cpuid);
int get_logical_CPU_number_within_core(int cpuid);
#include <machine_base/apic/lapic.h>
static __inline
int get_apicid_from_cpuid(int cpuid) {
return CPUID_TO_APICID(cpuid);
}
static __inline
int get_cpuid_from_apicid(int apicid) {
return APICID_TO_CPUID(apicid);
}
#endif
#endif
#endif