From: acevest Date: Tue, 16 May 2023 01:00:00 +0000 (+0800) Subject: sysenter后内核在开中断的情况下执行系统调用 X-Git-Url: http://zhaoyanbai.com/repos/Bv9ARM.ch10.html?a=commitdiff_plain;h=1d8973528475d9669617c1f4f83ef551989a3b68;p=kernel.git sysenter后内核在开中断的情况下执行系统调用 --- diff --git a/kernel/syscall.S b/kernel/syscall.S index b11cdee..6526d45 100644 --- a/kernel/syscall.S +++ b/kernel/syscall.S @@ -33,6 +33,10 @@ syscall_entry: #if FIX_SYSENTER_ESP_MODE movl (%esp),%esp #endif + + // sysenter have cleared IF, and sysexit will not set IF. + sti + // 这段代码纯是为了pt_regs_t准备的 // 后续看看直接优化掉 pushl $(SELECTOR_USER_SS) @@ -82,7 +86,6 @@ ret_from_fork_user: // sysexit指令从ecx中恢复用户态esp xchgl %ebp, %ecx - sti /* sysenter have cleared IF, and sysexit will not set IF. */ sysexit