Rev 1358 | Rev 1375 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1358 | Rev 1370 | ||
---|---|---|---|
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: 1358 $ |
24 | $Revision: 1370 $ |
25 | 25 | ||
26 | ;*************************************************************************** |
26 | ;*************************************************************************** |
27 | ; Function |
27 | ; Function |
28 | ; pci_api: |
28 | ; pci_api: |
29 | ; |
29 | ; |
30 | ; Description |
30 | ; Description |
- | 31 | ; entry point for system PCI calls |
|
- | 32 | ;*************************************************************************** |
|
Line 31... | Line 33... | ||
31 | ; entry point for system PCI calls |
33 | ;mmio_pci_addr equ 0x400 ; set actual PCI address here to activate user-MMIO |
Line 32... | Line 34... | ||
32 | ;*************************************************************************** |
34 | |
Line 73... | Line 75... | ||
73 | jz pci_write_reg ;word |
75 | jz pci_write_reg ;word |
74 | cmp al,10 |
76 | cmp al,10 |
75 | jz pci_write_reg ;dword |
77 | jz pci_write_reg ;dword |
Line 76... | Line 78... | ||
76 | 78 | ||
77 | if defined mmio_pci_addr |
79 | if defined mmio_pci_addr |
78 | cmp al,11 ; <<< user-level MMIO functions <<< NEW! |
80 | cmp al,11 ; user-level MMIO functions |
79 | jz pci_mmio_init |
81 | jz pci_mmio_init |
80 | cmp al,12 |
82 | cmp al,12 |
81 | jz pci_mmio_map |
83 | jz pci_mmio_map |
82 | cmp al,13 |
84 | cmp al,13 |
Line 373... | Line 375... | ||
373 | pci_write_reg_err: |
375 | pci_write_reg_err: |
374 | xor eax,eax |
376 | xor eax,eax |
375 | dec eax |
377 | dec eax |
376 | ret |
378 | ret |
Line 377... | Line 379... | ||
377 | 379 | ||
378 | if defined mmio_pci_addr |
380 | if defined mmio_pci_addr ; must be set above |
379 | ;*************************************************************************** |
381 | ;*************************************************************************** |
380 | ; Function |
382 | ; Function |
381 | ; pci_mmio_init ; NEW! |
383 | ; pci_mmio_init |
382 | ; |
384 | ; |
383 | ; Description |
385 | ; Description |
384 | ; IN: bx = device's PCI bus address (bbbbbbbbdddddfff) |
386 | ; IN: bx = device's PCI bus address (bbbbbbbbdddddfff) |
385 | ; Returns eax = user heap space available (bytes) |
387 | ; Returns eax = user heap space available (bytes) |
386 | ; Error codes |
388 | ; Error codes |
387 | ; eax = -1 : PCI user access blocked, |
389 | ; eax = -1 : PCI user access blocked, |
388 | ; eax = -2 : device not registered for uMMIO service |
390 | ; eax = -2 : device not registered for uMMIO service |
389 | ; eax = -3 : user heap initialization failure |
391 | ; eax = -3 : user heap initialization failure |
390 | ;*************************************************************************** |
392 | ;*************************************************************************** |
391 | pci_mmio_init: |
393 | pci_mmio_init: |
392 | cmp bx, mmio_pci_addr ; must be set in kernel/data32.inc |
394 | cmp bx, mmio_pci_addr |
393 | jz @f |
395 | jz @f |
394 | mov eax,-2 |
396 | mov eax,-2 |
395 | ret |
397 | ret |
396 | @@: |
398 | @@: |
Line 403... | Line 405... | ||
403 | ret |
405 | ret |
Line 404... | Line 406... | ||
404 | 406 | ||
405 | 407 | ||
406 | ;*************************************************************************** |
408 | ;*************************************************************************** |
407 | ; Function |
409 | ; Function |
408 | ; pci_mmio_map ; NEW! |
410 | ; pci_mmio_map |
409 | ; |
411 | ; |
410 | ; Description |
412 | ; Description |
411 | ; maps a block of PCI memory to user-accessible linear address |
413 | ; maps a block of PCI memory to user-accessible linear address |
Line 489... | Line 491... | ||
489 | mov eax, edi |
491 | mov eax, edi |
490 | ret |
492 | ret |
Line 491... | Line 493... | ||
491 | 493 | ||
492 | ;*************************************************************************** |
494 | ;*************************************************************************** |
493 | ; Function |
495 | ; Function |
494 | ; pci_mmio_unmap_page ; NEW! |
496 | ; pci_mmio_unmap_page |
495 | ; |
497 | ; |
496 | ; Description |
498 | ; Description |
497 | ; unmaps the linear space previously tied to a PCI memory block |
499 | ; unmaps the linear space previously tied to a PCI memory block |
498 | ; |
500 | ; |