signal的发送(暂时父子进程之间共享信号及相应的结构体) (#89)

* 解决由于spinlock.h中包含preempt_enable()带来的循环include问题

* new: 初步实现signal的数据结构

* new:signal相关数据结构

* fix: 解决bindings.rs报一堆警告的问题

* new: rust下的kdebug kinfo kwarn kBUG kerror宏

* 移动asm.h和cmpxchg.h

* new: signal的发送(暂时只支持父子进程共享信号及处理函数)
This commit is contained in:
login
2022-11-23 11:38:20 +08:00
committed by GitHub
parent 3d729e2069
commit 66f67c6a95
44 changed files with 1677 additions and 472 deletions

View File

@ -1,6 +1,7 @@
#include "syscall.h"
#include <common/errno.h>
#include <common/fcntl.h>
#include <common/kthread.h>
#include <common/string.h>
#include <driver/disk/ahci/ahci.h>
#include <exception/gate.h>
@ -10,7 +11,6 @@
#include <mm/slab.h>
#include <process/process.h>
#include <time/sleep.h>
#include <common/kthread.h>
// 导出系统调用入口函数定义在entry.S中
extern void system_call(void);
extern void syscall_int(void);
@ -19,6 +19,7 @@ extern uint64_t sys_clock(struct pt_regs *regs);
extern uint64_t sys_mstat(struct pt_regs *regs);
extern uint64_t sys_open(struct pt_regs *regs);
extern uint64_t sys_unlink_at(struct pt_regs *regs);
extern uint64_t sys_kill(struct pt_regs *regs);
/**
* @brief 导出系统调用处理函数的符号
@ -518,7 +519,7 @@ uint64_t sys_wait4(struct pt_regs *regs)
// 查找pid为指定值的进程
// ps: 这里判断子进程的方法没有按照posix 2008来写。
// todo: 根据进程树判断是否为当前进程的子进程
// todo: 当进程管理模块拥有pcblist_lock之后调用之前应当对其加锁
child_proc = process_find_pcb_by_pid(pid);
if (child_proc == NULL)
@ -598,7 +599,7 @@ system_call_t system_call_table[MAX_SYSTEM_CALL_NUM] = {
[20] = sys_pipe,
[21] = sys_mstat,
[22] = sys_unlink_at,
[23 ... 254] = system_call_not_exists,
[23] = sys_kill,
[24 ... 254] = system_call_not_exists,
[255] = sys_ahci_end_req,
};

View File

@ -34,5 +34,6 @@
#define SYS_MSTAT 21 // 获取系统的内存状态信息
#define SYS_UNLINK_AT 22 // 删除文件夹/删除文件链接
#define SYS_KILL 23 // kill一个进程(向这个进程发出信号)
#define SYS_AHCI_END_REQ 255 // AHCI DMA请求结束end_request的系统调用