Rev 1507 | Rev 1560 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1507 | Rev 1508 | ||
---|---|---|---|
Line 21... | Line 21... | ||
21 | ;; ;; |
21 | ;; ;; |
22 | ;; See file COPYING for details ;; |
22 | ;; See file COPYING for details ;; |
23 | ;; ;; |
23 | ;; ;; |
24 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
24 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 25... | Line 25... | ||
25 | 25 | ||
Line 26... | Line 26... | ||
26 | $Revision: 1507 $ |
26 | $Revision: 1508 $ |
27 | 27 | ||
28 | ;*************************************************************************** |
28 | ;*************************************************************************** |
29 | ; Function |
29 | ; Function |
Line 376... | Line 376... | ||
376 | pci_write_reg_err: |
376 | pci_write_reg_err: |
377 | xor eax,eax |
377 | xor eax,eax |
378 | dec eax |
378 | dec eax |
379 | ret |
379 | ret |
Line 380... | Line -... | ||
380 | - | ||
381 | if defined mmio_pci_addr ; must be set above |
380 | |
382 | ;*************************************************************************** |
381 | ;*************************************************************************** |
383 | ; Function |
382 | ; Function |
384 | ; pci_mmio_init |
383 | ; pci_mmio_init |
385 | ; |
384 | ; |
386 | ; Description |
385 | ; Description |
387 | ; IN: bx = device's PCI bus address (bbbbbbbbdddddfff) |
386 | ; IN: bx = device's PCI bus address (bbbbbbbbdddddfff) |
388 | ; Returns eax = phys. address of user-accessible DMA block |
387 | ; Returns eax = phys. address of user-accessible DMA block |
389 | ; Error codes |
388 | ; Error codes |
390 | ; eax = -1 : PCI user access blocked, |
- | |
391 | ; eax = -2 : device not registered for uMMIO service |
389 | ; eax = -1 : PCI user access blocked, |
392 | ; eax = -3 : user heap initialization failure |
390 | ; eax = -3 : user heap initialization failure |
393 | ;*************************************************************************** |
391 | ;*************************************************************************** |
394 | pci_mmio_init: |
392 | pci_mmio_init: |
395 | cmp bx, [mmio_pci_addr] |
- | |
396 | jz @f |
- | |
397 | mov eax,-2 |
- | |
398 | ret |
393 | mov [mmio_pci_addr],bx |
399 | @@: |
394 | |
400 | call init_heap ; (if not initialized yet) |
395 | call init_heap ; (if not initialized yet) |
401 | or eax,eax |
396 | or eax,eax |
402 | jz @f |
397 | jz @f |
403 | mov eax, [UserDMAaddr] |
398 | mov eax, [UserDMAaddr] |
Line 519... | Line 514... | ||
519 | 514 | ||
520 | pci_mmio_unmap: |
515 | pci_mmio_unmap: |
521 | stdcall user_free, ebx |
516 | stdcall user_free, ebx |
Line 522... | Line -... | ||
522 | ret |
- | |
523 | - | ||
524 | end if |
517 | ret |
525 | 518 | ||
526 | ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= |
519 | ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= |
527 | uglobal |
520 | uglobal |
528 | align 4 |
521 | align 4 |