/DragonOS-0.1.2/kernel/src/smp/ |
D | smp.c | 133 kdebug("init proc's preempt_count=%ld", current_pcb->preempt_count); in smp_init() 156 memset(current_pcb, 0, sizeof(struct process_control_block)); in smp_ap_start() 159 current_pcb->state = PROC_RUNNING; in smp_ap_start() 160 current_pcb->flags = PF_KTHREAD; in smp_ap_start() 161 current_pcb->mm = &initial_mm; in smp_ap_start() 163 list_init(¤t_pcb->list); in smp_ap_start() 164 current_pcb->addr_limit = KERNEL_BASE_LINEAR_ADDR; in smp_ap_start() 165 current_pcb->priority = 2; in smp_ap_start() 166 current_pcb->virtual_runtime = 0; in smp_ap_start() 168 current_pcb->thread = (struct thread_struct *)(current_pcb + 1); // 将线程结构体放置在pcb后方 in smp_ap_start() [all …]
|
/DragonOS-0.1.2/kernel/src/sched/ |
D | cfs.c | 58 current_pcb->flags &= ~PF_NEED_SCHED; in sched_cfs() 62 …if (current_pcb->virtual_runtime >= proc->virtual_runtime || !(current_pcb->state & PROC_RUNNING))… in sched_cfs() 66 if (current_pcb->state & PROC_RUNNING) // 本次切换由于时间片到期引发,则再次加入就绪队列,否则交由其它功能模块进行管理 in sched_cfs() 67 sched_cfs_enqueue(current_pcb); in sched_cfs() 86 switch_proc(current_pcb, proc); in sched_cfs() 120 switch (current_pcb->priority) in sched_update_jiffies() 125 ++current_pcb->virtual_runtime; in sched_update_jiffies() 130 current_pcb->virtual_runtime += 2; in sched_update_jiffies() 135 current_pcb->flags |= PF_NEED_SCHED; in sched_update_jiffies()
|
D | core.rs | 1 …gs::process_control_block, process::process::process_cpu, arch::x86_64::asm::current::current_pcb}; 8 if cpu_id == process_cpu(current_pcb()){ in cpu_executing() 9 return current_pcb(); in cpu_executing()
|
/DragonOS-0.1.2/kernel/src/process/ |
D | preempt.rs | 1 use crate::arch::x86_64::asm::current::current_pcb; 6 current_pcb().preempt_count += 1; in preempt_disable() 12 current_pcb().preempt_count -= 1; in preempt_enable()
|
D | process.c | 216 current_pcb->mm->code_addr_start = ehdr.e_entry; in process_load_elf_file() 266 … mm_create_vma(current_pcb->mm, virt_base, PAGE_2M_SIZE, VM_USER | VM_ACCESS_FLAGS, NULL, &vma); in process_load_elf_file() 272 mm_map(current_pcb->mm, virt_base, PAGE_2M_SIZE, pa); in process_load_elf_file() 288 … int val = mm_create_vma(current_pcb->mm, virt_base + off, PAGE_4K_SIZE, VM_USER | VM_ACCESS_FLAGS, in process_load_elf_file() 294 mm_map(current_pcb->mm, virt_base + off, PAGE_4K_SIZE, paddr); in process_load_elf_file() 319 regs->rsp = current_pcb->mm->stack_start; in process_load_elf_file() 320 regs->rbp = current_pcb->mm->stack_start; in process_load_elf_file() 325 …int val = mm_create_vma(current_pcb->mm, current_pcb->mm->stack_start - PAGE_2M_SIZE, PAGE_2M_SIZE, in process_load_elf_file() 334 memset((void *)(current_pcb->mm->stack_start - PAGE_2M_SIZE), 0, PAGE_2M_SIZE); in process_load_elf_file() 359 if (current_pcb->flags & PF_VFORK) in do_execve() [all …]
|
D | preempt.h | 14 ++(current_pcb->preempt_count);\ 24 --(current_pcb->preempt_count);\
|
D | kthread.c | 115 struct kthread_info_t *kt = to_kthread(current_pcb); in kthread_exit() 162 struct kthread_info_t *self = to_kthread(current_pcb); in kthread() 171 current_pcb->state = PROC_UNINTERRUPTIBLE; in kthread() 174 create->result = current_pcb; in kthread() 176 current_pcb->state &= ~PROC_RUNNING; // 设置当前进程不是RUNNING态 in kthread() 212 struct process_control_block *pcb = current_pcb; in kthreadd() 213 kthreadd_pcb = current_pcb; in kthreadd() 214 current_pcb->flags |= PF_NOFREEZE; in kthreadd() 218 current_pcb->state = PROC_INTERRUPTIBLE; in kthreadd() 250 struct kthread_info_t *self = to_kthread(current_pcb); in kthread_should_stop()
|
D | fork.c | 52 memcpy(tsk, current_pcb, sizeof(struct process_control_block)); in do_fork() 61 if ((current_pcb->flags & PF_KTHREAD) && stack_start != 0) in do_fork() 87 tsk->parent_pcb = current_pcb; in do_fork() 95 tsk->parent_pcb = current_pcb; in do_fork() 194 if (current_pcb->fds[i] == NULL) in process_copy_files() 198 memcpy(pcb->fds[i], current_pcb->fds[i], sizeof(struct vfs_file_t)); in process_copy_files() 217 pcb->mm = current_pcb->mm; in process_copy_mm() 226 memcpy(new_mms, current_pcb->mm, sizeof(struct mm_struct)); in process_copy_mm() 239 uint64_t *current_pgd = (uint64_t *)phys_2_virt(current_pcb->mm->pgd); in process_copy_mm() 244 struct vm_area_struct *vma = current_pcb->mm->vmas; in process_copy_mm() [all …]
|
D | fork.rs | 6 arch::x86_64::asm::current::current_pcb, 27 let r = RefCount::convert_mut(unsafe { &mut (*(current_pcb().sighand)).count }).unwrap(); in process_copy_sighand() 48 spin_lock_irqsave(unsafe { &mut (*current_pcb().sighand).siglock }, &mut flags); in process_copy_sighand() 51 for (index, x) in unsafe { (*current_pcb().sighand).action } in process_copy_sighand() 66 spin_unlock_irqrestore(unsafe { &mut (*current_pcb().sighand).siglock }, &flags); in process_copy_sighand()
|
D | process.rs | 4 arch::x86_64::asm::current::current_pcb, 46 if current_pcb() as *mut process_control_block as usize == _pcb as usize { in process_try_to_wake_up()
|
/DragonOS-0.1.2/kernel/src/exception/ |
D | trap.c | 16 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() 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() 158 current_pcb->state = PROC_STOPPED; in do_invalid_TSS() [all …]
|
/DragonOS-0.1.2/kernel/src/libs/ |
D | wait_queue.c | 27 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()
|
D | semaphore.c | 14 wait_queue_init(&wait, current_pcb); in semaphore_down() 16 current_pcb->state = PROC_UNINTERRUPTIBLE; in semaphore_down() 41 current_pcb->flags |= PF_NEED_SCHED; in semaphore_up()
|
D | mutex.c | 19 current_pcb->state = PROC_UNINTERRUPTIBLE; in __mutex_sleep() 48 waiter->pcb = current_pcb; in mutex_lock()
|
/DragonOS-0.1.2/kernel/src/syscall/ |
D | syscall.c | 169 if (current_pcb->fds[fd_num] == NULL) in sys_read() 175 struct vfs_file_t *file_ptr = current_pcb->fds[fd_num]; in sys_read() 208 if (current_pcb->fds[fd_num] == NULL) in sys_write() 214 struct vfs_file_t *file_ptr = current_pcb->fds[fd_num]; in sys_write() 244 if (current_pcb->fds[fd_num] == NULL) in sys_lseek() 247 struct vfs_file_t *file_ptr = current_pcb->fds[fd_num]; in sys_lseek() 282 return current_pcb->mm->brk_start; in sys_brk() 287 return current_pcb->mm->brk_end; in sys_brk() 289 if (new_brk > current_pcb->addr_limit) // 堆地址空间超过限制 in sys_brk() 293 if (new_brk >= current_pcb->mm->brk_end) in sys_brk() [all …]
|
/DragonOS-0.1.2/kernel/src/time/ |
D | sleep.c | 53 timer_func_init_us(sleep_task, &nanosleep_handler, (void *)current_pcb, rqtp->tv_nsec / 1000); in nanosleep() 57 current_pcb->state = PROC_INTERRUPTIBLE; in nanosleep() 58 current_pcb->flags |= PF_NEED_SCHED; in nanosleep()
|
D | timer.c | 169 timer_func_init(&timer, &__wake_up_helper, current_pcb, timeout); in schedule_timeout_ms() 171 current_pcb->state &= ~(PROC_RUNNING); in schedule_timeout_ms()
|
/DragonOS-0.1.2/kernel/src/debug/traceback/ |
D | traceback.c | 39 … BLACK, "Kernel traceback: Fault in userland. pid=%ld, rbp=%#018lx\n", current_pcb->pid, regs->rbp… in traceback() 59 if((uint64_t)(rbp) >= current_pcb->thread->rbp || ((uint64_t)rbp<regs->rsp)) in traceback()
|
/DragonOS-0.1.2/kernel/src/ |
D | lib.rs | 34 arch::x86_64::asm::current::current_pcb, 71 println!("Current PCB:\n\t{:?}", current_pcb()); in panic()
|
D | main.c | 128 current_pcb->cpu_id = 0; in system_initialize() 129 current_pcb->preempt_count = 0; in system_initialize()
|
/DragonOS-0.1.2/kernel/src/ipc/ |
D | signal.rs | 5 asm::{bitops::ffz, current::current_pcb, ptrace::user_mode}, 402 if current_pcb().sig_pending.signal == 0 || (!user_mode(regs)) { in do_signal() 412 let oldset = current_pcb().sig_blocked; in do_signal() 422 current_pcb().pid in do_signal() 429 current_pcb().pid, in do_signal() 450 let _tmp = sighand_struct::convert_mut(current_pcb().sighand); in get_signal_to_deliver() 454 panic!("Sighand is NULL! pid={}", current_pcb().pid); in get_signal_to_deliver() 461 dequeue_signal(sigset_t::convert_mut(&mut current_pcb().sig_blocked).unwrap()); in get_signal_to_deliver() 465 spin_unlock_irq(unsafe { (&mut (*current_pcb().sighand).siglock) as *mut spinlock_t }); in get_signal_to_deliver() 470 let hand = sighand_struct::convert_mut(current_pcb().sighand).unwrap(); in get_signal_to_deliver() [all …]
|
/DragonOS-0.1.2/kernel/src/common/ |
D | wait_queue.h | 66 wait_queue_init(&(name), current_pcb); 74 wait_queue_init(&(name), current_pcb);
|
/DragonOS-0.1.2/kernel/src/arch/x86_64/include/asm/ |
D | current.h | 19 #define current_pcb get_current_pcb() macro
|
/DragonOS-0.1.2/kernel/src/arch/x86_64/asm/ |
D | current.rs | 7 pub fn current_pcb() -> &'static mut process_control_block { in current_pcb() function
|
/DragonOS-0.1.2/kernel/src/mm/ |
D | mmio.c | 70 kerror("failed to create mmio vma. pid=%d", current_pcb->pid); in mmio_create() 94 …r("mmio_release failed: vma not found. At address: %#018lx, pid=%ld", vaddr + i, current_pcb->pid); in mmio_release()
|