Skip to content

Commit cb24d63

Browse files
author
Yuma Arakawa
committed
sched: task_listをtask_instance_tableへ改名
task_listはstruct taskのリスト構造の汎用的な名前として使用するため
1 parent 7fcb254 commit cb24d63

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

kernel/include/sched.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct task {
2424
unsigned char wakeup_after_event;
2525
};
2626

27-
extern struct task task_list[TASK_NUM];
27+
extern struct task task_instance_table[TASK_NUM];
2828
extern unsigned char context_switch_template[CONTEXT_SWITCH_FN_SIZE];
2929

3030
unsigned short sched_get_current(void);

kernel/kern_task_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ void kern_task_init(void)
2525
__asm__("ltr %0"::"r"(segment_selector));
2626

2727
/* Setup context switch function */
28-
task_list[KERN_TASK_ID].context_switch = kern_task_context_switch;
28+
task_instance_table[KERN_TASK_ID].context_switch = kern_task_context_switch;
2929
}

kernel/main.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -137,32 +137,32 @@ static void task_init(unsigned short task_id,
137137
}
138138

139139
/* Setup task_id */
140-
task_list[task_id].task_id = task_id;
140+
task_instance_table[task_id].task_id = task_id;
141141

142142
/* Setup context switch function */
143-
copy_mem(context_switch_template, task_list[task_id].context_switch_func, CONTEXT_SWITCH_FN_SIZE);
144-
task_list[task_id].context_switch_func[CONTEXT_SWITCH_FN_TSKNO_FIELD] = 8 * (task_id - 1) + 0x20;
145-
task_list[task_id].context_switch = (void (*)(void))task_list[task_id].context_switch_func;
143+
copy_mem(context_switch_template, task_instance_table[task_id].context_switch_func, CONTEXT_SWITCH_FN_SIZE);
144+
task_instance_table[task_id].context_switch_func[CONTEXT_SWITCH_FN_TSKNO_FIELD] = 8 * (task_id - 1) + 0x20;
145+
task_instance_table[task_id].context_switch = (void (*)(void))task_instance_table[task_id].context_switch_func;
146146

147147
/* Setup GDT for task_tss */
148-
init_gdt(task_id + GDT_IDX_OFS, (unsigned int)&task_list[task_id].tss, sizeof(struct tss), 3);
148+
init_gdt(task_id + GDT_IDX_OFS, (unsigned int)&task_instance_table[task_id].tss, sizeof(struct tss), 3);
149149

150150
/* Setup task_tss */
151-
task_list[task_id].tss.eip = APP_ENTRY_POINT;
152-
task_list[task_id].tss.esp = 0x20001800;
153-
task_list[task_id].tss.eflags = 0x00000200;
154-
task_list[task_id].tss.esp0 = APP_STACK_BASE;
155-
task_list[task_id].tss.ss0 = 0x0010;
156-
task_list[task_id].tss.es = 0x0038 | 0x0003;
157-
task_list[task_id].tss.cs = 0x0030 | 0x0003;
158-
task_list[task_id].tss.ss = 0x0038 | 0x0003;
159-
task_list[task_id].tss.ds = 0x0038 | 0x0003;
160-
task_list[task_id].tss.fs = 0x0038 | 0x0003;
161-
task_list[task_id].tss.gs = 0x0038 | 0x0003;
162-
task_list[task_id].tss.__cr3 = (unsigned int)pd_base_addr | 0x18;
151+
task_instance_table[task_id].tss.eip = APP_ENTRY_POINT;
152+
task_instance_table[task_id].tss.esp = 0x20001800;
153+
task_instance_table[task_id].tss.eflags = 0x00000200;
154+
task_instance_table[task_id].tss.esp0 = APP_STACK_BASE;
155+
task_instance_table[task_id].tss.ss0 = 0x0010;
156+
task_instance_table[task_id].tss.es = 0x0038 | 0x0003;
157+
task_instance_table[task_id].tss.cs = 0x0030 | 0x0003;
158+
task_instance_table[task_id].tss.ss = 0x0038 | 0x0003;
159+
task_instance_table[task_id].tss.ds = 0x0038 | 0x0003;
160+
task_instance_table[task_id].tss.fs = 0x0038 | 0x0003;
161+
task_instance_table[task_id].tss.gs = 0x0038 | 0x0003;
162+
task_instance_table[task_id].tss.__cr3 = (unsigned int)pd_base_addr | 0x18;
163163

164164
/* Add task to run_queue */
165-
sched_runq_enq(&task_list[task_id]);
165+
sched_runq_enq(&task_instance_table[task_id]);
166166
}
167167

168168
int main(void)

kernel/sched.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <kernel.h>
88
#include <kern_task.h>
99

10-
struct task task_list[TASK_NUM];
10+
struct task task_instance_table[TASK_NUM];
1111

1212
static struct task *current_task = NULL;
1313
static struct {
@@ -112,7 +112,7 @@ void schedule(unsigned char cause_id)
112112
current_task = NULL;
113113
outb_p(IOADR_MPIC_OCW2_BIT_MANUAL_EOI | INTR_IR_TIMER,
114114
IOADR_MPIC_OCW2);
115-
task_list[KERN_TASK_ID].context_switch();
115+
task_instance_table[KERN_TASK_ID].context_switch();
116116
}
117117
} else if (current_task) {
118118
if (current_task != current_task->next) {

0 commit comments

Comments
 (0)