xref: /haiku/headers/private/kernel/smp.h (revision 67bce78b48ed6d01b5a8eef89f5694c372b7e0a1)
1 /*
2 ** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
4 */
5 #ifndef KERNEL_SMP_H
6 #define KERNEL_SMP_H
7 
8 
9 #include <KernelExport.h>
10 
11 struct kernel_args;
12 
13 
14 // intercpu messages
15 enum {
16 	SMP_MSG_INVL_PAGE_RANGE = 0,
17 	SMP_MSG_INVL_PAGE_LIST,
18 	SMP_MSG_GLOBAL_INVL_PAGE,
19 	SMP_MSG_RESCHEDULE,
20 	SMP_MSG_CPU_HALT,
21 	SMP_MSG_1,
22 };
23 
24 enum {
25 	SMP_MSG_FLAG_ASYNC = 0,
26 	SMP_MSG_FLAG_SYNC,
27 };
28 
29 status_t smp_init(struct kernel_args *args);
30 status_t smp_per_cpu_init(struct kernel_args *args, int32 cpu);
31 int smp_trap_non_boot_cpus(struct kernel_args *ka, int cpu);
32 void smp_wake_up_all_non_boot_cpus(void);
33 void smp_wait_for_ap_cpus(struct kernel_args *ka);
34 void smp_send_ici(int target_cpu, int message, unsigned long data, unsigned long data2, unsigned long data3, void *data_ptr, int flags);
35 void smp_send_broadcast_ici(int message, unsigned long data, unsigned long data2, unsigned long data3, void *data_ptr, int flags);
36 int smp_enable_ici(void);
37 int smp_disable_ici(void);
38 
39 int smp_get_num_cpus(void);
40 void smp_set_num_cpus(int num_cpus);
41 int smp_get_current_cpu(void);
42 
43 int smp_intercpu_int_handler(void);
44 
45 #endif	/* KERNEL_SMP_H */
46