From c4f3315ffd69d6aba5e5cd32449c30d2203bf206 Mon Sep 17 00:00:00 2001 From: Doczom Date: Mon, 3 Jan 2022 18:26:31 +0000 Subject: [PATCH] small fix git-svn-id: svn://kolibrios.org@9567 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/bus/pci/pci32.inc | 88 ++++++++++++++++++++ kernel/trunk/core/dll.inc | 143 +++++++-------------------------- 2 files changed, 117 insertions(+), 114 deletions(-) diff --git a/kernel/trunk/bus/pci/pci32.inc b/kernel/trunk/bus/pci/pci32.inc index 75f0ef23f0..9bd6ce076e 100644 --- a/kernel/trunk/bus/pci/pci32.inc +++ b/kernel/trunk/bus/pci/pci32.inc @@ -677,3 +677,91 @@ proc get_pcidev_list mov eax, pcidev_list ret endp + + +align 4 +proc pci_read32 stdcall, bus:dword, devfn:dword, reg:dword + push ebx + xor eax, eax + xor ebx, ebx + mov ah, byte [bus] + mov al, 6 + mov bh, byte [devfn] + mov bl, byte [reg] + call pci_read_reg + pop ebx + ret +endp + +align 4 +proc pci_read16 stdcall, bus:dword, devfn:dword, reg:dword + push ebx + xor eax, eax + xor ebx, ebx + mov ah, byte [bus] + mov al, 5 + mov bh, byte [devfn] + mov bl, byte [reg] + call pci_read_reg + pop ebx + ret +endp + +align 4 +proc pci_read8 stdcall, bus:dword, devfn:dword, reg:dword + push ebx + xor eax, eax + xor ebx, ebx + mov ah, byte [bus] + mov al, 4 + mov bh, byte [devfn] + mov bl, byte [reg] + call pci_read_reg + pop ebx + ret +endp + +align 4 +proc pci_write8 stdcall, bus:dword, devfn:dword, reg:dword, val:dword + push ebx + xor eax, eax + xor ebx, ebx + mov ah, byte [bus] + mov al, 8 + mov bh, byte [devfn] + mov bl, byte [reg] + mov ecx, [val] + call pci_write_reg + pop ebx + ret +endp + +align 4 +proc pci_write16 stdcall, bus:dword, devfn:dword, reg:dword, val:dword + push ebx + xor eax, eax + xor ebx, ebx + mov ah, byte [bus] + mov al, 9 + mov bh, byte [devfn] + mov bl, byte [reg] + mov ecx, [val] + call pci_write_reg + pop ebx + ret +endp + +align 4 +proc pci_write32 stdcall, bus:dword, devfn:dword, reg:dword, val:dword + push ebx + xor eax, eax + xor ebx, ebx + mov ah, byte [bus] + mov al, 10 + mov bh, byte [devfn] + mov bl, byte [reg] + mov ecx, [val] + call pci_write_reg + pop ebx + ret +endp \ No newline at end of file diff --git a/kernel/trunk/core/dll.inc b/kernel/trunk/core/dll.inc index 980184ece4..306863a505 100644 --- a/kernel/trunk/core/dll.inc +++ b/kernel/trunk/core/dll.inc @@ -34,92 +34,7 @@ proc get_notify stdcall, p_ev:dword jmp .wait endp -align 4 -proc pci_read32 stdcall, bus:dword, devfn:dword, reg:dword - push ebx - xor eax, eax - xor ebx, ebx - mov ah, byte [bus] - mov al, 6 - mov bh, byte [devfn] - mov bl, byte [reg] - call pci_read_reg - pop ebx - ret -endp -align 4 -proc pci_read16 stdcall, bus:dword, devfn:dword, reg:dword - push ebx - xor eax, eax - xor ebx, ebx - mov ah, byte [bus] - mov al, 5 - mov bh, byte [devfn] - mov bl, byte [reg] - call pci_read_reg - pop ebx - ret -endp - -align 4 -proc pci_read8 stdcall, bus:dword, devfn:dword, reg:dword - push ebx - xor eax, eax - xor ebx, ebx - mov ah, byte [bus] - mov al, 4 - mov bh, byte [devfn] - mov bl, byte [reg] - call pci_read_reg - pop ebx - ret -endp - -align 4 -proc pci_write8 stdcall, bus:dword, devfn:dword, reg:dword, val:dword - push ebx - xor eax, eax - xor ebx, ebx - mov ah, byte [bus] - mov al, 8 - mov bh, byte [devfn] - mov bl, byte [reg] - mov ecx, [val] - call pci_write_reg - pop ebx - ret -endp - -align 4 -proc pci_write16 stdcall, bus:dword, devfn:dword, reg:dword, val:dword - push ebx - xor eax, eax - xor ebx, ebx - mov ah, byte [bus] - mov al, 9 - mov bh, byte [devfn] - mov bl, byte [reg] - mov ecx, [val] - call pci_write_reg - pop ebx - ret -endp - -align 4 -proc pci_write32 stdcall, bus:dword, devfn:dword, reg:dword, val:dword - push ebx - xor eax, eax - xor ebx, ebx - mov ah, byte [bus] - mov al, 10 - mov bh, byte [devfn] - mov bl, byte [reg] - mov ecx, [val] - call pci_write_reg - pop ebx - ret -endp handle equ IOCTL.handle io_code equ IOCTL.io_code @@ -316,6 +231,35 @@ proc reg_service_ex stdcall, name:dword, handler:dword, srvsize:dword ret endp +align 4 +stop_all_services: ;used in shutdown system + push ebp + mov edx, [srv.fd] +.next: + cmp edx, srv.fd-SRV.fd + je .done + cmp [edx+SRV.magic], ' SRV' + jne .next + cmp [edx+SRV.size], sizeof.SRV + jne .next + + mov ebx, [edx+SRV.entry] + mov edx, [edx+SRV.fd] + test ebx, ebx + jz .next + + push edx + mov ebp, esp + push 0 + push DRV_EXIT + call ebx ;stdcall + mov esp, ebp + pop edx + jmp .next +.done: + pop ebp + ret + align 4 proc get_proc stdcall, exp:dword, sz_name:dword @@ -1359,35 +1303,6 @@ destroy_all_hdlls: .ret: ret -align 4 -stop_all_services: - push ebp - mov edx, [srv.fd] -.next: - cmp edx, srv.fd-SRV.fd - je .done - cmp [edx+SRV.magic], ' SRV' - jne .next - cmp [edx+SRV.size], sizeof.SRV - jne .next - - mov ebx, [edx+SRV.entry] - mov edx, [edx+SRV.fd] - test ebx, ebx - jz .next - - push edx - mov ebp, esp - push 0 - push -1 - call ebx - mov esp, ebp - pop edx - jmp .next -.done: - pop ebp - ret - ; param ; eax= size ; ebx= pid