Changeset 440 for trunk/kernel/devices
- Timestamp:
- May 3, 2018, 5:51:22 PM (7 years ago)
- Location:
- trunk/kernel/devices
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/devices/dev_fbf.c
r438 r440 119 119 ////////////////////////////////////////////////////////////////////////////////// 120 120 // This static function is called by dev_fbf_read() & dev_fbf_write() functions. 121 // It builds and registers the command in the calling thread descriptor, after 122 // translation of buffer virtual address to physical address. 123 // Then, it registers the calling thead in the relevant DMA chdev waiting queue. 121 // It builds and registers the command in the calling thread descriptor. 122 // Then, it registers the calling thread in the relevant DMA chdev waiting queue. 124 123 // Finally it blocks on the THREAD_BLOCKED_DEV condition and deschedule. 125 124 ////////////////////////////////////i///////////////////////////////////////////// … … 129 128 uint32_t offset ) 130 129 { 131 error_t error;132 paddr_t buf_paddr;133 134 thread_t * this = CURRENT_THREAD; // pointer on client thread135 136 // Get buffer physical address137 error = vmm_v2p_translate( CONFIG_KERNEL_IDENTITY_MAP , buffer , &buf_paddr );138 139 // check buffer is mapped140 assert( (error == 0) , __FUNCTION__ ,141 "cannot translate vaddr = %p in process %x\n", buffer, this->process->pid );142 130 143 131 // get extended pointer on FBF chdev descriptor … … 160 148 161 149 // compute extended pointers on frame buffer and memory buffer 162 xptr_t mem_buf_xp = XPTR( local_cxy , (void *)(intptr_t)buf_paddr );150 xptr_t mem_buf_xp = XPTR( local_cxy , buffer ); 163 151 xptr_t fbf_buf_xp = base + offset; 164 152 -
trunk/kernel/devices/dev_ioc.c
r438 r440 91 91 // This static function is called by dev_ioc_read() & dev_ioc_write() functions. 92 92 // It builds and registers the command in the calling thread descriptor. 93 // Then, it registers the calling thead in chdev waiting queue.93 // Then, it registers the calling thead in IOCchdev waiting queue. 94 94 // Finally it blocks on the THREAD_BLOCKED_IO condition and deschedule. 95 95 ////////////////////////////////////i///////////////////////////////////////////// -
trunk/kernel/devices/dev_mmc.c
r438 r440 57 57 58 58 ///////////////////////////////////////////////////////////////////////////// 59 // This static function is called by all MMC device functions.59 // This static function is called by all MMC device access functions. 60 60 // It makes some checking, takes the lock granting exclusive 61 61 // access to MMC peripheral, call the driver to execute the command … … 71 71 // get MMC device cluster identifier & local pointer 72 72 cxy_t dev_cxy = GET_CXY( dev_xp ); 73 chdev_t * dev_ptr = (chdev_t *)GET_PTR( dev_xp );73 chdev_t * dev_ptr = GET_PTR( dev_xp ); 74 74 75 75 // get driver command function pointer from MMC device descriptor … … 97 97 98 98 // get calling thread local pointer 99 thread_t * this= CURRENT_THREAD;99 thread_t * this = CURRENT_THREAD; 100 100 101 101 #if DEBUG_DEV_MMC … … 113 113 "buffer not aligned on cache line" ); 114 114 115 // get buffer physical address116 paddr_t buf_paddr;117 error = vmm_v2p_translate( CONFIG_KERNEL_IDENTITY_MAP , buf_ptr , &buf_paddr );118 119 assert( (error == 0) , __FUNCTION__ , "cannot get buffer paddr" );120 121 115 // store command arguments in thread descriptor 122 116 this->mmc_cmd.dev_xp = chdev_dir.mmc[buf_cxy]; 123 117 this->mmc_cmd.type = MMC_CC_INVAL; 124 this->mmc_cmd.buf_p addr = buf_paddr;118 this->mmc_cmd.buf_ptr = buf_ptr; 125 119 this->mmc_cmd.buf_size = buf_size; 126 120 … … 144 138 error_t error; 145 139 146 // get calling thread local pointer 147 thread_t * this = CURRENT_THREAD; 140 thread_t * this = CURRENT_THREAD; 148 141 149 142 #if DEBUG_DEV_MMC … … 161 154 "buffer not aligned on cache line" ); 162 155 163 // get buffer physical address164 paddr_t buf_paddr;165 error = vmm_v2p_translate( CONFIG_KERNEL_IDENTITY_MAP , buf_ptr , &buf_paddr );166 167 assert( (error == 0) , __FUNCTION__ , "cannot get buffer paddr" );168 169 156 // store command arguments in thread descriptor 170 157 this->mmc_cmd.dev_xp = chdev_dir.mmc[buf_cxy]; 171 158 this->mmc_cmd.type = MMC_CC_SYNC; 172 this->mmc_cmd.buf_p addr = buf_paddr;159 this->mmc_cmd.buf_ptr = buf_ptr; 173 160 this->mmc_cmd.buf_size = buf_size; 174 161 -
trunk/kernel/devices/dev_mmc.h
r437 r440 83 83 xptr_t dev_xp; /*! extended pointer on target MMC device descriptor */ 84 84 uint32_t type; /*! CC_INVAL / CC_SYNC / GET_ERROR / SET_ERROR / GET_INSTRU */ 85 paddr_t buf_paddr; /*! physical address of memory buffer(used by INVAL/SYNC) */86 uint32_t buf_size; /*! buffer size in bytes(used by INVAL/SYNC) */85 void * buf_ptr; /*! local pointer on memory buffer (used by INVAL/SYNC) */ 86 uint32_t buf_size; /*! memory buffer size (bytes) (used by INVAL/SYNC) */ 87 87 uint32_t reg_index; /*! register index in MMC peripheral (used by SET/GET) */ 88 88 uint32_t * reg_ptr; /*! local pointer on src/dst buffer (used by SET/GET) */
Note: See TracChangeset
for help on using the changeset viewer.