3 * \brief Startup prototypes.
7 * Copyright (c) 2007, 2008, 2009, 2010, ETH Zurich.
10 * This file is distributed under the terms in the attached LICENSE file.
11 * If you do not find this file, copies can be found by writing to:
12 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
15 #ifndef __STARTUP_X86_H
16 #define __STARTUP_X86_H
19 #include <arch/x86/start_aps.h>
21 #define BOOTINFO_BASE ((lvaddr_t)0x200000)
22 #define ARGS_BASE (BOOTINFO_BASE + BOOTINFO_SIZE)
23 #define DISPATCHER_BASE (ARGS_BASE + ARGS_SIZE)
24 #define MON_URPC_BASE (DISPATCHER_BASE + DISPATCHER_SIZE)
27 extern int kernel_scckernel;
30 errval_t startup_map_init(lvaddr_t vbase, lpaddr_t base, size_t size,
32 errval_t startup_alloc_init(void *state, genvaddr_t gvbase, size_t size,
33 uint32_t flags, void **ret);
34 void create_module_caps(struct spawn_state *st);
35 void cleanup_bios_regions(char *mmap_addr, char **new_mmap_addr,
36 uint32_t *new_mmap_length);
38 struct dcb *spawn_bsp_init(const char *name, alloc_phys_func alloc_phys);
39 struct dcb *spawn_app_init(struct x86_core_data *core_data,
40 const char *name, alloc_phys_func alloc_phys);
42 extern struct x86_core_data *glbl_core_data; // XXX: Arch specific
44 // global pointers used in init_ap.S
45 extern uint64_t x86_64_start_ap;
46 extern uint64_t x86_64_init_ap_wait;
47 extern uint64_t x86_32_start_ap;
48 extern uint64_t x86_32_init_ap_wait;
50 static inline void start_ap_signal(void)
53 //pointer to a variable used as pseudo-lock to synchronize the BSP
54 //and the AP which gets enabled
55 #if defined(__k1om__) || defined(__x86_64__)
56 volatile uint32_t *ap_wait = (volatile uint32_t *)
57 local_phys_to_mem((lpaddr_t)&x86_64_init_ap_wait - ((lpaddr_t)&x86_64_start_ap) +
58 X86_64_REAL_MODE_LINEAR_OFFSET);
59 #elif defined (__i386__)
60 # if !defined(__scc__)
61 volatile uint32_t *ap_wait = (volatile uint32_t *)
62 local_phys_to_mem((lpaddr_t)&x86_32_init_ap_wait - ((lpaddr_t)&x86_32_start_ap) +
63 X86_32_REAL_MODE_LINEAR_OFFSET);
66 #error "Architecture not supported"
69 *ap_wait = AP_STARTED;
72 void configure_page_attribute_table(void);
74 #endif // __STARTUP_X86_H