kernel: adjust formatting
This commit is contained in:
25
sched/core.c
25
sched/core.c
@@ -1,9 +1,9 @@
|
||||
#include <mango/object.h>
|
||||
#include <mango/sched.h>
|
||||
#include <mango/clock.h>
|
||||
#include <mango/cpu.h>
|
||||
#include <mango/printk.h>
|
||||
#include <mango/machine/thread.h>
|
||||
#include <mango/object.h>
|
||||
#include <mango/printk.h>
|
||||
#include <mango/sched.h>
|
||||
|
||||
extern kern_status_t setup_kernel_task(void);
|
||||
extern kern_status_t setup_idle_task(void);
|
||||
@@ -37,8 +37,14 @@ kern_status_t sched_init(void)
|
||||
return status;
|
||||
}
|
||||
|
||||
struct thread *this_thread = QUEUE_CONTAINER(struct thread, tr_threads, queue_first(&kernel_task()->t_threads));
|
||||
struct thread *idle_thread = QUEUE_CONTAINER(struct thread, tr_threads, queue_first(&idle_task()->t_threads));
|
||||
struct thread *this_thread = QUEUE_CONTAINER(
|
||||
struct thread,
|
||||
tr_threads,
|
||||
queue_first(&kernel_task()->t_threads));
|
||||
struct thread *idle_thread = QUEUE_CONTAINER(
|
||||
struct thread,
|
||||
tr_threads,
|
||||
queue_first(&idle_task()->t_threads));
|
||||
|
||||
struct cpu_data *this_cpu = get_this_cpu();
|
||||
rq_init(&this_cpu->c_rq);
|
||||
@@ -55,7 +61,8 @@ kern_status_t sched_init(void)
|
||||
|
||||
static void expire_timers(struct cpu_data *cpu)
|
||||
{
|
||||
queue_foreach(struct timer, timer, &cpu->c_timers, t_entry) {
|
||||
queue_foreach(struct timer, timer, &cpu->c_timers, t_entry)
|
||||
{
|
||||
if (timer->t_expiry <= clock_ticks) {
|
||||
timer->t_callback(timer);
|
||||
}
|
||||
@@ -102,7 +109,8 @@ void __schedule(enum sched_mode mode)
|
||||
|
||||
enum thread_state prev_state = READ_ONCE(prev->tr_state);
|
||||
|
||||
if ((mode == SCHED_IRQ || prev_state == THREAD_READY) && prev != rq->rq_idle) {
|
||||
if ((mode == SCHED_IRQ || prev_state == THREAD_READY)
|
||||
&& prev != rq->rq_idle) {
|
||||
rq_enqueue(rq, prev);
|
||||
}
|
||||
|
||||
@@ -213,7 +221,8 @@ void end_charge_period(void)
|
||||
|
||||
self->tr_charge_period_start = 0;
|
||||
|
||||
//printk("%llu cycles charged to %s/%u", charge, self->tr_parent->t_name, self->tr_parent->t_id);
|
||||
// printk("%llu cycles charged to %s/%u", charge,
|
||||
// self->tr_parent->t_name, self->tr_parent->t_id);
|
||||
}
|
||||
|
||||
cycles_t default_quantum(void)
|
||||
|
||||
Reference in New Issue
Block a user