improved comments

Signed-off-by: ablechen <17895010372@163.com>
Signed-off-by: Wang Chen <wangchen20@iscas.ac.cn>
This commit is contained in:
Wang Chen
2022-11-23 09:35:58 +08:00
parent cec375a5e6
commit 744226d09e
13 changed files with 38 additions and 18 deletions

View File

@@ -89,12 +89,16 @@
.align 4
switch_to:
csrrw t6, mscratch, t6 # swap t6 and mscratch
beqz t6, 1f # Notice: previous task may be NULL
beqz t6, 1f # Notice: the first time switch_to() is
# called, mscratch is initialized as zero
# (in sched_init()), which makes t6 zero,
# and that's the special case we have to
# handle with t6
reg_save t6 # save context of prev task
# Save the actual t6 register, which we swapped into
# mscratch
mv t5, t6 # t5 points to the context of current task
mv t5, t6 # t5 points to the context of next task
csrr t6, mscratch # read t6 back from mscratch
sw t6, 120(t5) # save t6 with t5 as base

View File

@@ -89,12 +89,16 @@
.align 4
switch_to:
csrrw t6, mscratch, t6 # swap t6 and mscratch
beqz t6, 1f # Notice: previous task may be NULL
beqz t6, 1f # Notice: the first time switch_to() is
# called, mscratch is initialized as zero
# (in sched_init()), which makes t6 zero,
# and that's the special case we have to
# handle with t6
reg_save t6 # save context of prev task
# Save the actual t6 register, which we swapped into
# mscratch
mv t5, t6 # t5 points to the context of current task
mv t5, t6 # t5 points to the context of next task
csrr t6, mscratch # read t6 back from mscratch
sw t6, 120(t5) # save t6 with t5 as base

View File

@@ -43,7 +43,7 @@ void schedule()
/*
* DESCRIPTION
* Create a task.
* - start_routin: task routune entry
* - start_routin: task routine entry
* RETURN VALUE
* 0: success
* -1: if error occured

View File

@@ -122,12 +122,16 @@ trap_vector:
.align 4
switch_to:
csrrw t6, mscratch, t6 # swap t6 and mscratch
beqz t6, 1f # Notice: previous task may be NULL
beqz t6, 1f # Notice: the first time switch_to() is
# called, mscratch is initialized as zero
# (in sched_init()), which makes t6 zero,
# and that's the special case we have to
# handle with t6
reg_save t6 # save context of prev task
# Save the actual t6 register, which we swapped into
# mscratch
mv t5, t6 # t5 points to the context of current task
mv t5, t6 # t5 points to the context of next task
csrr t6, mscratch # read t6 back from mscratch
sw t6, 120(t5) # save t6 with t5 as base

View File

@@ -38,7 +38,7 @@ void schedule()
/*
* DESCRIPTION
* Create a task.
* - start_routin: task routune entry
* - start_routin: task routine entry
* RETURN VALUE
* 0: success
* -1: if error occured

View File

@@ -122,12 +122,16 @@ trap_vector:
.align 4
switch_to:
csrrw t6, mscratch, t6 # swap t6 and mscratch
beqz t6, 1f # Notice: previous task may be NULL
beqz t6, 1f # Notice: the first time switch_to() is
# called, mscratch is initialized as zero
# (in sched_init()), which makes t6 zero,
# and that's the special case we have to
# handle with t6
reg_save t6 # save context of prev task
# Save the actual t6 register, which we swapped into
# mscratch
mv t5, t6 # t5 points to the context of current task
mv t5, t6 # t5 points to the context of next task
csrr t6, mscratch # read t6 back from mscratch
sw t6, 120(t5) # save t6 with t5 as base

View File

@@ -38,7 +38,7 @@ void schedule()
/*
* DESCRIPTION
* Create a task.
* - start_routin: task routune entry
* - start_routin: task routine entry
* RETURN VALUE
* 0: success
* -1: if error occured

View File

@@ -122,12 +122,16 @@ trap_vector:
.align 4
switch_to:
csrrw t6, mscratch, t6 # swap t6 and mscratch
beqz t6, 1f # Notice: previous task may be NULL
beqz t6, 1f # Notice: the first time switch_to() is
# called, mscratch is initialized as zero
# (in sched_init()), which makes t6 zero,
# and that's the special case we have to
# handle with t6
reg_save t6 # save context of prev task
# Save the actual t6 register, which we swapped into
# mscratch
mv t5, t6 # t5 points to the context of current task
mv t5, t6 # t5 points to the context of next task
csrr t6, mscratch # read t6 back from mscratch
sw t6, 120(t5) # save t6 with t5 as base

View File

@@ -38,7 +38,7 @@ void schedule()
/*
* DESCRIPTION
* Create a task.
* - start_routin: task routune entry
* - start_routin: task routine entry
* RETURN VALUE
* 0: success
* -1: if error occured

View File

@@ -41,7 +41,7 @@ void schedule()
/*
* DESCRIPTION
* Create a task.
* - start_routin: task routune entry
* - start_routin: task routine entry
* RETURN VALUE
* 0: success
* -1: if error occured

View File

@@ -41,7 +41,7 @@ void schedule()
/*
* DESCRIPTION
* Create a task.
* - start_routin: task routune entry
* - start_routin: task routine entry
* RETURN VALUE
* 0: success
* -1: if error occured

View File

@@ -41,7 +41,7 @@ void schedule()
/*
* DESCRIPTION
* Create a task.
* - start_routin: task routune entry
* - start_routin: task routine entry
* RETURN VALUE
* 0: success
* -1: if error occured

View File

@@ -41,7 +41,7 @@ void schedule()
/*
* DESCRIPTION
* Create a task.
* - start_routin: task routune entry
* - start_routin: task routine entry
* RETURN VALUE
* 0: success
* -1: if error occured