Changeset 396 for soft/giet_vm/giet_kernel/sys_handler.c
- Timestamp:
- Aug 12, 2014, 10:43:18 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/sys_handler.c
r322 r396 20 20 #include <fat32.h> 21 21 #include <utils.h> 22 #include <vmem.h> 22 23 #include <hard_config.h> 23 24 #include <giet_config.h> … … 62 63 &_context_switch, /* 0x19 */ 63 64 &_vobj_get_vbase, /* 0x1A */ 64 &_ sys_ukn,/* 0x1B */65 &_get_xy_from_ptr, /* 0x1B */ 65 66 &_nic_cma_start, /* 0x1C */ 66 67 &_nic_cma_stop, /* 0x1D */ … … 257 258 } 258 259 260 ///////////////////////////////////////////////////////////////////////////// 261 // This function returns in the (x,y) arguments the coordinates of the 262 // where is mapped the ptr virtual address. It use the _get_context_slot() 263 // function to get the calling task page table, and uses the _v2p_translate() 264 // function to obtain the physical address. 265 // returns 0 if success, > 0 if ptr not mapped in the calling task vspace. 266 ///////////////////////////////////////////////////////////////////////////// 267 268 unsigned int _get_xy_from_ptr( void* ptr, 269 unsigned int* px, 270 unsigned int* py ) 271 { 272 unsigned int ret; 273 unsigned int ppn; 274 unsigned int flags; 275 unsigned int vpn = (((unsigned int)ptr)>>12); 276 277 // get the page table pointer 278 page_table_t* pt = (page_table_t*)_get_context_slot( CTX_PTAB_ID ); 279 280 // compute the physical address 281 if ( (ret = _v2p_translate( pt, vpn, &ppn, &flags )) ) 282 { 283 return ret; 284 } 285 286 *px = (ppn>>24) & 0xF; 287 *py = (ppn>>20) & 0xF; 288 return 0; 289 } 290 259 291 //////////////////////////////////////////////////////////////////////////// 260 292 // This sysrem function deschedule the requestint task.
Note: See TracChangeset
for help on using the changeset viewer.