home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / sun / misc / 3647 < prev    next >
Encoding:
Internet Message Format  |  1992-08-12  |  2.1 KB

  1. Xref: sparky comp.sys.sun.misc:3647 comp.sys.sun.hardware:3837
  2. Path: sparky!uunet!snorkelwacker.mit.edu!ai-lab!life!misha
  3. From: misha@ai.mit.edu (Mike Bolotski)
  4. Newsgroups: comp.sys.sun.misc,comp.sys.sun.hardware
  5. Subject: S-Bus device driver  question
  6. Message-ID: <MISHA.92Aug12193338@espresso.ai.mit.edu>
  7. Date: 12 Aug 92 23:33:38 GMT
  8. Sender: news@ai.mit.edu
  9. Followup-To: comp.sys.sun.misc
  10. Organization: MIT Artificial Intelligence Laboratory
  11. Lines: 40
  12.  
  13.  
  14. Forwarded for a friend at the AI Lab:
  15.  
  16. --------
  17.  
  18.     I'm trying to write a simple device driver for a memory mapped
  19. sbus-peripheral.  I am trying to understand how the device specific xxmmap
  20. fits in with relation to mmap and unmap.  Particularly, I don't understand
  21. why there is no xxunmap routine.
  22.  
  23.  
  24.  
  25.     My peripheral has a potentially large address space (e.g. the
  26. entire 25 bits provided on early S-Busses).  Experience has shown that I
  27. cannot simply map the entire region once since that requires too much space
  28. in the kernel and hence panics/crashes the machine.  So, I understand that
  29. I need to map and unmap regions as I need access to them.  Ok, I have
  30. written an xxmmap routing, which I understand will be called once by mmap
  31. for each page that needs allocating.  My user program then calls mmap and
  32. munmap.  However, after running for a while, the machine panics and crashes
  33. do to insufficient space in some kernel map table.
  34.  
  35.     In my xx_mmap routine, I am using map_regs to map the sbus physical
  36. address into a kernel address and hat_getkpfnum to get an address to return
  37. to the user program.  This generally seems to have the desired effect.
  38. However, I note that there is an unmap_regs routine, which one might want
  39. called to release mappings.  However, since there is no xx_munmap routine,
  40. I don't seem to have a hook which allows me to umap_regs when the user
  41. level program does a munmap.
  42.  
  43.     I guess I am misunderstanding something about the way sbus device
  44. drivers should be written.  What is the right thing to do here?  
  45.  
  46.      Andre'
  47.      andre@ai.mit.edu
  48.  
  49. ------
  50. --
  51. Mike Bolotski          MIT Artificial Intelligence Laboratory
  52. misha@ai.mit.edu       Cambridge, MA 02139     (617) 253-8170
  53.