Changeset 215 for soft/giet_vm/sys/sys_handler.c
- Timestamp:
- Sep 17, 2012, 10:47:46 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/sys/sys_handler.c
r207 r215 139 139 } 140 140 141 ///////////////////////////////////////////////////////////////////////////// 142 // _vobj_get_vbase() 143 // This function writes in vobj_buffer the virtual base address of a vobj 144 // identified by the (vspace_name / vobj_name ) couple. 145 // The vobj_type argument is redundant, and for checking purpose. 146 // returns 0: success, else: failed. 147 ///////////////////////////////////////////////////////////////////////////// 148 unsigned int _vobj_get_vbase( char* vspace_name, 149 char* vobj_name, 150 unsigned int vobj_type, 151 unsigned int* vobj_vaddr ) 141 int _get_vobj( char* vspace_name, char* vobj_name, unsigned int vobj_type, mapping_vobj_t** res_vobj) 152 142 { 153 143 mapping_header_t* header = (mapping_header_t*)&seg_mapping_base; … … 175 165 return -1; //wrong type 176 166 177 *vobj_vaddr = (unsigned int)vobj[vobj_id].vaddr; 167 *res_vobj = &vobj[vobj_id]; 168 178 169 return 0; 179 170 } … … 182 173 } 183 174 return -2; //not found 184 } 185 175 176 } 177 ///////////////////////////////////////////////////////////////////////////// 178 // _vobj_get_vbase() 179 // This function writes in vobj_vaddr the virtual base address of a vobj 180 // identified by the (vspace_name / vobj_name ) couple. 181 // The vobj_type argument is here only for the purpose of checking . 182 // returns 0: success, else: failed. 183 ///////////////////////////////////////////////////////////////////////////// 184 unsigned int _vobj_get_vbase( char* vspace_name, 185 char* vobj_name, 186 unsigned int vobj_type, 187 unsigned int* vobj_vaddr ) 188 { 189 mapping_vobj_t* res_vobj; 190 unsigned int ret; 191 if( (ret = _get_vobj(vspace_name, vobj_name, vobj_type, &res_vobj)) ) 192 { 193 return ret; 194 } 195 196 *vobj_vaddr = res_vobj->vaddr; 197 198 return 0; 199 } 200 201 ///////////////////////////////////////////////////////////////////////////// 202 // _vobj_get_length() 203 // This function writes in vobj_length the virtual base address of a vobj 204 // identified by the (vspace_name / vobj_name ) couple. 205 // The vobj_type argument is here only for the purpose of checking . 206 // returns 0: success, else: failed. 207 ///////////////////////////////////////////////////////////////////////////// 208 unsigned int _vobj_get_length(char* vspace_name, 209 char* vobj_name, 210 unsigned int vobj_type, 211 unsigned int* vobj_length ) 212 { 213 214 mapping_vobj_t* res_vobj; 215 unsigned int ret; 216 if( (ret = _get_vobj(vspace_name, vobj_name, vobj_type, &res_vobj)) ) 217 { 218 return ret; 219 } 220 221 *vobj_length = res_vobj->length; 222 223 return 0; 224 }
Note: See TracChangeset
for help on using the changeset viewer.