Skip to content

Commit 7a7e674

Browse files
committed
added task kill
1 parent 8ba8ce6 commit 7a7e674

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

kernel/task/task.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ void gammaos_first_ever_task(){
111111

112112
/**==========================================================================*/
113113

114+
void task_kill(struct task* _task){
115+
destroy_virtual_address_space(_task->task_space);
116+
task_list_delete(_task);
117+
kfree(_task);
118+
}
114119
void current_task_save_state(struct interrupt_frame* iframe){
115120

116121
if(!cur_task){

kernel/task/task.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ struct task* new_task(struct process* _process);
5050
struct task* next_task();
5151
int8_t close_task(struct task* _task);
5252

53+
void task_kill(struct task* _task);
5354
void task_switch(struct task* _task);
5455
void enter_task(struct reg* registers);
5556
void restore_gprs(struct reg* registers);

0 commit comments

Comments
 (0)