/DragonOS-0.1.2/kernel/src/process/ |
D | process.rs | 16 pub extern "C" fn process_is_stopped(pcb: *const process_control_block) -> bool { in process_is_stopped() 17 let state: u64 = unsafe { read_volatile(&(*pcb).state) } as u64; in process_is_stopped() 43 let pcb = unsafe { _pcb.as_mut() }.unwrap(); in process_try_to_wake_up() localVariable 48 write_volatile(&mut pcb.state, PROC_RUNNING as u64); in process_try_to_wake_up() 57 if unsafe { read_volatile(&pcb.state) } & _state != 0 { in process_try_to_wake_up() 60 write_volatile(&mut pcb.state, PROC_RUNNING as u64); in process_try_to_wake_up() 61 sched_enqueue(pcb); in process_try_to_wake_up() 75 pub extern "C" fn process_wake_up_state(pcb: *mut process_control_block, state: u64) -> bool { in process_wake_up_state() 76 return process_try_to_wake_up(pcb, state, 0); in process_wake_up_state() 81 pub fn process_kick(pcb: *mut process_control_block) { in process_kick() [all …]
|
D | kthread.c | 44 struct kthread_info_t *to_kthread(struct process_control_block *pcb) in to_kthread() argument 46 WARN_ON(!(pcb->flags & PF_KTHREAD)); in to_kthread() 47 return pcb->worker_private; in to_kthread() 53 struct process_control_block *pcb = NULL; in __kthread_create_on_node() local 82 pcb = create->result; in __kthread_create_on_node() 94 struct kthread_info_t *kthread = to_kthread(pcb); in __kthread_create_on_node() 100 process_set_pcb_name(pcb, pcb_name); in __kthread_create_on_node() 105 return pcb; in __kthread_create_on_node() 140 struct process_control_block *pcb; in kthread_create_on_node() local 143 pcb = __kthread_create_on_node(thread_fn, data, node, name_fmt, args); in kthread_create_on_node() [all …]
|
D | process.c | 50 extern void process_exit_sighand(struct process_control_block *pcb); 51 extern void process_exit_signal(struct process_control_block *pcb); 52 extern void initial_proc_init_signal(struct process_control_block *pcb); 76 __attribute__((__section__(".data.init_proc_union"))) = {INITIAL_PROC(initial_proc_union.pcb)}; 78 struct process_control_block *initial_proc[MAX_CPU_NUM] = {&initial_proc_union.pcb, 0}; 89 uint64_t process_exit_files(struct process_control_block *pcb); 97 uint64_t process_exit_mm(struct process_control_block *pcb); 546 struct process_control_block *pcb = current_pcb; in process_do_exit() local 549 process_exit_files(pcb); in process_do_exit() 550 process_exit_thread(pcb); in process_do_exit() [all …]
|
D | fork.c | 12 int process_copy_files(uint64_t clone_flags, struct process_control_block *pcb); 13 int process_copy_flags(uint64_t clone_flags, struct process_control_block *pcb); 14 int process_copy_mm(uint64_t clone_flags, struct process_control_block *pcb); 15 int process_copy_thread(uint64_t clone_flags, struct process_control_block *pcb, uint64_t stack_sta… 18 extern int process_copy_sighand(uint64_t clone_flags, struct process_control_block *pcb); 19 extern int process_copy_signal(uint64_t clone_flags, struct process_control_block *pcb); 20 extern void process_exit_sighand(struct process_control_block *pcb); 21 extern void process_exit_signal(struct process_control_block *pcb); 81 tsk->prev_pcb = &initial_proc_union.pcb; in do_fork() 83 tsk->next_pcb = initial_proc_union.pcb.next_pcb; in do_fork() [all …]
|
D | process.h | 25 extern void process_exit_thread(struct process_control_block *pcb); 26 extern uint64_t process_exit_files(struct process_control_block *pcb); 106 int process_wakeup(struct process_control_block *pcb); 113 int process_wakeup_immediately(struct process_control_block *pcb); 132 uint64_t process_exit_mm(struct process_control_block *pcb); 161 int process_release_pcb(struct process_control_block *pcb); 195 void process_set_pcb_name(struct process_control_block *pcb, const char *pcb_name); 206 extern bool process_is_stopped(struct process_control_block *pcb); 222 extern int process_wake_up_state(struct process_control_block *pcb, uint64_t state);
|
D | initial_proc.rs | 28 pub extern "C" fn initial_proc_init_signal(pcb: *mut process_control_block) { in initial_proc_init_signal() 31 assert_eq!(unsafe { (*pcb).pid }, 0); in initial_proc_init_signal() 35 (*pcb).sighand = &mut INITIAL_SIGHAND as *mut sighand_struct as usize in initial_proc_init_signal() 37 (*pcb).signal = &mut INITIAL_SIGNALS as *mut signal_struct as usize in initial_proc_init_signal() 42 (*pcb).sig_pending.signal = 0; in initial_proc_init_signal() 43 (*pcb).sig_pending.sigqueue = in initial_proc_init_signal()
|
D | fork.rs | 23 pub extern "C" fn process_copy_sighand(clone_flags: u64, pcb: *mut process_control_block) -> i32 { in process_copy_sighand() 39 (*pcb).sighand = sig as *mut sighand_struct as usize in process_copy_sighand() 73 flush_signal_handlers(pcb, false); in process_copy_sighand() 82 pub extern "C" fn process_copy_signal(clone_flags: u64, pcb: *mut process_control_block) -> i32 { in process_copy_signal() 95 (*pcb).signal = sig as *mut signal_struct as usize in process_copy_signal() 101 (*pcb).sig_pending.signal = 0; in process_copy_signal() 102 (*pcb).sig_pending.sigqueue = in process_copy_signal() 109 pub extern "C" fn process_exit_signal(pcb: *mut process_control_block) { in process_exit_signal() 113 let sighand = Box::from_raw((*pcb).sighand as *mut sighand_struct); in process_exit_signal() 116 (*pcb).sighand = 0 as *mut crate::include::bindings::bindings::sighand_struct; in process_exit_signal() [all …]
|
/DragonOS-0.1.2/docs/kernel/process_management/ |
D | pcb.md | 11 ### 根据pid寻找pcb 15 该API提供了根据pid寻找pcb的功能,定义在`kernel/src/process/process.h`中。 17 当找到目标的pcb时,返回对应的pcb,否则返回NULL。 27 目标pcb
|
D | kthread.md | 13 …ead_stop()`函数。该函数将会置位内核线程的`worker_private`中的`KTHREAD_SHOULD_STOP`标志位,并等待内核线程的退出,然后获得返回值并清理内核线程的pcb。 51   创建好的内核线程的pcb 71   `int kthread_stop(struct process_control_block * pcb)` 79 **pcb** 81   内核线程的pcb
|
D | index.rst | 8 pcb
|
/DragonOS-0.1.2/kernel/src/libs/ |
D | wait_queue_head.c | 24 BUG_ON(wait->pcb == NULL); in wait_queue_sleep_with_node() 26 wait->pcb->state = PROC_UNINTERRUPTIBLE; in wait_queue_sleep_with_node() 39 BUG_ON(wait->pcb == NULL); in wait_queue_sleep_with_node_unlock() 41 wait->pcb->state = PROC_UNINTERRUPTIBLE; in wait_queue_sleep_with_node_unlock() 55 BUG_ON(wait->pcb == NULL); in wait_queue_sleep_with_node_interriptible() 57 wait->pcb->state = PROC_INTERRUPTIBLE; in wait_queue_sleep_with_node_interriptible() 77 if (wait->pcb->state & state) in wait_queue_wakeup_on_stack() 80 process_wakeup(wait->pcb); in wait_queue_wakeup_on_stack()
|
D | wait_queue.c | 13 void wait_queue_init(wait_queue_node_t *wait_queue, struct process_control_block *pcb) in wait_queue_init() argument 16 wait_queue->pcb = pcb; in wait_queue_init() 78 if (wait->pcb->state & state) in wait_queue_wakeup() 81 process_wakeup(wait->pcb); in wait_queue_wakeup()
|
D | semaphore.c | 37 wq->pcb->state = PROC_RUNNING; in semaphore_up() 38 sched_enqueue(wq->pcb); in semaphore_up()
|
D | mutex.c | 48 waiter->pcb = current_pcb; in mutex_lock() 91 process_wakeup(wt->pcb); in mutex_unlock()
|
/DragonOS-0.1.2/kernel/src/common/ |
D | wait_queue.h | 15 struct process_control_block *pcb; member 24 void wait_queue_init(wait_queue_node_t *wait_queue, struct process_control_block *pcb); 60 #define DECLARE_WAIT_ON_STACK(name, pcb) \ argument 62 wait_queue_init(&(name), pcb); 68 #define DECLARE_WAIT_ALLOC(name, pcb) \ argument 70 wait_queue_init(&(name), pcb);
|
D | kthread.h | 63 int kthread_stop(struct process_control_block * pcb); 93 bool kthread_set_worker_private(struct process_control_block *pcb); 101 struct kthread_info_t *to_kthread(struct process_control_block *pcb); 108 void free_kthread_struct(struct process_control_block *pcb);
|
D | mutex.h | 31 struct process_control_block *pcb; member
|
/DragonOS-0.1.2/kernel/src/ipc/ |
D | signal.rs | 116 let pcb = unsafe { process_find_pcb_by_pid(pid).as_mut() }; in signal_kill_proc_info() localVariable 118 if pcb.is_none() { in signal_kill_proc_info() 126 retval = signal_send_sig_info(sig, info, pcb.unwrap()); in signal_kill_proc_info() 179 pcb: &'a mut process_control_block, in lock_process_sighand() 184 let sighand_ptr = sighand_struct::convert_mut(unsafe { &mut *pcb.sighand }); in lock_process_sighand() 187 kBUG!("Sighand ptr of process {pid} is NULL!", pid = pcb.pid); in lock_process_sighand() 194 let ret = unsafe { ((*pcb).sighand as *mut sighand_struct).as_mut() }; in lock_process_sighand() 202 fn unlock_process_sighand(pcb: &mut process_control_block, flags: u64) { in unlock_process_sighand() 203 let lock = unsafe { &mut (*pcb.sighand).siglock }; in unlock_process_sighand() 215 pcb: &mut process_control_block, in send_signal_locked() [all …]
|
/DragonOS-0.1.2/docs/kernel/sched/ |
D | waiting.md | 29 struct process_control_block *pcb; 43   函数`wait_queue_init(wait_queue_node_t *wait_queue, struct process_control_block *pcb)`提供… 91 | DECLARE_WAIT_ON_STACK(name, pcb) | 在栈上声明一个wait_queue节点,同时把pcb所代表的进程与该节点绑定 | 93 | DECLARE_WAIT_ALLOC(name, pcb) | 使用`kzalloc`声明一个wait_queue节点,同时把pcb所代表的进程与该节点绑定,请记得使用kfree释放空间 | 115 …eue_head_t *q, wait_queue_node_t *wait, void *lock) | 传入一个等待队列节点,将该节点的pcb指向的进程挂起,并设置挂起状态为PROC… 116 …rriptible(wait_queue_head_t *q, wait_queue_node_t *wait) | 传入一个等待队列节点,将该节点的pcb指向的进程挂起,并设置挂起状态为PROC…
|
/DragonOS-0.1.2/kernel/src/sched/ |
D | cfs.c | 18 return &initial_proc_union.pcb; in sched_cfs_dequeue() 33 void sched_cfs_enqueue(struct process_control_block *pcb) in sched_cfs_enqueue() argument 35 if (pcb == initial_proc[proc_current_cpu_id]) in sched_cfs_enqueue() 40 while (proc->virtual_runtime < pcb->virtual_runtime) in sched_cfs_enqueue() 45 list_append(&proc->list, &pcb->list); in sched_cfs_enqueue()
|
D | sched.c | 57 void sched_enqueue(struct process_control_block *pcb) in sched_enqueue() argument 59 sched_cfs_enqueue(pcb); in sched_enqueue()
|
D | cfs.h | 27 void sched_cfs_enqueue(struct process_control_block *pcb);
|
D | sched.h | 65 void sched_enqueue(struct process_control_block *pcb);
|
/DragonOS-0.1.2/kernel/src/time/ |
D | sleep.c | 15 void nanosleep_handler(void *pcb) in nanosleep_handler() argument 17 process_wakeup((struct process_control_block *)pcb); in nanosleep_handler()
|
D | timer.c | 141 static void __wake_up_helper(void *pcb) in __wake_up_helper() argument 143 BUG_ON(pcb == NULL); in __wake_up_helper() 145 BUG_ON(process_wakeup((struct process_control_block *)pcb) != 0); // 正常唤醒,返回值为0 in __wake_up_helper()
|