Rev 5577 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5577 | Rev 5596 | ||
---|---|---|---|
Line 19... | Line 19... | ||
19 | ;; ;; |
19 | ;; ;; |
20 | ;; See file COPYING for details ;; |
20 | ;; See file COPYING for details ;; |
21 | ;; ;; |
21 | ;; ;; |
22 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
22 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 23... | Line 23... | ||
23 | 23 | ||
Line 24... | Line 24... | ||
24 | $Revision: 5577 $ |
24 | $Revision: 5596 $ |
25 | 25 | ||
26 | ;*************************************************************************** |
26 | ;*************************************************************************** |
27 | ; Function |
27 | ; Function |
Line 164... | Line 164... | ||
164 | and esi, 3 |
164 | and esi, 3 |
Line 165... | Line 165... | ||
165 | 165 | ||
166 | call pci_make_config_cmd |
166 | call pci_make_config_cmd |
167 | mov ebx, eax |
167 | mov ebx, eax |
168 | mov dx, 0xcf8 |
- | |
169 | in eax, dx |
- | |
170 | push eax |
168 | mov dx, 0xcf8 |
171 | ; set up addressing to config data |
169 | ; set up addressing to config data |
172 | mov eax, ebx |
170 | mov eax, ebx |
173 | and al, 0xfc; make address dword-aligned |
171 | and al, 0xfc; make address dword-aligned |
174 | out dx, eax |
172 | out dx, eax |
Line 191... | Line 189... | ||
191 | pci_read_word1: |
189 | pci_read_word1: |
192 | in ax, dx |
190 | in ax, dx |
193 | jmp pci_fin_read1 |
191 | jmp pci_fin_read1 |
194 | pci_read_dword1: |
192 | pci_read_dword1: |
195 | in eax, dx |
193 | in eax, dx |
196 | jmp pci_fin_read1 |
- | |
197 | pci_fin_read1: |
194 | pci_fin_read1: |
198 | ; restore configuration control |
- | |
199 | xchg eax, [esp] |
- | |
200 | mov dx, 0xcf8 |
- | |
201 | out dx, eax |
- | |
202 | - | ||
203 | pop eax |
- | |
204 | pop esi ebx |
195 | pop esi ebx |
205 | ret |
196 | ret |
206 | pci_read_reg_2: |
197 | pci_read_reg_2: |
Line 207... | Line 198... | ||
207 | 198 | ||
208 | test bh, 128 ;mech#2 only supports 16 devices per bus |
199 | test bh, 128 ;mech#2 only supports 16 devices per bus |
Line 209... | Line 200... | ||
209 | jnz pci_read_reg_err |
200 | jnz pci_read_reg_err |
210 | 201 | ||
Line 211... | Line -... | ||
211 | mov esi, eax ; save register size into ESI |
- | |
212 | and esi, 3 |
- | |
213 | 202 | mov esi, eax ; save register size into ESI |
|
214 | push eax |
- | |
215 | ;store current state of config space |
- | |
216 | mov dx, 0xcf8 |
- | |
217 | in al, dx |
- | |
Line 218... | Line -... | ||
218 | mov ah, al |
- | |
219 | mov dl, 0xfa |
203 | and esi, 3 |
220 | in al, dx |
204 | |
221 | 205 | mov dx, 0xcfa |
|
222 | xchg eax, [esp] |
206 | |
223 | ; out 0xcfa,bus |
207 | ; out 0xcfa,bus |
Line 246... | Line 230... | ||
246 | pci_read_word2: |
230 | pci_read_word2: |
247 | in ax, dx |
231 | in ax, dx |
248 | jmp pci_fin_read2 |
232 | jmp pci_fin_read2 |
249 | pci_read_dword2: |
233 | pci_read_dword2: |
250 | in eax, dx |
234 | in eax, dx |
251 | ; jmp pci_fin_read2 |
- | |
252 | pci_fin_read2: |
235 | pci_fin_read2: |
Line 253... | Line -... | ||
253 | - | ||
254 | ; restore configuration space |
- | |
255 | xchg eax, [esp] |
- | |
256 | mov dx, 0xcfa |
- | |
257 | out dx, al |
- | |
258 | mov dl, 0xf8 |
- | |
259 | mov al, ah |
- | |
260 | out dx, al |
- | |
261 | - | ||
262 | pop eax |
236 | |
263 | pop esi ebx |
237 | pop esi ebx |
Line 264... | Line 238... | ||
264 | ret |
238 | ret |
265 | 239 | ||
Line 293... | Line 267... | ||
293 | mov esi, eax ; save register size into ESI |
267 | mov esi, eax ; save register size into ESI |
294 | and esi, 3 |
268 | and esi, 3 |
Line 295... | Line 269... | ||
295 | 269 | ||
296 | call pci_make_config_cmd |
270 | call pci_make_config_cmd |
297 | mov ebx, eax |
- | |
298 | ; get current state into ecx |
271 | mov ebx, eax |
299 | mov dx, 0xcf8 |
- | |
300 | in eax, dx |
- | |
301 | push eax |
272 | mov dx, 0xcf8 |
302 | ; set up addressing to config data |
273 | ; set up addressing to config data |
303 | mov eax, ebx |
274 | mov eax, ebx |
304 | and al, 0xfc; make address dword-aligned |
275 | and al, 0xfc; make address dword-aligned |
305 | out dx, eax |
276 | out dx, eax |
Line 323... | Line 294... | ||
323 | pci_write_word1: |
294 | pci_write_word1: |
324 | out dx, ax |
295 | out dx, ax |
325 | jmp pci_fin_write1 |
296 | jmp pci_fin_write1 |
326 | pci_write_dword1: |
297 | pci_write_dword1: |
327 | out dx, eax |
298 | out dx, eax |
328 | jmp pci_fin_write1 |
- | |
329 | pci_fin_write1: |
299 | pci_fin_write1: |
Line 330... | Line -... | ||
330 | - | ||
331 | ; restore configuration control |
- | |
332 | pop eax |
- | |
333 | mov dl, 0xf8 |
- | |
334 | out dx, eax |
- | |
335 | 300 | ||
336 | xor eax, eax |
301 | xor eax, eax |
Line 337... | Line 302... | ||
337 | pop ebx esi |
302 | pop ebx esi |
338 | 303 | ||
Line 344... | Line 309... | ||
344 | 309 | ||
345 | 310 | ||
Line 346... | Line -... | ||
346 | mov esi, eax ; save register size into ESI |
- | |
347 | and esi, 3 |
- | |
348 | 311 | mov esi, eax ; save register size into ESI |
|
349 | push eax |
- | |
350 | ;store current state of config space |
- | |
351 | mov dx, 0xcf8 |
- | |
352 | in al, dx |
- | |
353 | mov ah, al |
- | |
354 | mov dl, 0xfa |
312 | and esi, 3 |
355 | in al, dx |
313 | |
356 | xchg eax, [esp] |
314 | mov dx, 0xcfa |
357 | ; out 0xcfa,bus |
315 | ; out 0xcfa,bus |
358 | mov al, ah |
316 | mov al, ah |
Line 382... | Line 340... | ||
382 | pci_write_word2: |
340 | pci_write_word2: |
383 | out dx, ax |
341 | out dx, ax |
384 | jmp pci_fin_write2 |
342 | jmp pci_fin_write2 |
385 | pci_write_dword2: |
343 | pci_write_dword2: |
386 | out dx, eax |
344 | out dx, eax |
387 | jmp pci_fin_write2 |
- | |
388 | pci_fin_write2: |
345 | pci_fin_write2: |
389 | ; restore configuration space |
- | |
390 | pop eax |
- | |
391 | mov dx, 0xcfa |
- | |
392 | out dx, al |
- | |
393 | mov dl, 0xf8 |
- | |
394 | mov al, ah |
- | |
395 | out dx, al |
- | |
Line 396... | Line 346... | ||
396 | 346 | ||
397 | xor eax, eax |
347 | xor eax, eax |
398 | pop ebx esi |
348 | pop ebx esi |
Line 656... | Line 606... | ||
656 | mov dword[esp + 20], ebx |
606 | mov dword[esp + 20], ebx |
657 | .return_a: |
607 | .return_a: |
658 | mov dword[esp + 32], eax |
608 | mov dword[esp + 32], eax |
659 | ret |
609 | ret |
Line 660... | Line -... | ||
660 | - | ||
661 | PCI_VENDOR_ID equ 0x00 |
- | |
662 | PCI_CLASS_REVISION equ 0x08 |
- | |
663 | PCI_HEADER_TYPE equ 0x0E |
- | |
664 | PCI_SUBSYSTEM_VENDOR_ID equ 0x2c |
- | |
665 | PCI_IRQ_LINE equ 0x3C |
- | |
666 | 610 | ||
667 | proc pci_enum |
611 | proc pci_enum |
668 | push ebp |
612 | push ebp |
669 | mov ebp, esp |
613 | mov ebp, esp |
670 | push 0 |
614 | push 0 |
Line 674... | Line 618... | ||
674 | end virtual |
618 | end virtual |
675 | .loop: |
619 | .loop: |
676 | mov ah, [.bus] |
620 | mov ah, [.bus] |
677 | mov al, 2 |
621 | mov al, 2 |
678 | mov bh, [.devfn] |
622 | mov bh, [.devfn] |
679 | mov bl, PCI_VENDOR_ID |
623 | mov bl, 0 |
680 | call pci_read_reg |
624 | call pci_read_reg |
681 | cmp eax, 0xFFFFFFFF |
625 | cmp eax, 0xFFFFFFFF |
682 | jnz .has_device |
626 | jnz .has_device |
683 | test byte [.devfn], 7 |
627 | test byte [.devfn], 7 |
684 | jnz .next_func |
628 | jnz .next_func |
Line 690... | Line 634... | ||
690 | pop ecx |
634 | pop ecx |
691 | test eax, eax |
635 | test eax, eax |
692 | jz .nomemory |
636 | jz .nomemory |
693 | mov edi, eax |
637 | mov edi, eax |
694 | mov [edi+PCIDEV.vendor_device_id], ecx |
638 | mov [edi+PCIDEV.vendor_device_id], ecx |
695 | mov edx, pcidev_list |
639 | mov eax, pcidev_list |
- | 640 | mov ecx, [eax+PCIDEV.bk] |
|
- | 641 | mov [edi+PCIDEV.bk], ecx |
|
696 | list_add_tail edi, edx |
642 | mov [edi+PCIDEV.fd], eax |
- | 643 | mov [ecx+PCIDEV.fd], edi |
|
- | 644 | mov [eax+PCIDEV.bk], edi |
|
697 | mov eax, dword [.devfn] |
645 | mov eax, dword [.devfn] |
698 | mov word [edi+PCIDEV.devfn], ax |
646 | mov dword [edi+PCIDEV.devfn], eax |
- | 647 | mov dword [edi+PCIDEV.owner], 0 |
|
699 | mov bh, al |
648 | mov bh, al |
700 | mov al, 2 |
649 | mov al, 2 |
701 | mov bl, PCI_CLASS_REVISION |
650 | mov bl, 8 |
702 | call pci_read_reg |
651 | call pci_read_reg |
703 | shr eax, 8 ;FIXME use byte mask |
652 | shr eax, 8 |
704 | mov [edi+PCIDEV.class], eax |
653 | mov [edi+PCIDEV.class], eax |
705 | - | ||
706 | ; mov ah, [.bus] |
- | |
707 | ; mov bh, byte [.devfn] |
- | |
708 | ; mov al, 2 |
- | |
709 | ; mov bl, PCI_SUBSYSTEM_VENDOR_ID |
- | |
710 | ; call pci_read_reg |
- | |
711 | ; mov [edi+PCIDEV.svid_sdid], eax |
- | |
712 | - | ||
713 | ; mov ah, [.bus] |
- | |
714 | ; mov al, 0 |
- | |
715 | ; mov bh, [.devfn] |
- | |
716 | ; mov bl, PCI_IRQ_LINE |
- | |
717 | ; call pci_read_reg |
- | |
718 | ; mov [edi+PCIDEV.irq_line], al |
- | |
719 | - | ||
720 | test byte [.devfn], 7 |
654 | test byte [.devfn], 7 |
721 | jnz .next_func |
655 | jnz .next_func |
722 | mov ah, [.bus] |
656 | mov ah, [.bus] |
723 | mov al, 0 |
657 | mov al, 0 |
724 | mov bh, [.devfn] |
658 | mov bh, [.devfn] |
725 | mov bl, PCI_HEADER_TYPE |
659 | mov bl, 0Eh |
726 | call pci_read_reg |
660 | call pci_read_reg |
727 | test al, al |
661 | test al, al |
728 | js .next_func |
662 | js .next_func |
729 | .no_device: |
663 | .no_device: |
730 | or byte [.devfn], 7 |
664 | or byte [.devfn], 7 |
Line 741... | Line 675... | ||
741 | ; Export for drivers. Just returns the pointer to the pci-devices list. |
675 | ; Export for drivers. Just returns the pointer to the pci-devices list. |
742 | proc get_pcidev_list |
676 | proc get_pcidev_list |
743 | mov eax, pcidev_list |
677 | mov eax, pcidev_list |
744 | ret |
678 | ret |
745 | endp |
679 | endp |
746 | - | ||
747 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
- | |
748 | - | ||
749 | ;internal functions |
- | |
750 | ;ecx (bus << 8)|devfn |
- | |
751 | ;edx register |
- | |
752 | - | ||
753 | align 4 |
- | |
754 | pci_bus: |
- | |
755 | .conf1_index: |
- | |
756 | ; dword CF8 = (0x80000000 | ((reg & 0xF00) << 16) | (bus << 16) | (devfn << 8) | (reg & 0xFC)) |
- | |
757 | push edx |
- | |
758 | mov eax, edx ; eax = reg |
- | |
759 | shl eax, 16 ; eax = reg << 16 |
- | |
760 | shl ecx, 8 ; ecx = (bus << 16)|(devfn<<8) |
- | |
761 | mov al, dl ; eax = (reg << 16)|reg |
- | |
762 | and eax, 0x0F0000FC ; eax = ((reg & 0xF00) << 16)|(reg & 0xFC) |
- | |
763 | lea eax, [0x80000000+eax+ecx] |
- | |
764 | mov dx, 0xCF8 |
- | |
765 | out dx, eax |
- | |
766 | pop edx |
- | |
767 | xor eax, eax |
- | |
768 | ret |
- | |
769 | - | ||
770 | align 4 |
- | |
771 | .conf2_index: |
- | |
772 | ; byte CF8 = 0xF0 | (fn << 1) |
- | |
773 | ; byte CFA = bus |
- | |
774 | push edx |
- | |
775 | mov eax, ecx ; (bus << 8)|devfn |
- | |
776 | and al, 7 ; fn |
- | |
777 | lea eax, [0xF0+eax+eax] |
- | |
778 | mov dx, 0xCF8 |
- | |
779 | out dx, al |
- | |
780 | mov al, ch ; bus |
- | |
781 | mov dx, 0xCFA |
- | |
782 | out dx, al |
- | |
783 | pop edx |
- | |
784 | xor eax, eax |
- | |
785 | ret |
- | |
786 | - | ||
787 | align 4 |
- | |
788 | .conf1_read8: |
- | |
789 | call .conf1_index |
- | |
790 | and dx, 3 |
- | |
791 | add dx, 0xCFC |
- | |
792 | in al, dx |
- | |
793 | ret |
- | |
794 | - | ||
795 | align 4 |
- | |
796 | .conf1_read16: |
- | |
797 | call .conf1_index |
- | |
798 | and dx, 2 |
- | |
799 | add dx, 0xCFC |
- | |
800 | in ax, dx |
- | |
801 | ret |
- | |
802 | - | ||
803 | align 4 |
- | |
804 | .conf1_read32: |
- | |
805 | call .conf1_index |
- | |
806 | mov dx, 0xCFC |
- | |
807 | in eax, dx |
- | |
808 | ret |
- | |
809 | - | ||
810 | align 4 |
- | |
811 | .conf1_write8: |
- | |
812 | call .conf1_index |
- | |
813 | mov eax, [esp+4] |
- | |
814 | and dx, 3 |
- | |
815 | add dx, 0xCFC |
- | |
816 | out dx, al |
- | |
817 | ret 4 |
- | |
818 | - | ||
819 | align 4 |
- | |
820 | .conf1_write16: |
- | |
821 | call .conf1_index |
- | |
822 | mov eax, [esp+4] |
- | |
823 | and dx, 2 |
- | |
824 | add dx, 0xCFC |
- | |
825 | out dx, ax |
- | |
826 | ret 4 |
- | |
827 | - | ||
828 | align 4 |
- | |
829 | .conf1_write32: |
- | |
830 | call .conf1_index |
- | |
831 | mov eax, [esp+4] |
- | |
832 | mov dx, 0xCFC |
- | |
833 | out dx, eax |
- | |
834 | ret 4 |
- | |
835 | - | ||
836 | align 4 |
- | |
837 | .conf2_read8: |
- | |
838 | ; in (0xC000 | (dev << 8) | reg) |
- | |
839 | call .conf2_index |
- | |
840 | and ecx, 0xF1 ;ecx = dev << 3 |
- | |
841 | shl ecx, 5 ;ecx = dev << 8 |
- | |
842 | lea edx, [0xC000+edx+ecx] |
- | |
843 | in al, dx |
- | |
844 | ret |
- | |
845 | - | ||
846 | align 4 |
- | |
847 | .conf2_read16: |
- | |
848 | call .conf2_index |
- | |
849 | and ecx, 0xF1 |
- | |
850 | shl ecx, 5 |
- | |
851 | lea edx, [0xC000+edx+ecx] |
- | |
852 | in ax, dx |
- | |
853 | ret |
- | |
854 | - | ||
855 | align 4 |
- | |
856 | .conf2_read32: |
- | |
857 | call .conf2_index |
- | |
858 | and ecx, 0xF1 |
- | |
859 | shl ecx, 5 |
- | |
860 | lea edx, [0xC000+edx+ecx] |
- | |
861 | in eax, dx |
- | |
862 | ret |
- | |
863 | - | ||
864 | - | ||
865 | PCI_R8 equ 0 |
- | |
866 | PCI_R16 equ 4 |
- | |
867 | PCI_R32 equ 8 |
- | |
868 | - | ||
869 | PCI_W8 equ 12 |
- | |
870 | PCI_W16 equ 16 |
- | |
871 | PCI_W32 equ 20 |
- | |
872 | - | ||
873 | - | ||
874 | align 4 |
- | |
875 | pci_conf1_rw: |
- | |
876 | ;internal function |
- | |
877 | ;eax accessor |
- | |
878 | ;ecx (bus << 8)|devfn |
- | |
879 | - | ||
880 | .val equ esp+4 |
- | |
881 | - | ||
882 | ; dword CF8 = (0x80000000 | ((reg & 0xF00) << 16) | (bus << 16) | (devfn << 8) | (reg & 0xFC)) |
- | |
883 | - | ||
884 | pushfd |
- | |
885 | cli |
- | |
886 | - | ||
887 | push edx |
- | |
888 | push eax |
- | |
889 | mov eax, edx ; eax = reg |
- | |
890 | shl eax, 16 ; eax = reg << 16 |
- | |
891 | shl ecx, 8 ; ecx = (bus << 16)|(devfn<<8) |
- | |
892 | mov al, dl ; eax = (reg << 16)|reg |
- | |
893 | and eax, 0x0F0000FC ; eax = ((reg & 0xF00) << 16)|(reg & 0xFC) |
- | |
894 | lea eax, [0x80000000+eax+ecx] |
- | |
895 | mov dx, 0xCF8 |
- | |
896 | out dx, eax |
- | |
897 | pop eax |
- | |
898 | pop edx |
- | |
899 | jmp dword [.fntab+eax] |
- | |
900 | .r32: |
- | |
901 | mov dx, 0xCFC |
- | |
902 | in eax, dx |
- | |
903 | .rdone: |
- | |
904 | popfd |
- | |
905 | ret |
- | |
906 | .r16: |
- | |
907 | and dx, 2 |
- | |
908 | add dx, 0xCFC |
- | |
909 | in al, dx |
- | |
910 | jmp .rdone |
- | |
911 | .r8: |
- | |
912 | and dx, 3 |
- | |
913 | add dx, 0xCFC |
- | |
914 | in al, dx |
- | |
915 | jmp .rdone |
- | |
916 | .w32: |
- | |
917 | mov eax, [esp+8] |
- | |
918 | mov dx, 0xCFC |
- | |
919 | out dx, eax |
- | |
920 | .wdone: |
- | |
921 | popfd |
- | |
922 | ret 4 |
- | |
923 | .w16: |
- | |
924 | mov eax, [esp+8] |
- | |
925 | and dx, 2 |
- | |
926 | add dx, 0xCFC |
- | |
927 | out dx, ax |
- | |
928 | jmp .wdone |
- | |
929 | .w8: |
- | |
930 | mov eax, [esp+8] |
- | |
931 | and dx, 3 |
- | |
932 | add dx, 0xCFC |
- | |
933 | out dx, al |
- | |
934 | jmp .wdone |
- | |
935 | - | ||
936 | align 4 |
- | |
937 | .fntab: |
- | |
938 | dd .r8 |
- | |
939 | dd .r16 |
- | |
940 | dd .r32 |
- | |
941 | dd .w8 |
- | |
942 | dd .w16 |
- | |
943 | dd .w32 |
- | |
944 | - | ||
945 | align 4 |
- | |
946 | pci_fn_rw dd pci_conf1_rw |
- | |
947 | - | ||
948 | ;proc pci_bus_read8 fastcall, busaddr:dword, reg:dword |
- | |
949 | ;proc pci_bus_read16 fastcall, busaddr:dword, reg:dword |
- | |
950 | ;proc pci_bus_read32 fastcall, busaddr:dword, reg:dword |
- | |
951 | - | ||
952 | align 4 |
- | |
953 | pci_bus_read8: |
- | |
954 | xor eax, eax |
- | |
955 | jmp dword [pci_fn_rw] |
- | |
956 | - | ||
957 | align 4 |
- | |
958 | pci_bus_read16: |
- | |
959 | mov eax, PCI_R16 |
- | |
960 | jmp dword [pci_fn_rw] |
- | |
961 | - | ||
962 | align 4 |
- | |
963 | pci_bus_read32: |
- | |
964 | mov eax, PCI_R32 |
- | |
965 | jmp dword [pci_fn_rw] |
- | |
966 | - | ||
967 | ;proc pci_bus_write8 fastcall, busaddr:dword, reg:dword, val: dword |
- | |
968 | ;proc pci_bus_write16 fastcall, busaddr:dword, reg:dword, val: dword |
- | |
969 | ;proc pci_bus_write32 fastcall, busaddr:dword, reg:dword, val: dword |
- | |
970 | - | ||
971 | align 4 |
- | |
972 | pci_bus_write8: |
- | |
973 | mov eax, PCI_W8 |
- | |
974 | jmp dword [pci_fn_rw] |
- | |
975 | - | ||
976 | align 4 |
- | |
977 | pci_bus_write16: |
- | |
978 | mov eax, PCI_W16 |
- | |
979 | jmp dword [pci_fn_rw] |
- | |
980 | - | ||
981 | align 4 |
- | |
982 | pci_bus_write32: |
- | |
983 | mov eax, PCI_W32 |
- | |
984 | jmp dword [pci_fn_rw] |
- | |
985 | - | ||
986 | ;deprecated proc pci_read8 stdcall, bus:dword, devfn:dword, reg:dword |
- | |
987 | ;deprecated proc pci_read16 stdcall, bus:dword, devfn:dword, reg:dword |
- | |
988 | ;deprecated proc pci_read32 stdcall, bus:dword, devfn:dword, reg:dword |
- | |
989 | - | ||
990 | align 4 |
- | |
991 | pci_read8: |
- | |
992 | .bus equ esp+4 |
- | |
993 | .devfn equ esp+8 |
- | |
994 | .pci_reg equ esp+12 |
- | |
995 | .val equ esp+16 |
- | |
996 | - | ||
997 | movzx ecx, byte [.devfn] |
- | |
998 | mov ch, [.bus] |
- | |
999 | movzx edx, word [.pci_reg] |
- | |
1000 | call pci_bus_read8 |
- | |
1001 | ret 12 |
- | |
1002 | - | ||
1003 | align 4 |
- | |
1004 | pci_read16: |
- | |
1005 | .bus equ esp+4 |
- | |
1006 | .devfn equ esp+8 |
- | |
1007 | .pci_reg equ esp+12 |
- | |
1008 | .val equ esp+16 |
- | |
1009 | - | ||
1010 | movzx ecx, byte [.devfn] |
- | |
1011 | mov ch, [.bus] |
- | |
1012 | movzx edx, word [.pci_reg] |
- | |
1013 | call pci_bus_read16 |
- | |
1014 | ret 12 |
- | |
1015 | - | ||
1016 | align 4 |
- | |
1017 | pci_read32: |
- | |
1018 | .bus equ esp+4 |
- | |
1019 | .devfn equ esp+8 |
- | |
1020 | .pci_reg equ esp+12 |
- | |
1021 | .val equ esp+16 |
- | |
1022 | - | ||
1023 | movzx ecx, byte [.devfn] |
- | |
1024 | mov ch, [.bus] |
- | |
1025 | movzx edx, word [.pci_reg] |
- | |
1026 | call pci_bus_read32 |
- | |
1027 | ret 12 |
- | |
1028 | - | ||
1029 | ;deprecated proc pci_write8 stdcall, bus:dword, devfn:dword, reg:dword, val:dword |
- | |
1030 | ;deprecated proc pci_write16 stdcall, bus:dword, devfn:dword, reg:dword, val:dword |
- | |
1031 | ;deprecated proc pci_write32 stdcall, bus:dword, devfn:dword, reg:dword, val:dword |
- | |
1032 | - | ||
1033 | align 4 |
- | |
1034 | pci_write8: |
- | |
1035 | .bus equ esp+4 |
- | |
1036 | .devfn equ esp+8 |
- | |
1037 | .pci_reg equ esp+12 |
- | |
1038 | .val equ esp+16 |
- | |
1039 | - | ||
1040 | movzx ecx, byte [.devfn] |
- | |
1041 | mov ch, [.bus] |
- | |
1042 | movzx edx, word [.pci_reg] |
- | |
1043 | push dword [esp+16] |
- | |
1044 | call pci_bus_write8 |
- | |
1045 | ret 16 |
- | |
1046 | - | ||
1047 | align 4 |
- | |
1048 | pci_write16: |
- | |
1049 | .bus equ esp+4 |
- | |
1050 | .devfn equ esp+8 |
- | |
1051 | .pci_reg equ esp+12 |
- | |
1052 | .val equ esp+16 |
- | |
1053 | - | ||
1054 | movzx ecx, byte [.devfn] |
- | |
1055 | mov ch, [.bus] |
- | |
1056 | movzx edx, word [.pci_reg] |
- | |
1057 | push dword [esp+16] |
- | |
1058 | call pci_bus_write16 |
- | |
1059 | ret 16 |
- | |
1060 | - | ||
1061 | align 4 |
- | |
1062 | pci_write32: |
- | |
1063 | .bus equ esp+4 |
- | |
1064 | .devfn equ esp+8 |
- | |
1065 | .pci_reg equ esp+12 |
- | |
1066 | .val equ esp+16 |
- | |
1067 | - | ||
1068 | movzx ecx, byte [.devfn] |
- | |
1069 | mov ch, [.bus] |
- | |
1070 | movzx edx, word [.pci_reg] |
- | |
1071 | push dword [esp+16] |
- | |
1072 | call pci_bus_write32 |
- | |
1073 | ret 16><>><>8) |
- | |
1074 | ><8) |
- | |
1075 | >><>><>><>><>><>><>><>><>><>><>><>><>><>8) |
- | |
1076 | ><8) |
- |