Changed the boot procedure a bit.

Extracted scheduler_init() from start_scheduler() (which is now called scheduler_start()).
Moved scheduler related function prototypes from thread.h to the new scheduler.h.
Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14518 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-10-25 16:59:12 +00:00
parent 82f3114509
commit 6cd505cee7
15 changed files with 324 additions and 279 deletions
+1 -2
View File
@@ -11,8 +11,7 @@
#include <smp.h>
#include <timer.h>
struct kernel_args;
#include <boot/kernel_args.h>
/* CPU local data structure */
+27
View File
@@ -0,0 +1,27 @@
/*
* Copyright 2005, Axel Dörfler, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef KERNEL_SCHEDULER_H
#define KERNEL_SCHEDULER_H
struct thread;
#ifdef __cplusplus
extern "C" {
#endif
void scheduler_enqueue_in_run_queue(struct thread *thread);
void scheduler_remove_from_run_queue(struct thread *thread);
void scheduler_reschedule(void);
void scheduler_init(void);
void scheduler_start(void);
#ifdef __cplusplus
}
#endif
#endif /* KERNEL_SCHEDULER_H */
+24 -13
View File
@@ -1,7 +1,10 @@
/*
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
* Copyright 2002-2005, Axel Dörfler, [email protected].
* Distributed under the terms of the MIT License.
*
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
* Distributed under the terms of the NewOS License.
*/
#ifndef KERNEL_SMP_H
#define KERNEL_SMP_H
@@ -26,20 +29,28 @@ enum {
SMP_MSG_FLAG_SYNC,
};
#ifdef __cplusplus
extern "C" {
#endif
status_t smp_init(struct kernel_args *args);
status_t smp_per_cpu_init(struct kernel_args *args, int32 cpu);
int smp_trap_non_boot_cpus(struct kernel_args *ka, int cpu);
void smp_wake_up_all_non_boot_cpus(void);
void smp_wait_for_ap_cpus(struct kernel_args *ka);
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);
bool smp_trap_non_boot_cpus(int32 cpu);
void smp_wake_up_non_boot_cpus(void);
void smp_wait_for_non_boot_cpus(void);
void smp_send_ici(int32 targetCPU, int32 message, uint32 data, uint32 data2, uint32 data3,
void *data_ptr, uint32 flags);
void smp_send_broadcast_ici(int32 message, uint32 data, uint32 data2, uint32 data3,
void *data_ptr, uint32 flags);
int smp_get_num_cpus(void);
void smp_set_num_cpus(int num_cpus);
int smp_get_current_cpu(void);
int32 smp_get_num_cpus(void);
void smp_set_num_cpus(int32 numCPUs);
int32 smp_get_current_cpu(void);
int smp_intercpu_int_handler(void);
#ifdef __cplusplus
}
#endif
#endif /* KERNEL_SMP_H */
-6
View File
@@ -20,17 +20,11 @@ struct kernel_args;
extern "C" {
#endif
void scheduler_reschedule(void);
void start_scheduler(void);
void thread_enqueue(struct thread *t, struct thread_queue *q);
struct thread *thread_lookat_queue(struct thread_queue *q);
struct thread *thread_dequeue(struct thread_queue *q);
struct thread *thread_dequeue_id(struct thread_queue *q, thread_id thr_id);
void scheduler_enqueue_in_run_queue(struct thread *thread);
void scheduler_remove_from_run_queue(struct thread *thread);
void thread_at_kernel_entry(void);
// called when the thread enters the kernel on behalf of the thread
void thread_at_kernel_exit(void);