home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.sun.misc:3647 comp.sys.sun.hardware:3837
- Path: sparky!uunet!snorkelwacker.mit.edu!ai-lab!life!misha
- From: misha@ai.mit.edu (Mike Bolotski)
- Newsgroups: comp.sys.sun.misc,comp.sys.sun.hardware
- Subject: S-Bus device driver question
- Message-ID: <MISHA.92Aug12193338@espresso.ai.mit.edu>
- Date: 12 Aug 92 23:33:38 GMT
- Sender: news@ai.mit.edu
- Followup-To: comp.sys.sun.misc
- Organization: MIT Artificial Intelligence Laboratory
- Lines: 40
-
-
- Forwarded for a friend at the AI Lab:
-
- --------
-
- I'm trying to write a simple device driver for a memory mapped
- sbus-peripheral. I am trying to understand how the device specific xxmmap
- fits in with relation to mmap and unmap. Particularly, I don't understand
- why there is no xxunmap routine.
-
-
-
- My peripheral has a potentially large address space (e.g. the
- entire 25 bits provided on early S-Busses). Experience has shown that I
- cannot simply map the entire region once since that requires too much space
- in the kernel and hence panics/crashes the machine. So, I understand that
- I need to map and unmap regions as I need access to them. Ok, I have
- written an xxmmap routing, which I understand will be called once by mmap
- for each page that needs allocating. My user program then calls mmap and
- munmap. However, after running for a while, the machine panics and crashes
- do to insufficient space in some kernel map table.
-
- In my xx_mmap routine, I am using map_regs to map the sbus physical
- address into a kernel address and hat_getkpfnum to get an address to return
- to the user program. This generally seems to have the desired effect.
- However, I note that there is an unmap_regs routine, which one might want
- called to release mappings. However, since there is no xx_munmap routine,
- I don't seem to have a hook which allows me to umap_regs when the user
- level program does a munmap.
-
- I guess I am misunderstanding something about the way sbus device
- drivers should be written. What is the right thing to do here?
-
- Andre'
- andre@ai.mit.edu
-
- ------
- --
- Mike Bolotski MIT Artificial Intelligence Laboratory
- misha@ai.mit.edu Cambridge, MA 02139 (617) 253-8170
-