From cf2573f733e0d9b7bfd3f5bb05b0734918672e14 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 21 Dec 2015 19:36:10 +0000 Subject: [PATCH] [FREELDR/AMD64] Save parameter registers (rcx, rdx) before calling CallRealMode. Patch by andy-123, applied to a secondary location by me. CORE-10511 #resolve #comment Thanks. I added the same fix to PnpBiosGet below. svn path=/trunk/; revision=70407 --- reactos/boot/freeldr/freeldr/arch/amd64/pnpbios.S | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/reactos/boot/freeldr/freeldr/arch/amd64/pnpbios.S b/reactos/boot/freeldr/freeldr/arch/amd64/pnpbios.S index a2b49bcbcfc..f97a9d8fb05 100644 --- a/reactos/boot/freeldr/freeldr/arch/amd64/pnpbios.S +++ b/reactos/boot/freeldr/freeldr/arch/amd64/pnpbios.S @@ -104,10 +104,18 @@ pnp_not_found: PUBLIC PnpBiosGetDeviceNodeCount PnpBiosGetDeviceNodeCount: + /* Save param-regs */ + push rcx + push rdx + /* Call the real mode function */ mov bx, FNID_PnpBiosGetDeviceNodeCount call CallRealMode + /* Restore param-regs */ + pop rdx + pop rcx + xor eax, eax mov ax, [BSS_PnpNodeSize] mov [rcx], eax @@ -140,10 +148,16 @@ PnpBiosGetDeviceNode: and eax, HEX(0f) mov word ptr [BSS_PnpBiosBufferOffset], ax + /* Save rcx */ + push rcx + /* Call the real mode function */ mov bx, FNID_PnpBiosGetDeviceNode call CallRealMode + /* Restore rcx */ + pop rcx + /* update node number */ mov al, byte ptr [BSS_PnpNodeNumber] mov [rcx], al