[syslinux:pathbased] gptmbr: save four bytes
syslinux-bot for H. Peter Anvin
hpa at linux.intel.com
Fri Jun 11 17:24:21 PDT 2010
Commit-ID: 92d1d619c033353a5e532b7118daee1a403f08ca
Gitweb: http://syslinux.zytor.com/commit/92d1d619c033353a5e532b7118daee1a403f08ca
Author: H. Peter Anvin <hpa at linux.intel.com>
AuthorDate: Fri, 11 Jun 2010 17:21:35 -0700
Committer: H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Fri, 11 Jun 2010 17:21:35 -0700
gptmbr: save four bytes
Save four bytes by observing that none of our code relies on
saturate_stosl not actually corrupting %eax.
Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>
---
mbr/gptmbr.S | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/mbr/gptmbr.S b/mbr/gptmbr.S
index 42887db..e8c60c0 100644
--- a/mbr/gptmbr.S
+++ b/mbr/gptmbr.S
@@ -222,15 +222,20 @@ boot:
cli
jmpw *%sp /* %sp == bootsec */
+/*
+ * Store the value in %eax to %di iff %edx == 0, otherwise store -1.
+ * Returns the value that was actually written in %eax.
+ */
saturate_stosl:
- pushl %eax
andl %edx,%edx
jz 1f
orl $-1,%eax
1: stosl
- popl %eax
ret
+/*
+ * Increment %edx:%eax
+ */
inc64:
addl $1,%eax
adcl $0,%edx
More information about the Syslinux-commits
mailing list