Changeset 481 for soft/giet_vm/giet_drivers/hba_driver.c
- Timestamp:
- Jan 1, 2015, 8:23:48 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/hba_driver.c
r456 r481 173 173 174 174 // get ppn and flags 175 ko =_v2p_translate( (page_table_t*)user_pt_vbase,176 177 178 175 _v2p_translate( (page_table_t*)user_pt_vbase, 176 vpn, 177 &ppn, 178 &flags ); 179 179 180 180 // check access rights 181 if ( ko )182 {183 _puts("[GIET ERROR] in _hba_set_cmd() : user buffer unmapped\n");184 return -1;185 }186 181 if ((flags & PTE_U) == 0) 187 182 { … … 261 256 unsigned int ppn; 262 257 unsigned int flags; 263 unsigned int fail;264 258 unsigned int vbase; 265 259 unsigned int c; // c == command index … … 281 275 // Command list physical addresse 282 276 vbase = (unsigned int)(&hba_cmd_list[channel]); 283 fail = _v2p_translate( (page_table_t*)pt, 284 vbase>>12, 285 &ppn, 286 &flags ); 287 if ( fail ) 288 { 289 _puts("[GIET ERROR] in _hba_init() : command list unmapped\n"); 290 return -1; 291 } 277 _v2p_translate( (page_table_t*)pt, 278 vbase>>12, 279 &ppn, 280 &flags ); 292 281 hba_cmd_list_paddr[channel] = ((paddr_t)ppn) | (vbase & 0xFFF); 293 282 … … 296 285 { 297 286 vbase = (unsigned int)(&hba_cmd_table[channel][c]); 298 fail = _v2p_translate( (page_table_t*)pt, 299 vbase>>12, 300 &ppn, 301 &flags ); 302 if ( fail ) 303 { 304 _puts("[GIET ERROR] in _hba_init() : command table unmapped\n"); 305 return -1; 306 } 287 _v2p_translate( (page_table_t*)pt, 288 vbase>>12, 289 &ppn, 290 &flags ); 307 291 hba_cmd_table_paddr[channel][c] = ((paddr_t)ppn) | (vbase & 0xFFF); 308 292 }
Note: See TracChangeset
for help on using the changeset viewer.