home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1997 / ARCHIVE_97.iso / discs / mag_discs / volume_08 / issue_06 / risc_os / kernel / NewIRQs < prev    next >
Text File  |  1988-07-18  |  2KB  |  70 lines

  1. > Sam.A2Docn.NewIRQs
  2.  
  3. Arthur 2 has much improved IRQ despatch methods; each source of interrupts
  4. is given a "device number", and you can set up you own "device driver" to
  5. receive only the interrupts from that device.
  6.  
  7. The device numbers (corresponding to the request bits in IOC) are:
  8.  
  9. PrinterBusy_DevNo   0
  10. Ringing_DevNo       1
  11. PrinterAck_DevNo    2
  12. VSync_DevNo         3
  13. (PowerOn_DevNo      4 - this should never be seen though!)
  14. Timer0_DevNo        5
  15. Timer1_DevNo        6
  16. FIQDowngrade_DevNo  7
  17. PFIQasIRQ_DevNo     8
  18. Sound_DevNo         9
  19. Serial_DevNo        10
  20. WinnieIRQ_DevNo     11
  21. DiscChanged_DevNo   12
  22. Podule_DevNo        13
  23. SerialTx_DevNo      14
  24. SerialRx_DevNo      15
  25.  
  26. Device driver code is entered in IRQ mode, with r12 set to the desired value,
  27. r3 pointing at IOC, and r0-r3 and r12 corruptible.
  28. The interrupt should be serviced, and return done by MOV PC,r14.
  29.  
  30.  
  31. Device claim/release
  32. ====================
  33.  
  34. SWI OS_ClaimDeviceVector (&4B):
  35.  R0 = Device number
  36.  R1 = call address
  37.  R2 = R12 value
  38.  R0=PFIQ|PIRQ devno -> R3 = interrupt location
  39.                        R4 = interrupt mask
  40.  
  41. This SWI sets up the given device driver, after stacking the previous driver.
  42. It also ensures that the given driver is not already anywhere in the list
  43. of drivers (i.e. it isn't the current driver, or any of the stacked drivers).
  44.  
  45. SWI OS_ReleaseDeviceVector (&4C):
  46.  R0 = Device number
  47.  R1 = call address
  48.  R2 = R12 value
  49.  R0=PFIQ|PIRQ devno -> R3 = interrupt location
  50.                        R4 = interrupt mask
  51.  
  52. This removes the driver from the list of drivers for the given device.
  53.  
  54. When releasing the vector, the user should not disable the appropriate IRQ
  55. in IOC; this is done automatically by the MOS if nobody else is on the chain
  56. (i.e. nobody else wants to be that device driver).
  57.  
  58. SKS notes: I suppose we better document use of IOC in our world somewhere ...
  59.  
  60. Background FIQ processing
  61. =========================
  62.  
  63. Arthur 2 allows FIQ to be claimed in the background. Unlike foreground
  64. FIQ claim, background claim may fail. If you receive
  65. Service_ClaimFIQinBackground (&47), you are the current FIQ owner, and you are
  66. not due to receive a FIQ, then the service should be claimed, after you have
  67. relinquished FIQ as usual.
  68.  
  69. Background claims are released by Service_ReleaseFIQ, as before.
  70.