Skip to content

Commit a941e00

Browse files
committed
task: refactor sched_{en,de}queue to task_...
No functional change yet. Use this chance to hide dequeuing. No need to export it. Signed-off-by: Ralf Ramsauer <[email protected]>
1 parent 94db4bb commit a941e00

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

arch/riscv/vmm/vmm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ SYSCALL_DEF0(grinch_create_grinch_vm)
500500

501501
task->regs.pc = VM_GPHYS_BASE;
502502
task->state = TASK_RUNNABLE;
503-
sched_enqueue(task);
503+
task_enqueue(task);
504504

505505
return task->pid;
506506
}

include/grinch/task.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ void arch_vmachine_restore(struct vmachine *vm);
147147
int task_init(void);
148148

149149
void prepare_user_return(void);
150-
void sched_enqueue(struct task *task);
151-
void sched_dequeue(struct task *task);
150+
151+
void task_enqueue(struct task *task);
152152

153153
/* invoke scheduler on all CPUs */
154154
void sched_all(void);

kernel/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static int __init init(void)
125125

126126
init_task = task;
127127

128-
sched_enqueue(task);
128+
task_enqueue(task);
129129

130130
return 0;
131131

kernel/task.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ static DEFINE_SPINLOCK(task_lock);
3333

3434
static atomic_t next_pid = ATOMIC_INIT(1);
3535

36-
void sched_dequeue(struct task *task)
36+
static void task_dequeue(struct task *task)
3737
{
3838
spin_lock(&task_lock);
3939
list_del(&task->tasks);
4040
spin_unlock(&task_lock);
4141
}
4242

43-
void sched_enqueue(struct task *task)
43+
void task_enqueue(struct task *task)
4444
{
4545
spin_lock(&task_lock);
4646
list_add(&task->tasks, &task_list);
@@ -190,7 +190,7 @@ void task_exit(struct task *task, int code)
190190
* scheduler list
191191
*/
192192
if (!list_empty(&task->tasks))
193-
sched_dequeue(task);
193+
task_dequeue(task);
194194

195195
/* Take the parent's lock first to prevent deadlock situations */
196196
spin_lock(&parent->lock);
@@ -465,7 +465,7 @@ SYSCALL_DEF0(fork)
465465
spin_unlock(&this->lock);
466466
spin_unlock(&new->lock);
467467

468-
sched_enqueue(new);
468+
task_enqueue(new);
469469
sched_all();
470470

471471
return new->pid;

0 commit comments

Comments
 (0)