Home
last modified time | relevance | path

Searched refs:current_pcb (Results 1 – 25 of 46) sorted by relevance

12

/DragonOS-0.1.8/kernel/src/libs/
Dwait_queue.rs5 arch::{asm::current::current_pcb, sched::sched, CurrentIrqArch},
46 current_pcb().state = PROC_INTERRUPTIBLE as u64; in sleep()
47 guard.wait_list.push_back(current_pcb()); in sleep()
59 current_pcb().state = PROC_INTERRUPTIBLE as u64; in sleep_with_func()
60 guard.wait_list.push_back(current_pcb()); in sleep_with_func()
84 current_pcb().state = PROC_INTERRUPTIBLE as u64; in sleep_without_schedule()
85 guard.wait_list.push_back(current_pcb()); in sleep_without_schedule()
91 current_pcb().state = PROC_UNINTERRUPTIBLE as u64; in sleep_uninterruptible()
92 guard.wait_list.push_back(current_pcb()); in sleep_uninterruptible()
101 current_pcb().state = PROC_INTERRUPTIBLE as u64; in sleep_unlock_spinlock()
[all …]
Dwait_queue.c27 wait_queue_init(wait, current_pcb); in wait_queue_sleep_on()
28 current_pcb->state = PROC_UNINTERRUPTIBLE; in wait_queue_sleep_on()
43 wait_queue_init(wait, current_pcb); in wait_queue_sleep_on_unlock()
44 current_pcb->state = PROC_UNINTERRUPTIBLE; in wait_queue_sleep_on_unlock()
58 wait_queue_init(wait, current_pcb); in wait_queue_sleep_on_interriptible()
59 current_pcb->state = PROC_INTERRUPTIBLE; in wait_queue_sleep_on_interriptible()
Dsemaphore.c14 wait_queue_init(&wait, current_pcb); in semaphore_down()
16 current_pcb->state = PROC_UNINTERRUPTIBLE; in semaphore_down()
21 current_pcb->flags |= PF_NEED_SCHED; in semaphore_down()
Dmutex.rs9 arch::{asm::current::current_pcb, sched::sched},
68 if self.check_pid_in_wait_list(&inner, current_pcb().pid) == false { in lock()
69 inner.wait_list.push_back(current_pcb()); in lock()
107 current_pcb().state &= !(PROC_RUNNING as u64); in __sleep()
108 current_pcb().state |= PROC_INTERRUPTIBLE as u64; in __sleep()
Dmutex.c19 current_pcb->state = PROC_UNINTERRUPTIBLE; in __mutex_sleep()
20 current_pcb->flags |= PF_NEED_SCHED; in __mutex_sleep()
49 waiter->pcb = current_pcb; in mutex_lock()
Dsemaphore.rs3 use crate::{arch::asm::current::current_pcb, kdebug, syscall::SystemError};
54 current_pcb().pid, in up()
/DragonOS-0.1.8/kernel/src/smp/
Dsmp.c147 kdebug("init proc's preempt_count=%ld", current_pcb->preempt_count); in smp_init()
172 memset(current_pcb, 0, sizeof(struct process_control_block)); in smp_ap_start()
175 current_pcb->state = PROC_RUNNING; in smp_ap_start()
176 current_pcb->flags = PF_KTHREAD; in smp_ap_start()
177 current_pcb->address_space = NULL; in smp_ap_start()
180 list_init(&current_pcb->list); in smp_ap_start()
181 current_pcb->addr_limit = KERNEL_BASE_LINEAR_ADDR; in smp_ap_start()
182 current_pcb->priority = 2; in smp_ap_start()
183 current_pcb->virtual_runtime = 0; in smp_ap_start()
185 current_pcb->thread = (struct thread_struct *)(current_pcb + 1); // 将线程结构体放置在pcb后方 in smp_ap_start()
[all …]
Dmod.rs2 arch::{asm::current::current_pcb, interrupt::ipi::send_ipi},
20 current_pcb().set_address_space(INITIAL_PROCESS_ADDRESS_SPACE()); in init_smp_idle_process()
/DragonOS-0.1.8/kernel/src/exception/
Dtrap.c16 regs->rsp, regs->rip, proc_current_cpu_id, current_pcb->pid); in do_divide_error()
18 current_pcb->state = PROC_STOPPED; in do_divide_error()
28 proc_current_cpu_id, current_pcb->pid); in do_debug()
69 current_pcb->state = PROC_STOPPED; in do_overflow()
89 regs->rsp, regs->rip, proc_current_cpu_id, current_pcb->pid); in do_undefined_opcode()
91 current_pcb->state = PROC_STOPPED; in do_undefined_opcode()
100 regs->rip, proc_current_cpu_id, current_pcb->pid); in do_dev_not_avaliable()
102 current_pcb->state = PROC_STOPPED; in do_dev_not_avaliable()
115 current_pcb->state = PROC_STOPPED; in do_double_fault()
126 current_pcb->state = PROC_STOPPED; in do_coprocessor_segment_overrun()
[all …]
/DragonOS-0.1.8/kernel/src/process/
Dprocess.c178 kinfo("initial proc running...\targ:%#018lx, vruntime=%d", arg, current_pcb->virtual_runtime); in initial_kernel_thread()
205 current_pcb->thread->rip = (ul)ret_from_intr; in initial_kernel_thread()
206 current_pcb->thread->rsp = (ul)current_pcb + STACK_SIZE - sizeof(struct pt_regs); in initial_kernel_thread()
207 current_pcb->thread->fs = USER_DS | 0x3; in initial_kernel_thread()
209 current_pcb->thread->gs = USER_DS | 0x3; in initial_kernel_thread()
210 process_switch_fsgs(current_pcb->thread->fs, current_pcb->thread->gs); in initial_kernel_thread()
213 current_pcb->flags &= (~PF_KTHREAD); in initial_kernel_thread()
214 kdebug("in initial_kernel_thread: flags=%ld", current_pcb->flags); in initial_kernel_thread()
216 regs = (struct pt_regs *)current_pcb->thread->rsp; in initial_kernel_thread()
218 current_pcb->flags = 0; in initial_kernel_thread()
[all …]
Dpreempt.rs1 use crate::arch::asm::current::current_pcb;
6 current_pcb().preempt_count += 1; in preempt_disable()
12 current_pcb().preempt_count -= 1; in preempt_enable()
Dpreempt.h14 ++(current_pcb->preempt_count);\
24 --(current_pcb->preempt_count);\
Dmod.rs7 arch::asm::current::current_pcb,
27 current_pcb().address_space = null_mut(); in process_init()
35 current_pcb().set_address_space(INITIAL_PROCESS_ADDRESS_SPACE()); in process_init()
Dkthread.c116 struct kthread_info_t *kt = to_kthread(current_pcb); in kthread_exit()
163 struct kthread_info_t *self = to_kthread(current_pcb); in kthread()
172 current_pcb->state = PROC_UNINTERRUPTIBLE; in kthread()
175 create->result = current_pcb; in kthread()
177 current_pcb->state &= ~PROC_RUNNING; // 设置当前进程不是RUNNING态 in kthread()
216 struct process_control_block *pcb = current_pcb; in kthreadd()
218 kthreadd_pcb = current_pcb; in kthreadd()
220 current_pcb->flags |= PF_NOFREEZE; in kthreadd()
224 current_pcb->state = PROC_INTERRUPTIBLE; in kthreadd()
261 struct kthread_info_t *self = to_kthread(current_pcb); in kthread_should_stop()
Dc_adapter.rs6 arch::{asm::current::current_pcb, fpu::FpState},
29 let r = current_pcb().init_files(); in process_init_files()
54 let r = current_pcb().copy_files(clone_flags, from); in process_copy_files()
82 if current_pcb().fp_state == null_mut() { in rs_dup_fpstate()
86 let state = current_pcb().fp_state as usize as *mut FpState; in rs_dup_fpstate()
Dfork.rs6 arch::asm::current::current_pcb,
28 let r = RefCount::convert_mut(unsafe { &mut (*(current_pcb().sighand)).count }).unwrap(); in process_copy_sighand()
49 spin_lock_irqsave(unsafe { &mut (*current_pcb().sighand).siglock }, &mut flags); in process_copy_sighand()
52 for (index, x) in unsafe { (*current_pcb().sighand).action } in process_copy_sighand()
67 spin_unlock_irqrestore(unsafe { &mut (*current_pcb().sighand).siglock }, flags); in process_copy_sighand()
152 let old_address_space = current_pcb() in copy_mm()
164 current_pcb().pid, new_pcb.pid, e in copy_mm()
Dprocess.rs10 arch::asm::current::current_pcb,
61 if current_pcb() as *mut process_control_block as usize == _pcb as usize { in process_try_to_wake_up()
192 if let Some(f) = FileDescriptorVec::from_pcb(current_pcb()) { in alloc_fd()
197 let r: Option<&mut FileDescriptorVec> = FileDescriptorVec::from_pcb(current_pcb()); in alloc_fd()
239 let r: &mut FileDescriptorVec = FileDescriptorVec::from_pcb(current_pcb()).unwrap(); in get_file_mut_by_fd()
253 let r: &mut FileDescriptorVec = FileDescriptorVec::from_pcb(current_pcb()).unwrap(); in get_file_ref_by_fd()
265 let r: &mut FileDescriptorVec = FileDescriptorVec::from_pcb(current_pcb()).unwrap(); in drop_fd()
353 if current_pcb().pid != 1 { in init_stdio()
369 assert_eq!(current_pcb().alloc_fd(stdin, None).unwrap(), 0); in init_stdio()
370 assert_eq!(current_pcb().alloc_fd(stdout, None).unwrap(), 1); in init_stdio()
[all …]
Dfork.c55 memcpy(tsk, current_pcb, sizeof(struct process_control_block)); in do_fork()
64 if ((current_pcb->flags & PF_KTHREAD) && stack_start != 0) in do_fork()
90 tsk->parent_pcb = current_pcb; in do_fork()
98 tsk->parent_pcb = current_pcb; in do_fork()
205 uint64_t old_top = (uint64_t)(current_pcb) + STACK_SIZE; in process_rewrite_rbp()
255 uint32_t size = ((uint64_t)current_pcb) + STACK_SIZE - (uint64_t)(current_regs); in process_copy_thread()
281 thd->fs = current_pcb->thread->fs; in process_copy_thread()
282 thd->gs = current_pcb->thread->gs; in process_copy_thread()
/DragonOS-0.1.8/kernel/src/sched/
Dcfs.rs6 arch::asm::current::current_pcb,
143 let current_cpu_queue: &mut CFSQueue = self.cpu_queue[current_pcb().cpu_id as usize]; in timer_update_jiffies()
151 current_pcb().flags |= PF_NEED_SCHED as u64; in timer_update_jiffies()
156 current_pcb().virtual_runtime += 1; in timer_update_jiffies()
184 current_pcb().flags &= !(PF_NEED_SCHED as u64); in sched()
194 if (current_pcb().state & (PROC_RUNNING as u64)) == 0 in sched()
195 || current_pcb().virtual_runtime >= proc.virtual_runtime in sched()
199 if current_pcb().state & (PROC_RUNNING as u64) != 0 { in sched()
200 sched_enqueue(current_pcb(), false); in sched()
Dsyscall.rs2 arch::{asm::current::current_pcb, context::switch_process, CurrentIrqArch},
24 switch_process(current_pcb(), pcb.unwrap()); in sched()
Drt.rs6 arch::asm::current::current_pcb,
170 current_pcb().flags &= !(PF_NEED_SCHED as u64); in sched()
172 let cpu_id = current_pcb().cpu_id; in sched()
179 if proc.priority <= current_pcb().priority { in sched()
183 sched_enqueue(current_pcb(), false); in sched()
191 if proc.priority >= current_pcb().priority { in sched()
201 sched_enqueue(current_pcb(), false); in sched()
Dcore.rs4 arch::asm::current::current_pcb,
23 if cpu_id == process_cpu(current_pcb()) { in cpu_executing()
24 return current_pcb(); in cpu_executing()
82 match rt_scheduler.pick_next_task_rt(current_pcb().cpu_id) { in do_sched()
157 match current_pcb().policy { in sched_update_jiffies()
162 current_pcb().rt_time_slice -= 1; in sched_update_jiffies()
/DragonOS-0.1.8/kernel/src/ipc/
Dsignal.rs10 asm::{bitops::ffz, current::current_pcb, ptrace::user_mode},
245 q._sinfo.data._sifields._kill._pid = current_pcb().pid; in __send_signal_locked()
249 let sq: &mut SigQueue = SigQueue::from_c_void(current_pcb().sig_pending.sigqueue); in __send_signal_locked()
392 if current_pcb().sig_pending.signal == 0 || (!user_mode(regs)) { in do_signal()
401 let oldset = current_pcb().sig_blocked; in do_signal()
411 current_pcb().pid in do_signal()
418 current_pcb().pid, in do_signal()
439 let _tmp = sighand_struct::convert_mut(current_pcb().sighand); in get_signal_to_deliver()
443 panic!("Sighand is NULL! pid={}", current_pcb().pid); in get_signal_to_deliver()
450 dequeue_signal(sigset_t::convert_mut(&mut current_pcb().sig_blocked).unwrap()); in get_signal_to_deliver()
[all …]
/DragonOS-0.1.8/kernel/src/filesystem/vfs/
Dsyscall.rs4 arch::asm::current::current_pcb,
184 let r = current_pcb().alloc_fd(file, None).map(|fd| fd as usize); in open()
196 return current_pcb().drop_fd(fd as i32).map(|_| 0); in close()
208 let file: Option<&mut File> = current_pcb().get_file_mut_by_fd(fd); in read()
226 let file: Option<&mut File> = current_pcb().get_file_mut_by_fd(fd); in write()
244 let file: Option<&mut File> = current_pcb().get_file_mut_by_fd(fd); in lseek()
317 let file: &mut File = match current_pcb().get_file_mut_by_fd(fd) { in getdents()
378 if let Some(fds) = FileDescriptorVec::from_pcb(current_pcb()) { in dup()
387 let res = current_pcb().alloc_fd(*file_cp, None).map(|x| x as usize); in dup()
413 if let Some(fds) = FileDescriptorVec::from_pcb(current_pcb()) { in dup2()
[all …]
/DragonOS-0.1.8/kernel/src/time/
Dsleep.rs6 arch::{asm::current::current_pcb, sched::sched, CurrentIrqArch},
42 let handler: Box<WakeUpHelper> = WakeUpHelper::new(current_pcb()); in nanosleep()
52 current_pcb().mark_sleep_interruptible(); in nanosleep()

12