home *** CD-ROM | disk | FTP | other *** search
-
-
-
- uuuunnnnmmmmaaaapppp((((DDDD2222XXXX)))) uuuunnnnmmmmaaaapppp((((DDDD2222XXXX))))
-
-
-
- NNNNAAAAMMMMEEEE
- _uuuu_nnnn_mmmm_aaaa_pppp - support virtual unmapping for memory-mapped device
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_mmmm_mmmm_aaaa_nnnn_...._hhhh_>>>>
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_dddd_dddd_iiii_...._hhhh_>>>>
- _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_kkkk_ssss_yyyy_ssss_////_dddd_dddd_mmmm_aaaa_pppp_...._hhhh_>>>>
-
- _iiii_nnnn_tttt _p_r_e_f_i_x_uuuu_nnnn_mmmm_aaaa_pppp_((((_dddd_eeee_vvvv______tttt _d_e_v_,,,, _vvvv_hhhh_aaaa_nnnn_dddd_llll______tttt _****_v_t_))))_;;;;
-
- AAAArrrrgggguuuummmmeeeennnnttttssss
- _d_e_v Device whose memory is to be mapped.
-
- _v_t Handle to caller's virtual address space
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- To unmap a device, the user program calls _mmmm_uuuu_nnnn_mmmm_aaaa_pppp(2) system call. After
- performing device-independent unmapping in the user's space, the _mmmm_uuuu_nnnn_mmmm_aaaa_pppp
- system call calls the driver's _p_r_e_ffff_iiii_xxxx_uuuu_nnnn_mmmm_aaaa_pppp to remove the mapping.
-
- RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
- On success, 0 is returned. An error number is returned on failure.
-
- UUUUSSSSAAAAGGGGEEEE
- If a driver provides a _mmmm_aaaa_pppp(D2X) routine but does not provide an unmapping
- routine, the _mmmm_uuuu_nnnn_mmmm_aaaa_pppp system call returns the _E_N_O_D_E_V error condition to the
- user. Therefore, it is a good idea for all drivers to provide a dummy
- unmapping routine even if your driver does not need to perform any action
- to unmap the device.
-
- SSSSyyyynnnncccchhhhrrrroooonnnniiiizzzzaaaattttiiiioooonnnn CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss
- The _uuuu_nnnn_mmmm_aaaa_pppp routine has user context and can sleep.
-
- There are significant restrictions imposed on _u_n_m_a_p routines that affect
- drivers that perform their own synchronization. When the _u_n_m_a_p function
- is called, the address space for the process that is doing the call is
- locked. When an address space is locked, no other mapping or unmapping
- can take place and NO page faults can be serviced for the process. This
- can cause problems if the process is multi-threaded - one thread can be
- attempting to unmap the device and another thread can be accessing the
- driver through some other entry point (e.g. _i_o_c_t_l). If the thread that
- is accessing the driver via _i_o_c_t_l locks a driver specific lock, and then
- calls e.g. _cccc_oooo_pppp_yyyy_iiii_nnnn, and if the data to be copied in causes a page fault,
- then the page fault code will attempt to lock the address space lock. If,
- at the same time, another thread is attempting to _u_n_m_a_p the device, and
- the _u_n_m_a_p routine grabs the driver lock, an AB-BA deadlock can occur
- which will require re-booting the system to clear. The safest way around
- this is to make sure that the driver never calls _cccc_oooo_pppp_yyyy_iiii_nnnn or _cccc_oooo_pppp_yyyy_oooo_uuuu_tttt while
- holding a driver lock and is used by the _u_n_m_a_p routine.
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- uuuunnnnmmmmaaaapppp((((DDDD2222XXXX)))) uuuunnnnmmmmaaaapppp((((DDDD2222XXXX))))
-
-
-
- RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS
- _mmmm_aaaa_pppp(D2X), _vvvv______gggg_eeee_tttt_aaaa_dddd_dddd_rrrr(D3X), _vvvv______gggg_eeee_tttt_llll_eeee_nnnn(D3X), _vvvv______gggg_eeee_tttt_hhhh_aaaa_nnnn_dddd_llll_eeee(D3X), _vvvv______mmmm_aaaa_pppp_pppp_hhhh_yyyy_ssss(D3X)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-