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 int smp_init(struct kernel_args *ka); 30 int smp_trap_non_boot_cpus(struct kernel_args *ka, int cpu); 31 void smp_wake_up_all_non_boot_cpus(void); 32 void smp_wait_for_ap_cpus(kernel_args *ka); 33 void smp_send_ici(int target_cpu, int message, unsigned long data, unsigned long data2, unsigned long data3, void *data_ptr, int flags); 34 void smp_send_broadcast_ici(int message, unsigned long data, unsigned long data2, unsigned long data3, void *data_ptr, int flags); 35 int smp_enable_ici(void); 36 int smp_disable_ici(void); 37 38 int smp_get_num_cpus(void); 39 void smp_set_num_cpus(int num_cpus); 40 int smp_get_current_cpu(void); 41 42 int smp_intercpu_int_handler(void); 43 44 #endif /* KERNEL_SMP_H */ 45