summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorweingart <weingart@openbsd.org>2008-11-12 21:42:43 +0000
committerweingart <weingart@openbsd.org>2008-11-12 21:42:43 +0000
commit26be300f563a42fcda62bc8e04142279326e147e (patch)
tree6815570ad1787f944fcd59f073b562c8133a4025
parentwhen destroying the device, mark the mixer and the demultiplexer (diff)
downloadwireguard-openbsd-26be300f563a42fcda62bc8e04142279326e147e.tar.xz
wireguard-openbsd-26be300f563a42fcda62bc8e04142279326e147e.zip
Add a comment to sigcode() to explain why the use of 'int $0x80' is
necessary, so that future hackers will not be mislead the same way I was when looking at this code.
-rw-r--r--sys/arch/amd64/amd64/locore.S8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S
index e554a9d8440..bd569f17cf4 100644
--- a/sys/arch/amd64/amd64/locore.S
+++ b/sys/arch/amd64/amd64/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.29 2008/10/24 06:32:17 deraadt Exp $ */
+/* $OpenBSD: locore.S,v 1.30 2008/11/12 21:42:43 weingart Exp $ */
/* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */
/*
@@ -637,6 +637,12 @@ longmode_hi:
/*
* Signal trampoline; copied to top of user stack.
+ *
+ * Note, the "system call" to sigreturn() needs to be an 'int $0x80' one
+ * so that the kernel returns using 'iretq' method. This way if a process
+ * was interrupted (by tick) as opposed to in the kernel when a signal was
+ * being delivered, the process will be completely restored, including the
+ * userland %rcx register, which the 'sysret' instruction can not restore.
*/
NENTRY(sigcode)
call *%rax