550W Document
550W, a high-end OS
|
#include <asm/atomic.h>
#include <asm/pgtable.h>
#include <asm/stack.h>
#include <common/elf.h>
#include <drivers/screen/screen.h>
#include <fs/fs.h>
#include <lib/math.h>
#include <lib/stdio.h>
#include <lib/string.h>
#include <os/irq.h>
#include <os/pcb.h>
#include <os/smp.h>
#include <user/user_programs.h>
函数 | |
LIST_HEAD (ready_queue) | |
LIST_HEAD (block_queue) | |
pid_t | nextpid () |
void | init_pcb_i (char *name, int pcb_i, task_type_t type, int pid, int fpid, int tid, int father_pid, uint8_t core_mask) |
uintptr_t | init_user_stack (ptr_t *user_stack_kva, ptr_t *user_stack, int argc, const char *argv[], int envpc, const char *envp[], const char *file_name) |
void | k_pcb_init () |
long | sys_setpriority (int which, int who, int niceval) |
long | sys_getpriority (int which, int who) |
uint64_t | cal_priority (uint64_t cur_time, uint64_t idle_time, long priority) |
pcb_t * | check_first_ready_task () |
pcb_t * | choose_sched_task (list_head *queue) |
void | enqueue (list_head *new, list_head *head, enqueue_way_t way) |
pcb_t * | dequeue (list_head *queue, dequeue_way_t target) |
long | sys_nanosleep (nanotime_val_t *rqtp, nanotime_val_t *rmtp) |
void | check_sleeping () |
long | k_pcb_scheduler (void) |
long | sys_sched_yield (void) |
void | k_pcb_block (list_node_t *pcb_node, list_head *queue, enqueue_way_t way) |
void | k_pcb_unblock (list_head *from_queue, list_head *to_queue, unblock_way_t way) |
long | sys_sched_setaffinity (pid_t pid, unsigned int len, const byte_size_t *user_mask_ptr) |
long | sys_sched_getaffinity (pid_t pid, unsigned int len, uint8_t *user_mask_ptr) |
long | spawn (const char *file_name) |
long | sys_spawn (const char *file_name) |
long | sys_fork () |
int | kill (pid_t pid, int exit_status) |
long | sys_kill (pid_t pid) |
long | sys_exit (int error_code) |
long | sys_wait4 (pid_t pid, int *stat_addr, int options, rusage_t *ru) |
long | sys_process_show () |
long | exec (int target_pid, int father_pid, const char *file_name, const char *argv[], const char *envp[]) |
long | sys_exec (const char *file_name, const char *argv[], const char *envp[]) |
long | sys_execve (const char *file_name, const char *argv[], const char *envp[]) |
long | clone (unsigned long flags, void *stack, pid_t *parent_tid, void *tls, pid_t *child_tid) |
long | sys_clone (unsigned long flags, void *stack, pid_t *parent_tid, void *tls, pid_t *child_tid) |
long | k_pcb_getpid (void) |
long | sys_getpid () |
[SYSCALL] getpid: get current task process id 更多... | |
long | sys_getppid () |
[SYSCALL] getppid: get parent of current task pid 更多... | |
void | k_pcb_sleep (void *chan, spin_lock_t *lk) |
void | k_pcb_wakeup (void *chan) |
变量 | |
pcb_t *volatile | current_running0 |
pcb_t *volatile | current_running1 |
pcb_t *volatile *volatile | current_running |
pcb_t | pcb [NUM_MAX_TASK] |
const ptr_t | pid0_stack = INIT_KERNEL_STACK + PAGE_SIZE * 3 - 112 - 288 |
const ptr_t | pid0_stack2 = INIT_KERNEL_STACK + PAGE_SIZE * 5 - 112 - 288 |
pcb_t | pid0_pcb = {.pid = -1, .kernel_sp = (ptr_t)pid0_stack, .user_sp = (ptr_t)(INIT_KERNEL_STACK + PAGE_SIZE * 2), .core_mask[0] = 0x3, .status = TASK_EXITED} |
pcb_t | pid0_pcb2 = {.pid = -1, .kernel_sp = (ptr_t)pid0_stack2, .user_sp = (ptr_t)(INIT_KERNEL_STACK + PAGE_SIZE * 4), .core_mask[0] = 0x3, .status = TASK_EXITED} |
pid_t | freepid [NUM_MAX_TASK] |
uint64_t cal_priority | ( | uint64_t | cur_time, |
uint64_t | idle_time, | ||
long | priority | ||
) |
pcb_t* check_first_ready_task | ( | ) |
void check_sleeping | ( | ) |
pcb_t* dequeue | ( | list_head * | queue, |
dequeue_way_t | target | ||
) |
void enqueue | ( | list_head * | new, |
list_head * | head, | ||
enqueue_way_t | way | ||
) |
long exec | ( | int | target_pid, |
int | father_pid, | ||
const char * | file_name, | ||
const char * | argv[], | ||
const char * | envp[] | ||
) |
void init_pcb_i | ( | char * | name, |
int | pcb_i, | ||
task_type_t | type, | ||
int | pid, | ||
int | fpid, | ||
int | tid, | ||
int | father_pid, | ||
uint8_t | core_mask | ||
) |
uintptr_t init_user_stack | ( | ptr_t * | user_stack_kva, |
ptr_t * | user_stack, | ||
int | argc, | ||
const char * | argv[], | ||
int | envpc, | ||
const char * | envp[], | ||
const char * | file_name | ||
) |
void k_pcb_block | ( | list_node_t * | pcb_node, |
list_head * | queue, | ||
enqueue_way_t | way | ||
) |
long k_pcb_getpid | ( | void | ) |
void k_pcb_init | ( | ) |
long k_pcb_scheduler | ( | void | ) |
void k_pcb_sleep | ( | void * | chan, |
spin_lock_t * | lk | ||
) |
void k_pcb_unblock | ( | list_head * | from_queue, |
list_head * | to_queue, | ||
unblock_way_t | way | ||
) |
void k_pcb_wakeup | ( | void * | chan | ) |
int kill | ( | pid_t | pid, |
int | exit_status | ||
) |
LIST_HEAD | ( | block_queue | ) |
LIST_HEAD | ( | ready_queue | ) |
pid_t nextpid | ( | ) |
long spawn | ( | const char * | file_name | ) |
long sys_clone | ( | unsigned long | flags, |
void * | stack, | ||
pid_t * | parent_tid, | ||
void * | tls, | ||
pid_t * | child_tid | ||
) |
long sys_exec | ( | const char * | file_name, |
const char * | argv[], | ||
const char * | envp[] | ||
) |
long sys_execve | ( | const char * | file_name, |
const char * | argv[], | ||
const char * | envp[] | ||
) |
long sys_exit | ( | int | error_code | ) |
long sys_fork | ( | void | ) |
long sys_getpid | ( | void | ) |
[SYSCALL] getpid: get current task process id
long sys_getppid | ( | void | ) |
[SYSCALL] getppid: get parent of current task pid
long sys_getpriority | ( | int | which, |
int | who | ||
) |
long sys_kill | ( | pid_t | pid | ) |
long sys_nanosleep | ( | nanotime_val_t * | rqtp, |
nanotime_val_t * | rmtp | ||
) |
long sys_process_show | ( | ) |
long sys_sched_getaffinity | ( | pid_t | pid, |
unsigned int | len, | ||
uint8_t * | user_mask_ptr | ||
) |
long sys_sched_setaffinity | ( | pid_t | pid, |
unsigned int | len, | ||
const byte_size_t * | user_mask_ptr | ||
) |
long sys_sched_yield | ( | void | ) |
long sys_setpriority | ( | int | which, |
int | who, | ||
int | niceval | ||
) |
long sys_spawn | ( | const char * | file_name | ) |
pcb_t* volatile* volatile current_running |
pcb_t* volatile current_running0 |
pcb_t* volatile current_running1 |
pid_t freepid[NUM_MAX_TASK] |
pcb_t pid0_pcb = {.pid = -1, .kernel_sp = (ptr_t)pid0_stack, .user_sp = (ptr_t)(INIT_KERNEL_STACK + PAGE_SIZE * 2), .core_mask[0] = 0x3, .status = TASK_EXITED} |
pcb_t pid0_pcb2 = {.pid = -1, .kernel_sp = (ptr_t)pid0_stack2, .user_sp = (ptr_t)(INIT_KERNEL_STACK + PAGE_SIZE * 4), .core_mask[0] = 0x3, .status = TASK_EXITED} |
const ptr_t pid0_stack = INIT_KERNEL_STACK + PAGE_SIZE * 3 - 112 - 288 |
const ptr_t pid0_stack2 = INIT_KERNEL_STACK + PAGE_SIZE * 5 - 112 - 288 |