Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持syscall指令 #417

Merged

Conversation

GnoCiYeH
Copy link
Member

@GnoCiYeH GnoCiYeH commented Nov 2, 2023

No description provided.

GnoCiYeH and others added 30 commits October 12, 2023 08:10
* 添加rust重构版本的HPET驱动和tsc驱动,并使用HPET校准tsc频率和cpu总线频率

* 把hpet.c移动到arch文件夹下
* 测试RESET

* 测试RESET

* 基于轮询的实现

* 规范化部分unsafe的使用

* 完成中断处理函数,同时去除了不必要的内存拷贝行为,准备编写napi机制

* 实现现有协议栈下的部分napi机制;修复了内存泄漏的问题;添加了一部分代码注释

* 去除部分无用代码

* 去除一些无用代码

* 适配新的驱动模型

* 完成msi中断测试

* 去除一些无用代码

* 格式化代码

* 增加了一些注释,提高代码可读性

* 去除无关文件

* 优化了读取mac地址的方式,提高可读性
Copy link
Member

@fslongjin fslongjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

然后就是函数和数据结构需要添加注释

);
}

pub fn init_syscall_stack(&mut self, stack: VirtAddr) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个地方最好把syscall_stack的引用传入进来

/// user data segment selector
pub const USER_DS: SegmentSelector = SegmentSelector::new(6, Ring::Ring3);
pub const USER_DS: SegmentSelector = SegmentSelector::new(5, Ring::Ring3);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

前后顺序更改一下

movq %gs:0x0, %rsp

pushq $43 //USER_DS
pushq %gs:0x8 //rsp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注释的格式修改一下,//右边需要空格

pushq %rax //ds
xorq %rax, %rax

pushq %rbp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的格式对齐有问题

@@ -186,6 +195,23 @@ static void __smp__flush_tlb_ipi_handler(uint64_t irq_num, uint64_t param, struc
flush_tlb();
}

void smp_syscall_init()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个函数最好是调用rust里面的代码,暴露一个接口出来,不然的话代码就冗余了

void sys_vector_init();
void syscall_64(); // syscall指令入口
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个如果没用到的话就不用在这导出了

cli
// 将原本要返回的栈帧的栈指针传入do_signal的第一个参数
// movq %rsp, %rdi
// callq do_signal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删掉这段即可

@fslongjin
Copy link
Member

加点函数注释即可merge了

@fslongjin fslongjin merged commit 1603395 into DragonOS-Community:master Nov 4, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants