2002-07-09 16:24:59 +04:00
|
|
|
/*
|
|
|
|
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
|
|
|
** Distributed under the terms of the NewOS License.
|
|
|
|
*/
|
2003-05-03 20:03:26 +04:00
|
|
|
#ifndef KERNEL_SMP_H
|
|
|
|
#define KERNEL_SMP_H
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2002-10-26 20:13:36 +04:00
|
|
|
#include <KernelExport.h>
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2003-05-03 20:03:26 +04:00
|
|
|
struct kernel_args;
|
|
|
|
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
// intercpu messages
|
|
|
|
enum {
|
|
|
|
SMP_MSG_INVL_PAGE_RANGE = 0,
|
|
|
|
SMP_MSG_INVL_PAGE_LIST,
|
|
|
|
SMP_MSG_GLOBAL_INVL_PAGE,
|
|
|
|
SMP_MSG_RESCHEDULE,
|
|
|
|
SMP_MSG_CPU_HALT,
|
|
|
|
SMP_MSG_1,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
SMP_MSG_FLAG_ASYNC = 0,
|
|
|
|
SMP_MSG_FLAG_SYNC,
|
|
|
|
};
|
|
|
|
|
2003-05-03 20:03:26 +04:00
|
|
|
int smp_init(struct kernel_args *ka);
|
|
|
|
int smp_trap_non_boot_cpus(struct kernel_args *ka, int cpu);
|
2002-07-09 16:24:59 +04:00
|
|
|
void smp_wake_up_all_non_boot_cpus(void);
|
2004-03-14 20:42:18 +03:00
|
|
|
void smp_wait_for_ap_cpus(struct kernel_args *ka);
|
2002-07-09 16:24:59 +04:00
|
|
|
void smp_send_ici(int target_cpu, int message, unsigned long data, unsigned long data2, unsigned long data3, void *data_ptr, int flags);
|
|
|
|
void smp_send_broadcast_ici(int message, unsigned long data, unsigned long data2, unsigned long data3, void *data_ptr, int flags);
|
|
|
|
int smp_enable_ici(void);
|
|
|
|
int smp_disable_ici(void);
|
|
|
|
|
|
|
|
int smp_get_num_cpus(void);
|
|
|
|
void smp_set_num_cpus(int num_cpus);
|
|
|
|
int smp_get_current_cpu(void);
|
|
|
|
|
2003-05-03 20:03:26 +04:00
|
|
|
int smp_intercpu_int_handler(void);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2003-05-03 20:03:26 +04:00
|
|
|
#endif /* KERNEL_SMP_H */
|