Changeset 175
- Timestamp:
- Jul 21, 2012, 10:20:47 AM (12 years ago)
- Location:
- soft/giet_vm
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/Makefile
r166 r175 51 51 CFLAGS=-Wall -ffreestanding -mno-gpopt -mips32 -g 52 52 53 SYS_INCLUDE = -I$(SYS_PATH) -I$(MAP_PATH) -I$(LIB_PATH) -I. 54 53 SYS_INCLUDE = -I$(SYS_PATH) -I$(MAP_PATH) -I$(LIB_PATH) -I. 55 54 BOOT_INCLUDE = -I$(BOOT_PATH) -I$(MAP_PATH) -I$(LIB_PATH) -I. 56 57 INCLUDE = -I$(LIB_PATH) -I$(SOFT_PATH) -I$(SYS_PATH)-I$(MAP_PATH)55 LIB_INCLUDE = -I$(LIB_PATH) -I$(MAP_PATH) 56 INCLUDE = -I$(LIB_PATH) -I$(MAP_PATH) 58 57 59 58 TRASH= /dev/null||true … … 71 70 ## prepare the environement 72 71 prepare: 73 @mkdir $(BUILD_PATH) 2>$(TRASH) 74 @mkdir $(ELF_PATH) 2>$(TRASH) 72 @mkdir $(BUILD_PATH) 2>$(TRASH) 73 @mkdir $(ELF_PATH) 2>$(TRASH) 74 @mkdir $(BUILD_PATH)/$(BOOT_NAME) 2>$(TRASH) 75 @mkdir $(BUILD_PATH)/$(LIB_NAME) 2>$(TRASH) 76 @mkdir $(BUILD_PATH)/$(SYS_NAME) 2>$(TRASH) 75 77 76 78 ## mapping compilation … … 85 87 86 88 $(SYS_NAME)/%.o: $(SYS_NAME)/%.c 87 @mkdir $(BUILD_PATH)/$(SYS_NAME) 2>$(TRASH)88 89 $(CC) $(SYS_INCLUDE) $(CFLAGS) -c -o $(BUILD_PATH)/$@ $< 89 90 90 91 $(SYS_NAME)/%.o: $(SYS_NAME)/%.s 91 @mkdir $(BUILD_PATH)/$(SYS_NAME) 2>$(TRASH)92 92 $(CC) $(SYS_INCLUDE) $(CFLAGS) -c -o $(BUILD_PATH)/$@ $< 93 93 94 94 $(SYS_NAME)/%.o: $(SYS_NAME)/%.S 95 @mkdir $(BUILD_PATH)/$(SYS_NAME) 2>$(TRASH)96 95 $(CC) $(SYS_INCLUDE) $(CFLAGS) -c -o $(BUILD_PATH)/$@ $< 97 96 … … 102 101 103 102 $(BOOT_NAME)/%.o: $(BOOT_NAME)/%.c 104 @mkdir $(BUILD_PATH)/$(BOOT_NAME) 2>$(TRASH)105 103 $(CC) $(BOOT_INCLUDE) $(CFLAGS) -c -o $(BUILD_PATH)/$@ $< 106 104 107 105 $(BOOT_NAME)/%.o: $(BOOT_NAME)/%.s 108 @mkdir $(BUILD_PATH)/$(BOOT_NAME) 2>$(TRASH)109 106 $(CC) $(BOOT_INCLUDE) $(CFLAGS) -c -o $(BUILD_PATH)/$@ $< 110 107 111 108 $(BOOT_NAME)/%.o: $(BOOT_NAME)/%.S 112 @mkdir $(BUILD_PATH)/$(BOOT_NAME) 2>$(TRASH)113 109 $(CC) $(BOOT_INCLUDE) $(CFLAGS) -c -o $(BUILD_PATH)/$@ $< 114 110 115 111 ##libs compilation 116 112 $(LIB_NAME)/%.o: $(LIB_NAME)/%.c 117 @mkdir $(BUILD_PATH)/$(LIB_NAME) 2>$(TRASH) 118 $(CC) $(CFLAGS) $(INCLUDE) -c -o $(BUILD_PATH)/$@ $< 113 $(CC) $(CFLAGS) $(LIB_INCLUDE) -c -o $(BUILD_PATH)/$@ $< 119 114 120 115 ## applications … … 126 121 clean: 127 122 rm -f *.o *.elf *.bin *.txt core *~ 2>$(TRASH) 128 $(MAKE) clean -C xml/ 2>$(TRASH)129 $(MAKE) clean -C memo/ 2>$(TRASH)123 $(MAKE) -s clean -C xml/ 2>$(TRASH) 124 $(MAKE) -s clean -C memo/ 2>$(TRASH) 130 125 rm -r $(BUILD_PATH) 2>$(TRASH) 131 126 set -e; for d in $(APP_DIRS); do $(MAKE) clean -C $$d ; done -
soft/giet_vm/apps/router/Makefile
r165 r175 2 2 3 3 USE+= stdio.o 4 USE+= common.o 4 5 USE+= mwmr_channel.o 5 6 -
soft/giet_vm/giet_config.h
r173 r175 12 12 /* Debug parameters */ 13 13 14 #define BOOT_DEBUG_VIEW 1/* display the mapping_info on system TTY */15 #define BOOT_DEBUG_PT 1/* display the page tables after mapping */16 #define INIT_DEBUG_CTX 1/* display the task contexts after mapping */17 #define GIET_DEBUG_SWITCH 1/* Trace context switchs */14 #define BOOT_DEBUG_VIEW 0 /* display the mapping_info on system TTY */ 15 #define BOOT_DEBUG_PT 0 /* display the page tables after mapping */ 16 #define INIT_DEBUG_CTX 0 /* display the task contexts after mapping */ 17 #define GIET_DEBUG_SWITCH 0 /* Trace context switchs */ 18 18 19 19 -
soft/giet_vm/libs/common.c
r160 r175 1 2 //////////////////////////////////////////////////////////////////////////////////////// 3 // mempcy() 4 // GCC requires this function. Taken from MutekH. 5 //////////////////////////////////////////////////////////////////////////////////////// 1 ///////////////////////////////////////////////////////////// 6 2 void *memcpy(void *_dst, const void *_src, unsigned int size) 7 3 { … … 23 19 } 24 20 25 //////////////////////////////////////////////////////////////////////////////////////// 26 // mempcy() 27 // GCC requires this function. Taken from MutekH. 28 //////////////////////////////////////////////////////////////////////////////////////// 21 ////////////////////////////////////////////////////////// 29 22 inline void * memset(void *dst, int s, unsigned int count) 30 23 { -
soft/giet_vm/libs/libsrl/srl_hw_helpers.h
r160 r175 63 63 */ 64 64 65 65 //static: to avoid multiple definition error 66 66 static inline unsigned int srl_cycle_count() 67 67 { 68 return proctime();68 return giet_proctime(); 69 69 } 70 70 … … 79 79 } 80 80 81 /** 82 * 83 */ 84 static inline void srl_exit() 85 { 86 giet_exit(); 87 } 88 81 89 #endif -
soft/giet_vm/libs/libsrl/srl_log.h
r160 r175 48 48 #define srl_log( l, c ) do { \ 49 49 if (GET_VERB(l) <= GET_VERB(CONFIG_SRL_VERBOSITY)) { \ 50 tty_printf(c); \50 giet_tty_printf(c); \ 51 51 } \ 52 52 } while (0) … … 60 60 #define srl_log_printf( l, ... ) do { \ 61 61 if (GET_VERB(l) <= GET_VERB(CONFIG_SRL_VERBOSITY)) { \ 62 tty_printf(__VA_ARGS__); \62 giet_tty_printf(__VA_ARGS__); \ 63 63 } \ 64 64 } while (0) -
soft/giet_vm/libs/libsrl/srl_mwmr.h
r160 r175 2 2 #define SRL_MWMR_H_ 3 3 4 #include "mwmr .h"4 #include "mwmr_channel.h" 5 5 6 #define srl_mwmr_t mwmr_channel_t* 6 typedef mwmr_channel_t* srl_mwmr_t; 7 7 8 8 #define srl_mwmr_write mwmr_write -
soft/giet_vm/libs/mwmr_channel.c
r165 r175 33 33 #include <mwmr_channel.h> 34 34 #include <stdio.h> 35 #include <common.h> 35 36 36 37 ////////////////////////////////////////////////////////////////////////////// … … 85 86 unsigned int ptw; // channel ptw 86 87 88 if(nitems == 0) 89 return; 90 91 assert(buffer && "mwmr write: Empty buffer"); 92 87 93 while(1) 88 94 { … … 118 124 else // write as many items as possible, release lock and retry after delay 119 125 { 120 nwords = (spaces/width) * width; // integer n mber of items126 nwords = (spaces/width) * width; // integer number of items 121 127 for ( x = 0 ; x < nwords ; x++ ) 122 128 { … … 157 163 unsigned int ptr; // channel ptw 158 164 165 if(nitems == 0) 166 return; 167 168 assert(buffer && "mwmr read: Empty buffer"); 169 159 170 while(1) 160 171 { -
soft/giet_vm/libs/srl.h
r160 r175 22 22 //#include "libsrl/srl_mwmr_sys.h" 23 23 24 /* port, APP_NAME, TASK */ 25 # define GET_MWMR(port) \ 24 #define GET_MWMR(port) GET_ARG(port, VOBJ_TYPE_MWMR) 25 /* port, APP_NAME, TASK, #task_name, alias */ 26 # define SRL_GET_ARG(task_name, port, type) \ 26 27 ({ \ 27 srl_mwmr_t 28 if( vobj_get_vbase( APP_NAME , #port, MWMR, (unsigned int*)&_mwmr ) ) \28 srl_mwmr_t _mwmr; \ 29 if( giet_vobj_get_vbase( APP_NAME , alias_##task_name.port, type, (unsigned int*)&_mwmr ) ) \ 29 30 { \ 30 srl_log_printf( NONE, "\n[ERROR] in " TASK" task :\n"); \31 srl_log_printf( NONE, " undefined <"#port"> channel: %d\n",_mwmr); \31 srl_log_printf( NONE, "\n[ERROR] in "#task_name" task :\n"); \ 32 srl_log_printf( NONE, " undefined port <"#port"> for channel(%s): %d\n", alias_##task_name.port,_mwmr); \ 32 33 srl_log_printf( TRACE, "*** &"#port" = %x\n\n", (unsigned int)_mwmr ); \ 33 exit();/*srl?*/\34 srl_exit(); \ 34 35 }else \ 35 srl_log_printf( TRACE, "%s:%d: arg of %s for %s,from %s; &"#port" = %x\n\n", __FILE__, __LINE__, APP_NAME, TASK,#port, (unsigned int)_mwmr ); \36 srl_log_printf( TRACE, "%s:%d: arg of %s for %s,from %s; &"#port" = %x\n\n", __FILE__, __LINE__, APP_NAME, #task_name,#port, (unsigned int)_mwmr ); \ 36 37 _mwmr;\ 37 38 }) 38 39 40 41 42 39 43 #endif 40 44 -
soft/giet_vm/map.xml
r173 r175 269 269 <vobj name = "mwmr_in" 270 270 type = "MWMR" 271 length = "0x00000020" /> 271 length = "0x00000020" 272 init = "1" /> 272 273 <vobj name = "mwmr_out" 273 274 type = "MWMR" 274 length = "0x00000020" /> 275 length = "0x00000020" 276 init = "1" /> 275 277 </vseg> 276 278 -
soft/giet_vm/sys/kernel_init.c
r169 r175 5 5 // Copyright (c) UPMC-LIP6 6 6 //////////////////////////////////////////////////////////////////////////////////// 7 // FIXME 7 8 // The kernel_init.c files is part of the GIET-VM nano-kernel. 8 9 // It contains the kernel entry point for the second phase of system initialisation: … … 42 43 /////////////////////////////////////////////////////////////////////////////////// 43 44 45 void _kernel_ptabs_init(void); 44 46 void _kernel_vobjs_init(void); 45 47 void _kernel_tasks_init(void); … … 64 66 if ( pid == 0 ) 65 67 { 68 _kernel_ptabs_init(); 69 /* must be called after the initialisation of ptabs */ 66 70 _kernel_vobjs_init(); 67 71 _kernel_tasks_init(); … … 150 154 "nop"); 151 155 } 156 157 /////////////////////////////////////////////////////////////////////////////// 158 // used to access user space 159 /////////////////////////////////////////////////////////////////////////////// 160 void _set_ptpr(unsigned int vspace_id) 161 { 162 unsigned int ptpr = ((unsigned int)_kernel_ptabs_paddr[vspace_id]) >> 13; 163 asm volatile("mtc2 %0, $0"::"r"(ptpr)); 164 } 165 166 /////////////////////////////////////////////////////////////////////////////// 167 // This function initialises the _kernel_ptabs_paddr[] array indexed by the vspace_id, 168 // and containing the base addresses of all page tables. 169 // This _kernel_ptabs_paddr[] array is used to initialise the task contexts. 170 /////////////////////////////////////////////////////////////////////////////// 171 in_kinit void _kernel_ptabs_init() 172 { 173 mapping_header_t* header = (mapping_header_t*)&seg_mapping_base; 174 mapping_vspace_t* vspace = _get_vspace_base( header ); 175 mapping_vobj_t* vobj = _get_vobj_base( header ); 176 177 unsigned int vspace_id; 178 unsigned int vobj_id; 179 180 // loop on the vspaces 181 for ( vspace_id = 0 ; vspace_id < header->vspaces ; vspace_id++ ) 182 { 183 char ptab_found = 0; 184 185 #if INIT_DEBUG_CTX 186 _puts("[INIT] --- vobjs initialisation in vspace "); 187 _puts(vspace[vspace_id].name); 188 _puts("\n"); 189 #endif 190 // loop on the vobjs and get the ptpr 191 for(vobj_id= vspace[vspace_id].vobj_offset; 192 vobj_id < (vspace[vspace_id].vobj_offset+ vspace[vspace_id].vobjs); 193 vobj_id++) 194 { 195 if(vobj[vobj_id].type == VOBJ_TYPE_PTAB) 196 { 197 if( ptab_found ) 198 { 199 _puts("\n[INIT ERROR] Only one PTAB for by vspace "); 200 _putw( vspace_id ); 201 _exit(); 202 } 203 204 ptab_found = 1; 205 _kernel_ptabs_paddr[vspace_id] = vobj[vobj_id].paddr; 206 _kernel_ptabs_vaddr[vspace_id] = vobj[vobj_id].vaddr; 207 208 #if INIT_DEBUG_CTX 209 _puts("[INIT] PTAB address = "); 210 _putw(_kernel_ptabs_paddr[vspace_id]); 211 _puts("\n"); 212 #endif 213 } 214 215 } 216 217 if( !ptab_found ) 218 { 219 _puts("\n[INIT ERROR] Missing PTAB for vspace "); 220 _putw( vspace_id ); 221 _exit(); 222 } 223 } 224 225 _puts("\n[INIT] Ptabss initialisation completed at cycle : "); 226 _putw( _proctime() ); 227 _puts("\n"); 228 229 } // end kernel_ptabs_init() 230 231 /////////////////////////////////////////////////////////////////////////////// 232 // This function initializes all private vobjs defined in the vspaces, 233 // such as mwmr channels, barriers and locks, depending on the vobj type. 234 // (Most of the vobjs are not known, and not initialised by the compiler). 235 /////////////////////////////////////////////////////////////////////////////// 236 in_kinit void _kernel_vobjs_init() 237 { 238 mapping_header_t* header = (mapping_header_t*)&seg_mapping_base; 239 mapping_vspace_t* vspace = _get_vspace_base( header ); 240 mapping_vobj_t* vobj = _get_vobj_base( header ); 241 242 unsigned int vspace_id; 243 unsigned int vobj_id; 244 245 // loop on the vspaces 246 for ( vspace_id = 0 ; vspace_id < header->vspaces ; vspace_id++ ) 247 { 248 char ptab_found = 0; 249 250 #if INIT_DEBUG_CTX 251 _puts("[INIT] --- vobjs initialisation in vspace "); 252 _puts(vspace[vspace_id].name); 253 _puts("\n"); 254 #endif 255 // loop on the vobjs and get the ptpr 256 for(vobj_id= vspace[vspace_id].vobj_offset; 257 vobj_id < (vspace[vspace_id].vobj_offset+ vspace[vspace_id].vobjs); 258 vobj_id++) 259 { 260 if(vobj[vobj_id].type == VOBJ_TYPE_PTAB) 261 { 262 if( ptab_found ) 263 { 264 _puts("\n[INIT ERROR] Only one PTAB for by vspace "); 265 _putw( vspace_id ); 266 _exit(); 267 } 268 269 ptab_found = 1; 270 _kernel_ptabs_paddr[vspace_id] = vobj[vobj_id].paddr; 271 _kernel_ptabs_vaddr[vspace_id] = vobj[vobj_id].vaddr; 272 273 #if INIT_DEBUG_CTX 274 _puts("[INIT] PTAB address = "); 275 _putw(_kernel_ptabs_paddr[vspace_id]); 276 _puts("\n"); 277 #endif 278 } 279 280 } 281 282 if( !ptab_found ) 283 { 284 _puts("\n[INIT ERROR] Missing PTAB for vspace "); 285 _putw( vspace_id ); 286 _exit(); 287 } 288 289 /** Set the current vspace ptpr to initialise the vobjs */ 290 _set_ptpr(vspace_id); 291 292 // loop on the vobjs and get the ptpr 293 for(vobj_id= vspace[vspace_id].vobj_offset; 294 vobj_id < (vspace[vspace_id].vobj_offset+ vspace[vspace_id].vobjs); 295 vobj_id++) 296 { 297 switch( vobj[vobj_id].type ) 298 { 299 case VOBJ_TYPE_PTAB: // initialise page table pointers array 300 { 301 break;//already handled 302 } 303 case VOBJ_TYPE_MWMR: // storage capacity is (vobj.length/4 - 5) words 304 { 305 mwmr_channel_t* mwmr = (mwmr_channel_t*)(vobj[vobj_id].vaddr); 306 mwmr->ptw = 0; 307 mwmr->ptr = 0; 308 mwmr->sts = 0; 309 mwmr->depth = (vobj[vobj_id].length>>2) - 5; 310 mwmr->width = vobj[vobj_id].init; 311 mwmr->lock = 0; 312 #if INIT_DEBUG_CTX 313 _puts("[INIT] MWMR channel "); 314 _puts( vobj->name); 315 _puts(" / depth = "); 316 _putw( mwmr->depth ); 317 _puts("\n"); 318 #endif 319 break; 320 } 321 case VOBJ_TYPE_ELF: // initialisation done by the loader 322 { 323 324 #if INIT_DEBUG_CTX 325 _puts("[INIT] ELF section "); 326 _puts( vobj->name); 327 _puts(" / length = "); 328 _putw( vobj->length ); 329 _puts("\n"); 330 #endif 331 break; 332 } 333 case VOBJ_TYPE_BARRIER: // init is the number of participants 334 { 335 giet_barrier_t* barrier = (giet_barrier_t*)(vobj[vobj_id].vaddr); 336 barrier->count = 0; 337 barrier->init = vobj[vobj_id].init; 338 #if INIT_DEBUG_CTX 339 _puts(" BARRIER "); 340 _puts( vobj->name); 341 _puts(" / init_value = "); 342 _putw( barrier->init ); 343 _puts("\n"); 344 #endif 345 break; 346 } 347 case VOBJ_TYPE_LOCK: // init is "not taken" 348 { 349 unsigned int* lock = (unsigned int*)(vobj[vobj_id].vaddr); 350 *lock = 0; 351 #if INIT_DEBUG_CTX 352 _puts(" LOCK "); 353 _puts( vobj->name); 354 _puts("\n"); 355 #endif 356 break; 357 } 358 case VOBJ_TYPE_BUFFER: // nothing to do 359 { 360 361 #if INIT_DEBUG_CTX 362 _puts(" BUFFER "); 363 _puts( vobj->name); 364 _puts(" / length = "); 365 _putw( vobj->length ); 366 _puts("\n"); 367 #endif 368 break; 369 } 370 default: 371 { 372 _puts("\n[INIT ERROR] illegal vobj of name "); 373 _puts(vobj->name); 374 _puts(" / in vspace = "); 375 _puts(vobj->name); 376 _puts("\n "); 377 _exit(); 378 } 379 } // end switch type 380 } // end loop on vobjs 381 } // end loop on vspaces 382 383 _puts("\n[INIT] Vobjs initialisation completed at cycle : "); 384 _putw( _proctime() ); 385 _puts("\n"); 386 387 } // end kernel_vobjs_init() 152 388 153 389 /////////////////////////////////////////////////////////////////////////////// … … 181 417 mapping_vobj_t* vobj = _get_vobj_base( header ); 182 418 419 /** Set the current vspace ptpr before acessing the memory */ 420 _set_ptpr(vspace_id); 183 421 184 422 // values to be initialised in task context … … 291 529 292 530 } // end _task_map() 293 294 ///////////////////////////////////////////////////////////////////////////////295 // This function initializes all private vobjs defined in the vspaces,296 // such as mwmr channels, barriers and locks, depending on the vobj type.297 // (Most of the vobjs are not known, and not initialised by the compiler).298 // This function initialises the _kernel_ptabs_paddr[] array indexed by the vspace_id,299 // and containing the base addresses of all page tables.300 // This _kernel_ptabs_paddr[] array is used to initialise the task contexts.301 ///////////////////////////////////////////////////////////////////////////////302 in_kinit void _kernel_vobjs_init()303 {304 mapping_header_t* header = (mapping_header_t*)&seg_mapping_base;305 mapping_vspace_t* vspace = _get_vspace_base( header );306 mapping_vobj_t* vobj = _get_vobj_base( header );307 308 unsigned int vspace_id;309 unsigned int vobj_id;310 311 // loop on the vspaces312 for ( vspace_id = 0 ; vspace_id < header->vspaces ; vspace_id++ )313 {314 char ptab_found = 0;315 316 #if INIT_DEBUG_CTX317 _puts("[INIT] --- vobjs initialisation in vspace ");318 _puts(vspace[vspace_id].name);319 _puts("\n");320 #endif321 // loop on the vobjs322 for(vobj_id= vspace[vspace_id].vobj_offset;323 vobj_id < (vspace[vspace_id].vobj_offset+ vspace[vspace_id].vobjs);324 vobj_id++)325 {326 switch( vobj[vobj_id].type )327 {328 case VOBJ_TYPE_PTAB: // initialise page table pointers array329 {330 ptab_found = 1;331 _kernel_ptabs_paddr[vspace_id] = vobj[vobj_id].paddr;332 _kernel_ptabs_vaddr[vspace_id] = vobj[vobj_id].vaddr;333 334 #if INIT_DEBUG_CTX335 _puts("[INIT] PTAB address = ");336 _putw(_kernel_ptabs_paddr[vspace_id]);337 _puts("\n");338 #endif339 break;340 }341 case VOBJ_TYPE_MWMR: // storage capacity is (vobj.length/4 - 5) words342 {343 mwmr_channel_t* mwmr = (mwmr_channel_t*)(vobj[vobj_id].vaddr);344 mwmr->ptw = 0;345 mwmr->ptr = 0;346 mwmr->sts = 0;347 mwmr->depth = (vobj[vobj_id].length>>2) - 5;348 mwmr->lock = 0;349 #if INIT_DEBUG_CTX350 _puts("[INIT] MWMR channel ");351 _puts( vobj->name);352 _puts(" / depth = ");353 _putw( mwmr->depth );354 _puts("\n");355 #endif356 break;357 }358 case VOBJ_TYPE_ELF: // initialisation done by the loader359 {360 361 #if INIT_DEBUG_CTX362 _puts("[INIT] ELF section ");363 _puts( vobj->name);364 _puts(" / length = ");365 _putw( vobj->length );366 _puts("\n");367 #endif368 break;369 }370 case VOBJ_TYPE_BARRIER: // init is the number of participants371 {372 giet_barrier_t* barrier = (giet_barrier_t*)(vobj[vobj_id].vaddr);373 barrier->count = 0;374 barrier->init = vobj[vobj_id].init;375 #if INIT_DEBUG_CTX376 _puts(" BARRIER ");377 _puts( vobj->name);378 _puts(" / init_value = ");379 _putw( barrier->init );380 _puts("\n");381 #endif382 break;383 }384 case VOBJ_TYPE_LOCK: // init is "not taken"385 {386 unsigned int* lock = (unsigned int*)(vobj[vobj_id].vaddr);387 *lock = 0;388 #if INIT_DEBUG_CTX389 _puts(" LOCK ");390 _puts( vobj->name);391 _puts("\n");392 #endif393 break;394 }395 case VOBJ_TYPE_BUFFER: // nothing to do396 {397 398 #if INIT_DEBUG_CTX399 _puts(" BUFFER ");400 _puts( vobj->name);401 _puts(" / length = ");402 _putw( vobj->length );403 _puts("\n");404 #endif405 break;406 }407 default:408 {409 _puts("\n[INIT ERROR] illegal vobj of name ");410 _puts(vobj->name);411 _puts(" / in vspace = ");412 _puts(vobj->name);413 _puts("\n ");414 _exit();415 }416 } // end switch type417 } // end loop on vobjs418 if( !ptab_found )419 {420 _puts("\n[INIT ERROR] Missing PTAB for vspace ");421 _putw( vspace_id );422 _exit();423 }424 } // end loop on vspaces425 426 _puts("\n[INIT] Vobjs initialisation completed at cycle : ");427 _putw( _proctime() );428 _puts("\n");429 430 } // end _vobjs_init()431 531 432 532 /////////////////////////////////////////////////////////////////////////////// -
soft/giet_vm/xml/xml_parser.c
r174 r175 364 364 365 365 //////// get type attribute 366 str = getStringValue(reader, "type", &ok);367 #if XML_PARSER_DEBUG 368 printf(" type = %s\n", str);369 #endif 370 if (ok && (strcmp( str, "ELF") == 0))366 char *type_str = getStringValue(reader, "type", &ok); 367 #if XML_PARSER_DEBUG 368 printf(" type = %s\n", type_str); 369 #endif 370 if (ok && (strcmp(type_str, "ELF") == 0)) 371 371 { 372 372 vobj[vobj_index]->type = VOBJ_TYPE_ELF; … … 380 380 } 381 381 } 382 else if (ok && (strcmp( str, "BLOB") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_BLOB;383 else if (ok && (strcmp( str, "PTAB") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_PTAB;384 else if (ok && (strcmp( str, "PERI") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_PERI;385 else if (ok && (strcmp( str, "MWMR") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_MWMR;386 else if (ok && (strcmp( str, "LOCK") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_LOCK;387 else if (ok && (strcmp( str, "BUFFER") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_BUFFER;388 else if (ok && (strcmp( str, "BARRIER") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_BARRIER;382 else if (ok && (strcmp(type_str, "BLOB") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_BLOB; 383 else if (ok && (strcmp(type_str, "PTAB") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_PTAB; 384 else if (ok && (strcmp(type_str, "PERI") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_PERI; 385 else if (ok && (strcmp(type_str, "MWMR") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_MWMR; 386 else if (ok && (strcmp(type_str, "LOCK") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_LOCK; 387 else if (ok && (strcmp(type_str, "BUFFER") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_BUFFER; 388 else if (ok && (strcmp(type_str, "BARRIER") == 0)) vobj[vobj_index]->type = VOBJ_TYPE_BARRIER; 389 389 else 390 390 { … … 438 438 } 439 439 440 ////////// get init attribute ( optional : 0 if missing)440 ////////// get init attribute (mandatory for mwmr and barrier) 441 441 value = getIntValue(reader,"init", &ok); 442 442 if ( ok ) … … 449 449 else 450 450 { 451 vobj[vobj_index]->init = 0; 451 if(vobj[vobj_index]->type == VOBJ_TYPE_MWMR || vobj[vobj_index]->type == VOBJ_TYPE_BARRIER ) 452 { 453 printf("[XML ERROR] illegal or missing <value> attribute for vobj (%d,%d), of type: %s\n", 454 vspace_index, vobj_loc_index, type_str); 455 exit(1); 456 } 457 else 458 vobj[vobj_index]->init = 0; 452 459 } 453 460
Note: See TracChangeset
for help on using the changeset viewer.