*/
bool apic_bsp = true;
-// global pointers used in init_ap.S
-extern uint64_t x86_64_start_ap;
-extern uint64_t x86_64_init_ap_wait;
-extern uint64_t x86_32_start_ap;
-extern uint64_t x86_32_init_ap_wait;
-
static xapic_t apic;
/**
*/
void apic_init(void)
{
- //pointer to a variable used as pseudo-lock to synchronize the BSP
- //and the AP which gets enabled
-#if defined(__k1om__)
- volatile uint32_t *ap_wait = (volatile uint32_t *)
- local_phys_to_mem((lpaddr_t)&x86_64_init_ap_wait - ((lpaddr_t)&x86_64_start_ap) +
- K1OM_REAL_MODE_LINEAR_OFFSET);
-#elif defined (__x86_64__)
- volatile uint32_t *ap_wait = (volatile uint32_t *)
- local_phys_to_mem((lpaddr_t)&x86_64_init_ap_wait - ((lpaddr_t)&x86_64_start_ap) +
- X86_64_REAL_MODE_LINEAR_OFFSET);
-#elif defined (__i386__)
-# if !defined(__scc__)
- volatile uint32_t *ap_wait = (volatile uint32_t *)
- local_phys_to_mem((lpaddr_t)&x86_32_init_ap_wait - ((lpaddr_t)&x86_32_start_ap) +
- X86_32_REAL_MODE_LINEAR_OFFSET);
-# endif
-#else
-#error "Architecture not supported"
-#endif
-
#if !defined(__scc__)
ia32_apic_base_t apic_base_msr = ia32_apic_base_rd(NULL);
lpaddr_t apic_phys = ((lpaddr_t)apic_base_msr) & APIC_BASE_ADDRESS_MASK;
} else {
debug(SUBSYS_APIC, "APIC: application processor\n");
apic_bsp = false;
- *ap_wait = AP_STARTED;
}
#endif
#include <arch/x86/apic.h>
#include <target/x86/barrelfish_kpi/coredata_target.h>
#include <arch/x86/startup_x86.h>
+
#ifdef __scc__
# include <rck.h>
#endif
/* spawn init */
init_dcb = spawn_bsp_init(BSP_INIT_MODULE_PATH, bsp_alloc_phys);
} else {
+ start_ap_signal();
// if we have a kernel control block, use it
if (kcb_current && kcb_current->is_valid) {
debug(SUBSYS_STARTUP, "have valid kcb, restoring state\n");
#define __STARTUP_X86_H
#include <startup.h>
+#include <arch/x86/start_aps.h>
#define BOOTINFO_BASE ((lvaddr_t)0x200000)
#define ARGS_BASE (BOOTINFO_BASE + BOOTINFO_SIZE)
extern struct x86_core_data *glbl_core_data; // XXX: Arch specific
+// global pointers used in init_ap.S
+extern uint64_t x86_64_start_ap;
+extern uint64_t x86_64_init_ap_wait;
+extern uint64_t x86_32_start_ap;
+extern uint64_t x86_32_init_ap_wait;
+
+static inline void start_ap_signal(void)
+{
+
+ //pointer to a variable used as pseudo-lock to synchronize the BSP
+ //and the AP which gets enabled
+#if defined(__k1om__) || defined(__x86_64__)
+ volatile uint32_t *ap_wait = (volatile uint32_t *)
+ local_phys_to_mem((lpaddr_t)&x86_64_init_ap_wait - ((lpaddr_t)&x86_64_start_ap) +
+ X86_64_REAL_MODE_LINEAR_OFFSET);
+#elif defined (__i386__)
+# if !defined(__scc__)
+ volatile uint32_t *ap_wait = (volatile uint32_t *)
+ local_phys_to_mem((lpaddr_t)&x86_32_init_ap_wait - ((lpaddr_t)&x86_32_start_ap) +
+ X86_32_REAL_MODE_LINEAR_OFFSET);
+# endif
+#else
+#error "Architecture not supported"
+#endif
+
+ *ap_wait = AP_STARTED;
+}
+
#endif // __STARTUP_X86_H