summaryrefslogtreecommitdiff
path: root/mbr
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-06-11 17:21:35 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2010-06-11 17:21:35 -0700
commit92d1d619c033353a5e532b7118daee1a403f08ca (patch)
tree468cb15a66b93664975ce5146acdf9c9006ee889 /mbr
parent5bc3c2cf4bc0edd52af33737b15416d021822d51 (diff)
downloadsyslinux-92d1d619c033353a5e532b7118daee1a403f08ca.tar.gz
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@linux.intel.com>
Diffstat (limited to 'mbr')
-rw-r--r--mbr/gptmbr.S9
1 files changed, 7 insertions, 2 deletions
diff --git a/mbr/gptmbr.S b/mbr/gptmbr.S
index 42887dbd..e8c60c00 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