From b89963de95cb95621f262f16877395ba0a9a05e2 Mon Sep 17 00:00:00 2001
From: "Rustem Gimadutdinov (rgimad)" <rustem.gimadutdinov@gmail.com>
Date: Thu, 19 Aug 2021 10:33:40 +0000
Subject: [PATCH] kolibri-ahci: - important register preseving

git-svn-id: svn://kolibrios.org@9142 a494cfbc-eb01-0410-851d-a64ba20cac60
---
 kernel/branches/kolibri-ahci/blkdev/ahci.inc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/branches/kolibri-ahci/blkdev/ahci.inc b/kernel/branches/kolibri-ahci/blkdev/ahci.inc
index 547b22babf..419953dc72 100644
--- a/kernel/branches/kolibri-ahci/blkdev/ahci.inc
+++ b/kernel/branches/kolibri-ahci/blkdev/ahci.inc
@@ -566,7 +566,7 @@ ahci_init:
         ; register disk in system:
         stdcall ahci_read_first_sector, ecx
 
-        push    ecx edx
+        push    ecx
         mov     eax, [hd_counter]
         xor     edx, edx
         mov     ecx, 10
@@ -582,14 +582,18 @@ ahci_init:
         add     dl, '0'
         mov     byte [hd_name + 2], dl
 .endif1:
-        pop     edx ecx
+        pop     ecx
 
         DEBUGF  1, "adding '%s'\n", hd_name
 
+        push    ecx
         stdcall disk_add, ahci_callbacks, hd_name, ecx, 0
+        pop     ecx
         test    eax, eax
         jz      .disk_add_fail
+        push    ecx
         stdcall disk_media_changed, eax, 1 ; system will scan for partitions on disk
+        pop     ecx
 
         jmp     .after_add_disk