From f2dc4e108dbec03b05f8629626b0006454e6195e Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 27 Apr 2009 15:58:18 -0700 Subject: [PATCH] rllpack: make all pointers 32 bits wide The messing around with partial pointers for rllpack/rllunpack turned out to be a source of bugs. Instead, have all the values be 32 bits wide, and require the callers to pass them accordingly. Signed-off-by: H. Peter Anvin --- core/parseconfig.inc | 4 ++-- core/rllpack.inc | 13 +++++-------- core/ui.inc | 4 ++-- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/core/parseconfig.inc b/core/parseconfig.inc index 962d1200..5159a1a3 100644 --- a/core/parseconfig.inc +++ b/core/parseconfig.inc @@ -433,9 +433,9 @@ commit_vk: rep stosb ; Pack into high memory - mov si,VKernelBuf + mov esi,VKernelBuf mov edi,[VKernelEnd] - mov cx,vk_size + mov ecx,vk_size call rllpack mov [VKernelEnd],edi .nolabel: diff --git a/core/rllpack.inc b/core/rllpack.inc index 717ba6ab..c3bca696 100644 --- a/core/rllpack.inc +++ b/core/rllpack.inc @@ -31,8 +31,8 @@ ; ; rllpack: -; Pack CX bytes from SI into EDI. -; Returns updated (E)SI and EDI. +; Pack ECX bytes from ESI into EDI. +; Returns updated ESI and EDI. ; rllpack: push word .pmentry @@ -44,8 +44,6 @@ rllpack: push ecx push ebx push edx - movzx ecx,cx - movzx esi,si .startseq: xor eax,eax ; Zero byte xor ebx,ebx ; Run length zero @@ -116,9 +114,9 @@ rllpack: bits 16 ; ; rllunpack: -; Unpack bytes from SI into EDI -; On return (E)SI, EDI are updated and -; (E)CX contains number of bytes output. +; Unpack bytes from ESI into EDI +; On return ESI, EDI are updated and +; ECX contains number of bytes output. ; rllunpack: push word .pmentry @@ -128,7 +126,6 @@ rllunpack: bits 32 .pmentry: push edi - movzx esi,si xor ecx,ecx .header: dec esi diff --git a/core/ui.inc b/core/ui.inc index aa86c569..cb6e03bd 100644 --- a/core/ui.inc +++ b/core/ui.inc @@ -161,7 +161,7 @@ display_labels: push cx ; save command line size - mov di,VKernelBuf + mov edi,VKernelBuf call rllunpack ; ESI updated on return @@ -350,7 +350,7 @@ vk_check: cmp esi,[VKernelEnd] jbe .not_vk - mov di,VKernelBuf + mov edi,VKernelBuf call rllunpack ; ESI updated on return -- 2.11.4.GIT