From 71a16643953b812d7054784c3f7f0f03cf116264 Mon Sep 17 00:00:00 2001 From: Frediano Ziglio Date: Fri, 8 Feb 2013 12:58:33 +0000 Subject: [PATCH] 4k_sector: Recover 3 bytes avoid a call after read_sector %edx:%eax are unused or incremented so increment always at end gaining 3 bytes Signed-off-by: Frediano Ziglio Signed-off-by: Matt Fleming --- mbr/gptmbr.S | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/mbr/gptmbr.S b/mbr/gptmbr.S index ae0549f0..ef2235db 100644 --- a/mbr/gptmbr.S +++ b/mbr/gptmbr.S @@ -142,7 +142,6 @@ next: pushw %bx get_ptab: call read_sector - call inc64 loopw get_ptab /* Find the boot partition */ @@ -240,16 +239,9 @@ saturate_stosl: ret /* - * Increment %edx:%eax - */ -inc64: - addl $1,%eax - adcl $0,%edx - ret - -/* * read_sector: read a single sector pointed to by %edx:%eax to * %es:%bx. CF is set on error. All registers saved. + * %edx:%eax and %es:%bx are incremented to read next sector */ read_sector: pushal @@ -282,6 +274,15 @@ read_common: popal jc disk_error addb $2, %bh /* bx += 512: point to the next buffer */ + + /* fall through and increment sector number */ + +/* + * Increment %edx:%eax + */ +inc64: + addl $1,%eax + adcl $0,%edx ret disk_error: -- 2.11.4.GIT