summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormlarkin <mlarkin@openbsd.org>2015-07-16 21:12:12 +0000
committermlarkin <mlarkin@openbsd.org>2015-07-16 21:12:12 +0000
commita293269155da50ac5f5d47a0df22a4d068c73b3c (patch)
tree41023b1273001c386ae951450e6ee0d061de974a
parentzap trailing whitespace (diff)
downloadwireguard-openbsd-a293269155da50ac5f5d47a0df22a4d068c73b3c.tar.xz
wireguard-openbsd-a293269155da50ac5f5d47a0df22a4d068c73b3c.zip
Fix a backward compare in boot argument parsing, and clarify a comment that
was wrong. ok guenther@
-rw-r--r--sys/arch/amd64/amd64/locore.S9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S
index 44a6d3cd013..8bd302d1435 100644
--- a/sys/arch/amd64/amd64/locore.S
+++ b/sys/arch/amd64/amd64/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.68 2015/06/28 18:54:54 guenther Exp $ */
+/* $OpenBSD: locore.S,v 1.69 2015/07/16 21:12:12 mlarkin Exp $ */
/* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */
/*
@@ -287,8 +287,9 @@ start: movw $0x1234,0x472 # warm boot
/*
* Copy the boot arguments to bootinfo[] in machdep.c.
*
- * We are passed the size of bootinfo[] in bootinfo_size, and
- * we report how much data /boot passed us back in the same variable.
+ * We are passed the size of the data /boot passed to us in
+ * 28(%esp). We copy up to bootinfo_size bytes of data into
+ * bootinfo and report back how much we copied in bootinfo_size.
*
* machdep.c can then take action if bootinfo_size >= bootinfo[]
* (which would meant that we may have been passed too much data).
@@ -296,7 +297,7 @@ start: movw $0x1234,0x472 # warm boot
movl 28(%esp), %eax
movl %eax, %ecx
cmpl RELOC(bootinfo_size), %ecx /* Too much? */
- jnc bi_size_ok
+ jb bi_size_ok
movl RELOC(bootinfo_size), %ecx /* Only copy this much */
bi_size_ok:
movl %eax, RELOC(bootinfo_size) /* Report full amount */