summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2012-10-28 15:24:41 +0000
committerjsing <jsing@openbsd.org>2012-10-28 15:24:41 +0000
commit78cdbd0c92a36a3cce40a9cf61c0f5abdbb253a3 (patch)
tree8a4ad46443d48918453854b241e8c54aa1dc0210
parentChange email address in copyright to one that is valid. (diff)
downloadwireguard-openbsd-78cdbd0c92a36a3cce40a9cf61c0f5abdbb253a3.tar.xz
wireguard-openbsd-78cdbd0c92a36a3cce40a9cf61c0f5abdbb253a3.zip
Save and restore %ebx across the call to read. Otherwise we load the first
64KB segment at 0x7c00 and any additional 64KB segments over top of each other at 0x10000.
-rw-r--r--sys/arch/amd64/stand/cdbr/cdbr.S8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arch/amd64/stand/cdbr/cdbr.S b/sys/arch/amd64/stand/cdbr/cdbr.S
index de2c4a03ac8..ae29d0e14ab 100644
--- a/sys/arch/amd64/stand/cdbr/cdbr.S
+++ b/sys/arch/amd64/stand/cdbr/cdbr.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: cdbr.S,v 1.2 2004/08/24 15:33:25 tom Exp $ */
+/* $OpenBSD: cdbr.S,v 1.3 2012/10/28 15:24:41 jsing Exp $ */
/*
* Copyright (c) 2004 Tom Cosgrove <tom.cosgrove@arches-consulting.com>
@@ -204,9 +204,11 @@ load_loop:
load_notrunc:
subb %dh, %cl /* Update count */
pushl %eax /* Save */
- movw %bx, %es /* %bx had the segment (para) number */
- xorw %bx, %bx /* %es:0000 for destination */
+ pushl %ebx /* Save */
+ movw %bx, %es /* %bx has the segment (para) number */
+ xorw %bx, %bx /* %es:0000 for destination */
call read /* Read it in */
+ popl %ebx /* Restore */
popl %eax /* Restore */
addl $MAX_READ_SEC, %eax /* Update LBA */
addw $MAX_READ_PARAS, %bx /* Update dest addr */