Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
重构了系统调用模块。
主要设计为:
syscall_handler
函数)syscall/mod.rs
下,新增了一个syscall_dispatcher,用于分发系统调用。这个函数内需要对用户态传入的指针参数,进行越界检查,防止访问到内核空间。目前存在的问题:
关于上面说的“特殊处理”,指的是:
因为这几个函数要直接操作pt_regs,但是我新的设计不允许直接操作pt_regs,避免系统调用与架构耦合。linux里面,他们这几个函数不用直接操作pt_regs。因此我目前就是那几个系统调用,没有走通用的系统调用处理的方法,而是特判了一下