Changeset 396 for soft/giet_vm
- Timestamp:
- Aug 12, 2014, 10:43:18 AM (10 years ago)
- Location:
- soft/giet_vm/giet_kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_kernel/ctx_handler.h
r391 r396 79 79 80 80 #define IDLE_TASK_INDEX 13 81 #define IDLE_TASK_STACK 0x100082 81 83 82 ///////////////////////////////////////////////////////////////////////////////// -
soft/giet_vm/giet_kernel/kernel_init.c
r391 r396 103 103 #endif 104 104 105 #if !defined(IDLE_TASK_STACK)106 # error: You must define IDLE_TASK_STACK in the ctx_handler.h file107 #endif108 109 105 #if !defined(GIET_TICK_VALUE) 110 106 # error: You must define GIET_TICK_VALUE in the giet_config.h file -
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. -
soft/giet_vm/giet_kernel/sys_handler.h
r294 r396 42 42 unsigned int* vobj_length ); 43 43 44 unsigned int _get_xy_from_ptr( void* ptr, 45 unsigned int* x, 46 unsigned int* y ); 47 48 44 49 #endif 45 50
Note: See TracChangeset
for help on using the changeset viewer.