From 92d1d619c033353a5e532b7118daee1a403f08ca Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 11 Jun 2010 17:21:35 -0700 Subject: 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 --- mbr/gptmbr.S | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'mbr') 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 -- cgit v1.2.1