Changeset 160 for soft/giet_vm/sys/sys_handler.c
- Timestamp:
- Jun 12, 2012, 4:21:27 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/sys/sys_handler.c
r158 r160 12 12 13 13 #include <sys_handler.h> 14 #include <boot_handler.h>14 //#include <boot_handler.h> 15 15 #include <drivers.h> 16 16 #include <ctx_handler.h> … … 49 49 &_sys_ukn, /* 0x18 */ 50 50 &_sys_ukn, /* 0x19 */ 51 &_ mwmr_base,/* 0x1A */51 &_vobj_get_vbase, /* 0x1A */ 52 52 &_sys_ukn, /* 0x1B */ 53 53 &_sys_ukn, /* 0x1C */ … … 117 117 unsigned int* buffer) 118 118 { 119 mapping_header_t* header = (mapping_header_t*)&seg_ boot_mapping_base;119 mapping_header_t* header = (mapping_header_t*)&seg_mapping_base; 120 120 mapping_cluster_t* cluster = _get_cluster_base( header ); 121 121 … … 131 131 } 132 132 ///////////////////////////////////////////////////////////////////////////// 133 // _mwmr_base() 134 // returns in buffer argument the base address of the MWMR channel 135 // identified by the (vspace_name / channel_name) couple. 133 // _vobj_get_base() 134 // returns 0: success, else: failed. 135 // give access to the base address of a vobj identified by the (vspace_name / channel_name ) couple. 136 // The "type" argument is here for checking purpose. 136 137 ///////////////////////////////////////////////////////////////////////////// 137 unsigned int _mwmr_base( char* vspace_name, 138 char* channel_name, 139 unsigned int* buffer ) 138 unsigned int _vobj_get_vbase( char* vspace_name, char* vobj_name, 139 unsigned vobj_type, unsigned int* vobj_buffer) 140 140 { 141 mapping_header_t* header = (mapping_header_t*)&seg_ boot_mapping_base;141 mapping_header_t* header = (mapping_header_t*)&seg_mapping_base; 142 142 mapping_vspace_t* vspace = _get_vspace_base( header ); 143 mapping_v seg_t* vseg = _get_vseg_base( header );143 mapping_vobj_t* vobj = _get_vobj_base( header ); 144 144 145 145 unsigned int vspace_id; 146 unsigned int vseg_id; 146 unsigned int vobj_id; 147 147 148 148 149 // scan vspaces … … 151 152 if ( _strncmp( vspace[vspace_id].name, vspace_name, 31) == 0 ) 152 153 { 153 // scan vsegs 154 for ( vseg_id = vspace[vspace_id].vseg_offset ; 155 vseg_id < (vspace[vspace_id].vseg_offset + vspace[vspace_id].vsegs) ; 156 vseg_id++ ) 154 // scan vobjs 155 for(vobj_id= vspace[vspace_id].vobj_offset; vobj_id < (vspace[vspace_id].vobj_offset + vspace[vspace_id].vobjs); vobj_id++) 157 156 { 158 if ( _strncmp( vseg[vseg_id].name, channel_name, 31) == 0 ) 157 158 if ( _strncmp( vobj[vobj_id].name, vobj_name, 31) == 0 ) 159 159 { 160 *buffer = vseg[vseg_id].vbase; 160 if(vobj[vobj_id].type != vobj_type) 161 return -1;//wrong type 162 163 *vobj_buffer = (unsigned int)vobj[vobj_id].vaddr; 161 164 return 0; 162 165 } … … 165 168 } 166 169 // not found !!! 167 return 1;170 return -2; 168 171 } 169 172
Note: See TracChangeset
for help on using the changeset viewer.