Changeset 295 for soft/giet_vm/giet_xml
- Timestamp:
- Mar 26, 2014, 6:44:44 PM (11 years ago)
- Location:
- soft/giet_vm/giet_xml
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_xml/mapping_info.h
r289 r295 30 30 // - mapping_vspace_t vspace[] 31 31 // - mapping_vseg_t vseg[] 32 // - mapping_v seg_t vobj[]32 // - mapping_vobj_t vobj[] 33 33 // - mapping_task_t task[] 34 34 // - mapping_proc_t proc[] … … 61 61 #define U_MODE_MASK 0b0001 // user access 62 62 63 #define IN_MAPPING_SIGNATURE 0xD EADBEEF63 #define IN_MAPPING_SIGNATURE 0xDACE2014 64 64 #define OUT_MAPPING_SIGNATURE 0xBABEF00D 65 65 … … 85 85 { 86 86 IRQ_TYPE_HWI = 0, // HARD in map.xml file 87 IRQ_TYPE_ SWI = 1, // SOFT in map.xml file,87 IRQ_TYPE_WTI = 1, // SOFT in map.xml file, 88 88 IRQ_TYPE_PTI = 2, // TIME in map.xml file, 89 89 }; … … 115 115 PERIPH_TYPE_TTY = 12, 116 116 PERIPH_TYPE_XCU = 13, 117 118 PERIPH_TYPE_MAX_VALUE = 14, 117 PERIPH_TYPE_PIC = 14, 118 119 PERIPH_TYPE_MAX_VALUE = 15, 119 120 }; 120 121 … … 145 146 unsigned int globals; // number of vsegs mapped in all vspaces 146 147 unsigned int vspaces; // number of virtual spaces 147 unsigned int increment; // vseg cluster increment for replicated periphs 148 unsigned int x_io; // x coordinate for cluster_io_ext 149 unsigned int y_io; // y coordinate for cluster_io_ext 148 150 unsigned int irq_per_proc; // number of IRQ per processor 149 150 unsigned int cma_cluster; // index of cluster containing CMA controler 151 unsigned int cma_cluster_bis; // index of cluster containing second CMA controler 152 153 unsigned int fbf_cluster; // index of cluster containing FBF controler 154 unsigned int fbf_cluster_bis; // index of cluster containing second FBF controler 155 156 unsigned int iob_cluster; // index of cluster containing IOB controler 157 unsigned int iob_cluster_bis; // index of cluster containing second IOB controler 158 159 unsigned int ioc_cluster; // index of cluster containing IOC controler 160 unsigned int ioc_cluster_bis; // index of cluster containing second IOC controler 161 162 unsigned int nic_cluster; // index of cluster containing NIC controler 163 unsigned int nic_cluster_bis; // index of cluster containing second NIC controler 164 165 unsigned int rom_cluster; // index of cluster containing ROM controler 166 unsigned int rom_cluster_bis; // index of cluster containing second ROM controler 167 168 unsigned int sim_cluster; // index of cluster containing SIM controler 169 unsigned int sim_cluster_bis; // index of cluster containing second SIM controler 170 171 unsigned int tty_cluster; // index of cluster containing TTY controler 172 unsigned int tty_cluster_bis; // index of cluster containing second TTY controler 151 unsigned int use_ramdisk; // does not use IOC peripheral if non zero 152 unsigned int increment; // vbase address increment (replicated peripherals) 173 153 174 154 unsigned int psegs; // total number of physical segments (for all clusters) … … 286 266 typedef struct __attribute__((packed)) mapping_proc_s 287 267 { 288 unsigned int irqs; // number of IRQs allocated to processor 289 unsigned int irq_offset; // index of first IRQ allocated to processor 268 unsigned int index; // processor local index (in cluster) 290 269 } mapping_proc_t; 291 292 293 /////////////////////////////////////////////////////294 typedef struct __attribute__((packed)) mapping_irq_s295 {296 unsigned int type; // HWI / SWI / PTI297 unsigned int icuid; // IRQ Index for the ICU component298 unsigned int isr; // ISR Index (defined in irq_handler.h)299 unsigned int channel; // Channel Index (for multi-channels peripherals)300 } mapping_irq_t;301 270 302 271 … … 323 292 typedef struct __attribute__((packed)) mapping_periph_s 324 293 { 325 unsigned int type; 294 unsigned int type; // legal values defined above 326 295 unsigned int subtype; // periph specialization 327 296 unsigned int psegid; // pseg index in cluster 328 297 unsigned int channels; // number of channels 298 unsigned int irqs; // number of input IRQs (for ICU, XCU or PIC) 299 unsigned int irq_offset; // index of first IRQ (can be HWI/PTI/WTI) 329 300 } mapping_periph_t; 301 302 303 ///////////////////////////////////////////////////// 304 typedef struct __attribute__((packed)) mapping_irq_s 305 { 306 unsigned int srctype; // source IRQ type (HWI / WTI / PTI) 307 unsigned int srcid; // source IRQ index (for ICU/PIC component) 308 unsigned int isr; // ISR type (defined in irq_handler.h) 309 unsigned int channel; // channel index (for multi-channels peripherals) 310 unsigned int dstx; // x coordinate of destination cluster 311 unsigned int dsty; // y coordinate of destination cluster 312 unsigned int dstid; // destination IRQ index (can be PROC or ICU) 313 } mapping_irq_t; 330 314 331 315 -
soft/giet_vm/giet_xml/xml_driver.c
r289 r295 18 18 19 19 ////////////////////////////////////////////////////// 20 void buildXml(mapping_header_t * header, FILE * fpout) { 20 void buildXml(mapping_header_t * header, FILE * fpout) 21 { 22 // mnemonics defined in mapping_info.h 21 23 const char * vobj_type[] = 22 24 { … … 27 29 "MWMR", // MWMR channel 28 30 "LOCK", // Spin-Lock 29 "BUFFER", // Any "no intialiasation needed" object s(stacks...)31 "BUFFER", // Any "no intialiasation needed" object (stacks...) 30 32 "BARRIER", // Barrier 31 33 "CONST", // Constant … … 34 36 }; 35 37 38 // mnemonics defined in mapping_info.h 36 39 const char * pseg_type[] = 37 40 { 38 41 "RAM", 39 "ROM", 42 "ROM", // deprecated => use PERI 40 43 "PERI", 41 44 }; 42 45 46 // mnemonics defined in mapping_info.h 43 47 const char * irq_type[] = 44 48 { 45 "HARD", 46 "SOFT", 47 "TIME", 48 }; 49 49 "HWI", 50 "WTI", 51 "PTI", 52 }; 53 54 // mnemonics defined in irq_handler.h 50 55 const char * isr_type[] = 51 56 { 52 "ISR_DEFAULT", 53 "ISR_ SWITCH",54 "ISR_TTY ",55 "ISR_ DMA",56 "ISR_ IOC",57 "ISR_DEFAULT", 58 "ISR_TICK", 59 "ISR_TTY_RX", 60 "ISR_TTY_TX", 61 "ISR_BDV", 57 62 "ISR_TIMER", 58 }; 59 63 "ISR_WAKUP", 64 "ISR_NIC_RX", 65 "ISR_NIC_TX", 66 "ISR_CMA", 67 }; 68 69 // mnemonics defined in mapping_info.h 60 70 const char * periph_type[] = 61 71 { … … 74 84 "TTY", 75 85 "XCU", 76 }; 77 78 const char * periph_subtype[] = 86 "PIC", 87 }; 88 89 const char * ioc_subtype[] = 79 90 { 80 91 "BDV", … … 242 253 fprintf(fpout, " x_width = \"%d\" \n" , header->x_width); 243 254 fprintf(fpout, " y_width = \"%d\" \n" , header->y_width); 244 fprintf(fpout, " vspaces = \"%d\" \n" , header->vspaces); 245 fprintf(fpout, " increment = \"%d\" \n" , header->vspaces); 246 fprintf(fpout, " irq_per_proc = \"%d\" >\n\n", header->irq_per_proc); 255 fprintf(fpout, " irq_per_proc = \"%d\" \n" , header->irq_per_proc); 256 fprintf(fpout, " use_ramdisk = \"%d\" \n" , header->use_ramdisk); 257 fprintf(fpout, " x_io = \"%d\" \n" , header->x_io); 258 fprintf(fpout, " y_io = \"%d\" >\n\n", header->y_io); 247 259 248 260 ///////////////////// clusters /////////////////////////////////////////////// … … 271 283 for (proc_id = cluster[cluster_id].proc_offset; 272 284 proc_id < cluster[cluster_id].proc_offset + cluster[cluster_id].procs; 273 proc_id++) 274 { 275 fprintf(fpout, " <proc index = \"%d\" >\n", proc_index); 276 for (irq_id = proc[proc_id].irq_offset; 277 irq_id < proc[proc_id].irq_offset + proc[proc_id].irqs; 278 irq_id++) 279 { 280 fprintf(fpout, " <irq type = \"%s\" ", irq_type[irq[irq_id].type]); 281 fprintf(fpout, " icuid = \"0x%x\" ", irq[irq_id].icuid); 282 fprintf(fpout, " isr = \"%s\" ", isr_type[irq[irq_id].isr]); 283 fprintf(fpout, " channel = \"0x%x\" />\n", irq[irq_id].channel); 284 } 285 fprintf(fpout, " </proc>\n" ); 286 } 287 285 proc_id++, proc_index++) 286 { 287 fprintf(fpout, " <proc index = \"%d\" />\n", proc_index); 288 } 288 289 289 290 ///////////////////// coprocessors /////////////////////////////////////////// … … 316 317 317 318 if (periph[periph_id].subtype < PERIPH_SUBTYPE_MAX_VALUE) 318 fprintf(fpout, " subtype = \"%s\" ", periph_subtype[periph[periph_id].subtype]);319 fprintf(fpout, " subtype = \"%s\" ", ioc_subtype[periph[periph_id].subtype]); 319 320 320 321 fprintf(fpout, " psegname = \"%s\" ", pseg[periph[periph_id].psegid].name); 321 fprintf(fpout, " channels = \"%d\" />\n", periph[periph_id].channels); 322 fprintf(fpout, " channels = \"%d\" >\n", periph[periph_id].channels); 323 for (irq_id = periph[periph_id].irq_offset; 324 irq_id < periph[periph_id].irq_offset + periph[periph_id].irqs; 325 irq_id++) 326 { 327 fprintf(fpout, " <irq srctype = \"%s\" ", irq_type[irq[irq_id].srctype]); 328 fprintf(fpout, " srcid = \"%d\" ", irq[irq_id].srcid); 329 fprintf(fpout, " isr = \"%s\" ", isr_type[irq[irq_id].isr]); 330 fprintf(fpout, " channel = \"%d\" ", irq[irq_id].channel); 331 fprintf(fpout, " dstx = \"%d\" ", irq[irq_id].dstx); 332 fprintf(fpout, " dsty = \"%d\" ", irq[irq_id].dsty); 333 fprintf(fpout, " dstid = \"%d\" />\n", irq[irq_id].dstid); 334 } 335 fprintf(fpout, " </periph>\n"); 322 336 } 323 337 fprintf(fpout, " </cluster>\n" ); -
soft/giet_vm/giet_xml/xml_parser.c
r289 r295 104 104 char found_mmc = 0; 105 105 106 107 //////////////////////////////////////////////////////////////////// 108 // These variables are used to generate the hard_config.h file 109 //////////////////////////////////////////////////////////////////// 110 111 unsigned int nb_proc_max = 0; // max number of processors per cluster 106 //////////////////////////////////////////////////////////////////////// 107 // These variables are used to generate the hard_config.h file. 108 //////////////////////////////////////////////////////////////////////// 109 110 unsigned int nb_procs_max = 0; // max number of processors per cluster 112 111 unsigned int nb_tasks_max = 0; // max number of tasks (in all vspaces) 113 112 114 unsigned int tim_channels = 0; // max number of user timers(per cluster)115 unsigned int dma_channels = 0; // maxnumber of DMA channels (per cluster)116 117 unsigned int icu_channels = 0; // total number of channels in ICU/XICU118 unsigned int tty_channels = 0; // total number of terminals in TTY119 unsigned int hba_channels = 0; // total number of channels in HBA120 unsigned int nic_channels = 0; // total number of channels in NIC121 unsigned int cma_channels = 0; // total number of channels in CMA113 unsigned int tim_channels = 0; // number of user timers (per cluster) 114 unsigned int dma_channels = 0; // number of DMA channels (per cluster) 115 116 unsigned int tty_channels = 0; // number of TTY channels 117 unsigned int ioc_channels = 0; // number of HBA channels 118 unsigned int nic_channels = 0; // number of NIC channels 119 unsigned int cma_channels = 0; // number of CMA channels 120 unsigned int pic_channels = 0; // number of PIC channels 122 121 123 122 unsigned int use_iob = 0; // using IOB component 123 unsigned int use_pic = 0; // using PIC component 124 124 unsigned int use_xcu = 0; // using XCU (not ICU) 125 125 126 126 // These variables define the IOC peripheral subtype 127 unsigned int use_hba = 0; // using HBA 128 unsigned int use_bdv = 0; // using SoCLIB block device 129 unsigned int use_spi = 0; // using SD Card-SPI 127 128 unsigned int use_hba = 0; // using SoClib AHCI controller 129 unsigned int use_bdv = 0; // using SoCLIB block device controller 130 unsigned int use_spi = 0; // using SDCard-SPI 130 131 131 132 //////////////////////////////////////////////////////////////// … … 283 284 284 285 /////////////////////////////////////////////////////////////////////////////////// 285 // This function set the vbase address for all peripheral types. 286 // For replicated peripherals with the same type the virtual base address must be: 287 // vbase = seg_type_base & 0XFF000000 + 288 // (cluster_id * vbase_cluster_increment) & 0x00FF0000 286 // This function set the vbase addresses for all peripheral types, in order 287 // to generate the ldscript file, that contains one single virtual address 288 // for peripherals replicated in all clusters, and one virtual addresses for 289 // each non replicated peripheral type. 290 // 291 // It makes the following checks on the virtual addresses: 292 // 293 // - For replicated peripherals the virtual base address must be: 294 // vbase = seg_type_base & 0XFF000000 + (cluster_xy * increment) & 0x00FF0000 295 // 296 // - For non-replicated peripherals, the cluster index must be cluster_io. 289 297 /////////////////////////////////////////////////////////////////////////////////// 290 298 void set_periph_vbase_array() … … 300 308 unsigned int cluster_mask = 0x00FF0000; 301 309 302 // We are analysing all vsegs corresponding to a peripheral 310 #if XML_PARSER_DEBUG 311 printf("\n set peripherals vbase array\n"); 312 #endif 303 313 304 314 // scan all vsegs … … 308 318 if ( vobj[vseg[vseg_id]->vobj_offset]->type == VOBJ_TYPE_PERI ) 309 319 { 310 pseg_id = vseg[vseg_id]->psegid; 320 pseg_id = vseg[vseg_id]->psegid; 321 322 #if XML_PARSER_DEBUG 323 printf(" - found vseg %s with psegid = %d", vseg[vseg_id]->name, pseg_id ); 324 #endif 311 325 312 326 // scan all periphs to retrieve peripheral type (same psegid) … … 315 329 if( periph[periph_id]->psegid == pseg_id ) // matching !!! 316 330 { 317 type = periph[periph_id]->type; 318 if ( periph_vbase_array[type] == 0xFFFFFFFF ) // vbase not set 331 cluster_id = pseg[pseg_id]->clusterid; 332 type = periph[periph_id]->type; 333 334 #if XML_PARSER_DEBUG 335 printf(" / matching periph type %d\n", type ); 336 #endif 337 338 if ( (type == PERIPH_TYPE_DMA) || 339 (type == PERIPH_TYPE_MMC) || 340 (type == PERIPH_TYPE_ICU) || 341 (type == PERIPH_TYPE_XCU) || 342 (type == PERIPH_TYPE_TIM) ) // replicated peripheral 319 343 { 320 periph_vbase_array[type] = vseg[vseg_id]->vbase & type_mask; 321 } 322 else // vbase already set 323 { 324 // checking mask bits 325 if( (vseg[vseg_id]->vbase & type_mask) != 326 (periph_vbase_array[type]) ) 344 cluster_xy = (cluster[cluster_id]->x << header->y_width) + 345 cluster[cluster_id]->y; 346 347 if( (vseg[vseg_id]->vbase & cluster_mask) != 348 (header->increment * cluster_xy) ) 327 349 { 328 printf("[XML ERROR] All peripherals with same type "); 329 printf(" should share the same 8 MSB bits in base address\n"); 350 printf("[XML ERROR] All replicated peripherals " 351 "must have cluster bits = cluster_xy * increment\n"); 352 printf("periph index = %d / periph type = %d / vbase = %x\n", 353 periph_id, type, vseg[vseg_id]->vbase); 354 exit(1); 355 } 356 else if ( periph_vbase_array[type] == 0xFFFFFFFF ) // vbase not set 357 { 358 periph_vbase_array[type] = vseg[vseg_id]->vbase & type_mask; 359 } 360 else if ((vseg[vseg_id]->vbase & type_mask) != (periph_vbase_array[type])) 361 { 362 printf("[XML ERROR] All peripherals with same type" 363 " should share the same 8 MSB bits in vbase address\n"); 330 364 printf("periph index = %d / periph type = %d / vbase = %x\n", 331 365 periph_id, type, vseg[vseg_id]->vbase); … … 333 367 } 334 368 } 335 336 // checking cluster bits for all replicated peripherals 337 if ( (type == PERIPH_TYPE_DMA) || 338 (type == PERIPH_TYPE_MMC) || 339 (type == PERIPH_TYPE_ICU) || 340 (type == PERIPH_TYPE_XCU) || 341 (type == PERIPH_TYPE_TIM) ) 369 else // non replicated peripheral 342 370 { 343 cluster_id = pseg[pseg_id]->clusterid; 344 cluster_xy = (cluster[cluster_id]->x << header->y_width) + 345 cluster[cluster_id]->y; 346 347 if( (vseg[vseg_id]->vbase & cluster_mask) != 348 (header->increment * cluster_xy) ) 371 if ( (cluster[cluster_id]->x == header->x_io) && 372 (cluster[cluster_id]->y == header->y_io) ) 349 373 { 350 printf("[XML ERROR] All replicated peripherals "); 351 printf("must have cluster bits = cluster_id * increment"); 352 printf("periph index = %d / periph type = %d / vbase = %x\n", 353 periph_id, type, vseg[vseg_id]->vbase); 374 periph_vbase_array[type] = vseg[vseg_id]->vbase; 375 } 376 else 377 { 378 printf("[XML ERROR] Non replicated peripherals must be in cluster_io\n"); 379 printf(" periph index = %d / periph type = %d / vbase = %x" 380 " / pseg index = %d / cluster index = %d\n", 381 periph_id, type, vseg[vseg_id]->vbase, pseg_id, cluster_id); 354 382 exit(1); 355 383 } 356 } 384 } 357 385 } 358 386 } … … 428 456 } 429 457 458 /////////////////////////////////////////////////////////// 459 unsigned int alignTo( unsigned int value, unsigned int pow2 ) 460 { 461 unsigned int mask = (1 << pow2) - 1; 462 return ( (value + mask) & ~mask); 463 } 464 465 //////////////////// 466 void setVsegLength() 467 { 468 // for a given vseg identified vseg_index 469 // scan all contained vobjs to compute the vseg lenth 470 471 unsigned int vobj_id; 472 unsigned int cur_length = 0; 473 474 unsigned int first = vseg[vseg_index]->vobj_offset; 475 unsigned int last = first + vseg[vseg_index]->vobjs; 476 477 for ( vobj_id = first ; vobj_id < last ; vobj_id++ ) 478 { 479 if (vobj[vobj_id]->align) 480 { 481 cur_length = alignTo( cur_length, vobj[vobj_id]->align ); 482 } 483 cur_length += vobj[vobj_id]->length; 484 } 485 vseg[vseg_index]->length = alignTo( cur_length, 12 ); 486 } 487 488 /////////////////////// 489 void checkVsegOverlap() 490 { 491 // for a given vseg identified by vseg_index, 492 // check overlap with all vsegs in same vspace, 493 // and check overlap with all global vsegs. 494 495 unsigned int vseg_id; 496 unsigned int prev_vbase; // previous vseg vbase 497 unsigned int prev_length; // previous vseg length 498 499 unsigned int vbase = vseg[vseg_index]->vbase; // new vseg vbase 500 unsigned int length = vseg[vseg_index]->length; // new vseg length 501 502 // checking overlap with other vsegs in same vspace 503 if ( header->vspaces > 0 ) 504 { 505 unsigned int first = vspace[vspace_index]->vseg_offset; 506 unsigned int last = vseg_index; 507 508 for( vseg_id = first ; vseg_id < last ; vseg_id++ ) 509 { 510 prev_vbase = vseg[vseg_id]->vbase; 511 prev_length = vseg[vseg_id]->length; 512 if ( ((vbase + length) > prev_vbase) && ((prev_vbase + prev_length) > vbase) ) 513 { 514 printf("[XML ERROR] vseg %s in vspace %s overlaps other vseg %s\n", 515 vseg[vseg_index]->name, vspace[vspace_index]->name, vseg[vseg_id]->name ); 516 exit(1); 517 } 518 } 519 } 520 521 // checking overlap with existing global vsegs 522 for ( vseg_id = 0 ; vseg_id < header->globals ; vseg_id++ ) 523 { 524 prev_vbase = vseg[vseg_id]->vbase; 525 prev_length = vseg[vseg_id]->length; 526 if ( ((vbase + length) > prev_vbase) && ((prev_vbase + prev_length) > vbase) ) 527 { 528 printf("[XML ERROR] vseg %s in vspace %s overlaps global vseg %s\n", 529 vseg[vseg_index]->name, vspace[vspace_index]->name, vseg[vseg_id]->name ); 530 exit(1); 531 } 532 } 533 } 534 430 535 ////////////////////////////////////// 431 536 void taskNode(xmlTextReaderPtr reader) … … 466 571 } 467 572 468 ///////// get x coordinate573 ///////// get trdid attribute (optional) 469 574 task[task_index]->trdid = getIntValue(reader, "trdid", &ok); 470 575 #if XML_PARSER_DEBUG 471 printf(" x= %d\n", x);576 printf(" trdid = %d\n", x); 472 577 #endif 473 578 if ( !ok ) 474 579 { 475 580 task[task_index]->trdid = task_loc_index; 476 printf("[XML WARNING] missing trdid (thread index) attribute "477 "for task in vspace %d. Using value %d\n"478 , vspace_index, task_loc_index);479 581 } 480 582 … … 720 822 ////////// get length attribute 721 823 value = getIntValue(reader, "length", &ok); 722 if (ok) { 723 #if XML_PARSER_DEBUG 724 printf(" length = %d\n", value); 824 if (ok) 825 { 826 #if XML_PARSER_DEBUG 827 printf(" length = %x\n", value); 725 828 #endif 726 829 vobj[vobj_index]->length = value; … … 734 837 ////////// get align attribute (optional : 0 if missing) 735 838 value = getIntValue(reader, "align", &ok); 736 if (ok) { 839 if (ok) 840 { 737 841 #if XML_PARSER_DEBUG 738 842 printf(" align = %d\n", value); … … 740 844 vobj[vobj_index]->align = value; 741 845 } 742 else { 846 else 847 { 743 848 vobj[vobj_index]->align = 0; 744 849 } … … 746 851 ////////// get binpath attribute (optional : '\0' if missing) 747 852 str = getStringValue(reader, "binpath", &ok); 748 if (ok) { 853 if (ok) 854 { 749 855 #if XML_PARSER_DEBUG 750 856 printf(" binpath = %s\n", str); … … 958 1064 { 959 1065 vseg[vseg_index]->vobjs = vobj_count; 1066 setVsegLength(); 1067 checkVsegOverlap(); 960 1068 vseg_index++; 961 1069 vseg_loc_index++; … … 984 1092 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 985 1093 986 // checking source file consistency987 if (vspace_index >= header->vspaces) {988 printf("[XML ERROR] The vspace index is too large : %d\n",989 vspace_index);990 exit(1);991 }992 993 1094 #if XML_PARSER_DEBUG 994 1095 printf("\n vspace %d\n", vspace_index); … … 996 1097 997 1098 vspace[vspace_index] = (mapping_vspace_t *) malloc(sizeof(mapping_vspace_t)); 1099 header->vspaces = header->vspaces + 1; 998 1100 999 1101 ////////// get name attribute … … 1036 1138 1037 1139 int status = xmlTextReaderRead(reader); 1038 while (status == 1) { 1140 while (status == 1) 1141 { 1039 1142 const char * tag = (const char *) xmlTextReaderConstName(reader); 1040 1143 … … 1050 1153 else if (strcmp(tag, "#text") == 0) { } 1051 1154 else if (strcmp(tag, "#comment") == 0) { } 1052 else if (strcmp(tag, "vspace") == 0) { 1155 else if (strcmp(tag, "vspace") == 0) 1156 { 1053 1157 vspace[vspace_index]->vobjs = vobj_loc_index; 1054 1158 vspace[vspace_index]->tasks = task_loc_index ; … … 1099 1203 } // end vspaceNode() 1100 1204 1205 ///////////////////////////////////// 1206 void irqNode(xmlTextReaderPtr reader) 1207 { 1208 unsigned int ok; 1209 unsigned int value; 1210 char * str; 1211 1212 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 1213 1214 if (irq_index >= MAX_IRQS) 1215 { 1216 printf("[XML ERROR] The number of irqs is larger than %d\n", MAX_IRQS); 1217 } 1218 1219 #if XML_PARSER_DEBUG 1220 printf(" irq %d\n", irq_loc_index); 1221 #endif 1222 1223 irq[irq_index] = (mapping_irq_t *) malloc(sizeof(mapping_irq_t)); 1224 1225 ///////// get srctype attribute 1226 str = getStringValue(reader, "srctype", &ok); 1227 if (ok) 1228 { 1229 #if XML_PARSER_DEBUG 1230 printf(" srctype = %s\n", str); 1231 #endif 1232 if ( strcmp(str, "HWI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_HWI; 1233 else if ( strcmp(str, "WTI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_WTI; 1234 else if ( strcmp(str, "PTI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_PTI; 1235 else 1236 { 1237 printf("[XML ERROR] illegal IRQ <srctype> for periph %d in cluster %d\n", 1238 cluster_index, periph_loc_index); 1239 exit(1); 1240 } 1241 } 1242 else 1243 { 1244 printf("[XML ERROR] missing IRQ <srctype> for periph %d in cluster %d\n", 1245 cluster_index, periph_loc_index); 1246 exit(1); 1247 } 1248 1249 ///////// get srcid attribute 1250 value = getIntValue(reader, "srcid", &ok); 1251 if (ok) 1252 { 1253 #if XML_PARSER_DEBUG 1254 printf(" srcid = %d\n", value); 1255 #endif 1256 irq[irq_index]->srcid = value; 1257 if (value >= 32) 1258 { 1259 printf("[XML ERROR] IRQ <srcid> too large for periph %d in cluster %d\n", 1260 cluster_index, periph_loc_index); 1261 exit(1); 1262 } 1263 } 1264 else 1265 { 1266 printf("[XML ERROR] missing IRQ <icuid> for periph %d in cluster %d\n", 1267 cluster_index, periph_loc_index); 1268 exit(1); 1269 } 1270 1271 ///////// get isr attribute 1272 str = getStringValue(reader, "isr", &ok); 1273 if (ok) 1274 { 1275 #if XML_PARSER_DEBUG 1276 printf(" isr = %s\n", str); 1277 #endif 1278 if (strcmp(str, "ISR_TICK" ) == 0) irq[irq_index]->isr = ISR_TICK; 1279 else if (strcmp(str, "ISR_BDV" ) == 0) irq[irq_index]->isr = ISR_BDV; 1280 else if (strcmp(str, "ISR_CMA" ) == 0) irq[irq_index]->isr = ISR_CMA; 1281 else if (strcmp(str, "ISR_TTY_RX" ) == 0) irq[irq_index]->isr = ISR_TTY_RX; 1282 else if (strcmp(str, "ISR_TTY_TX" ) == 0) irq[irq_index]->isr = ISR_TTY_TX; 1283 else if (strcmp(str, "ISR_TIMER" ) == 0) irq[irq_index]->isr = ISR_TIMER; 1284 else if (strcmp(str, "ISR_WAKUP" ) == 0) irq[irq_index]->isr = ISR_WAKUP; 1285 else if (strcmp(str, "ISR_NIC_RX" ) == 0) irq[irq_index]->isr = ISR_NIC_RX; 1286 else if (strcmp(str, "ISR_NIC_TX" ) == 0) irq[irq_index]->isr = ISR_NIC_TX; 1287 else if (strcmp(str, "ISR_DEFAULT") == 0) irq[irq_index]->isr = ISR_DEFAULT; 1288 else 1289 { 1290 printf("[XML ERROR] illegal IRQ <isr> for periph %d in cluster %d\n", 1291 cluster_index, periph_loc_index); 1292 exit(1); 1293 } 1294 } 1295 else 1296 { 1297 printf("[XML ERROR] missing IRQ <isr> for periph %d in cluster %d\n", 1298 cluster_index, periph_loc_index); 1299 exit(1); 1300 } 1301 1302 ///////// get channel attribute (optionnal : 0 if missing) 1303 value = getIntValue(reader, "channel", &ok); 1304 if (ok) 1305 { 1306 #if XML_PARSER_DEBUG 1307 printf(" channel = %d\n", value); 1308 #endif 1309 irq[irq_index]->channel = value; 1310 } 1311 else 1312 { 1313 irq[irq_index]->channel = 0; 1314 } 1315 1316 ///////// get dstx attribute 1317 value = getIntValue(reader, "dstx", &ok); 1318 if (ok) 1319 { 1320 #if XML_PARSER_DEBUG 1321 printf(" dstx = %d\n", value); 1322 #endif 1323 1324 if ( value < header->x_size ) 1325 { 1326 irq[irq_index]->dstx = value; 1327 } 1328 else 1329 { 1330 printf("[XML ERROR] IRQ <dstx> too large for periph %d in cluster %d\n", 1331 cluster_index, periph_loc_index); 1332 exit(1); 1333 } 1334 } 1335 else 1336 { 1337 printf("[XML ERROR] missing IRQ <dstx> for periph %d in cluster %d\n", 1338 cluster_index, periph_loc_index); 1339 exit(1); 1340 } 1341 1342 ///////// get dsty attribute 1343 value = getIntValue(reader, "dsty", &ok); 1344 if (ok) 1345 { 1346 #if XML_PARSER_DEBUG 1347 printf(" dsty = %d\n", value); 1348 #endif 1349 1350 if ( value < header->y_size ) 1351 { 1352 irq[irq_index]->dsty = value; 1353 } 1354 else 1355 { 1356 printf("[XML ERROR] IRQ <dsty> too large for periph %d in cluster %d\n", 1357 cluster_index, periph_loc_index); 1358 exit(1); 1359 } 1360 } 1361 else 1362 { 1363 printf("[XML ERROR] missing IRQ <dsty> for periph %d in cluster %d\n", 1364 cluster_index, periph_loc_index); 1365 exit(1); 1366 } 1367 1368 ///////// get dstid attribute 1369 value = getIntValue(reader, "dstid", &ok); 1370 if (ok) 1371 { 1372 #if XML_PARSER_DEBUG 1373 printf(" dstid = %d\n", value); 1374 #endif 1375 irq[irq_index]->dstid = value; 1376 if (value >= 32) 1377 { 1378 printf("[XML ERROR] IRQ <dstid> too large for periph %d in cluster %d\n", 1379 cluster_index, periph_loc_index); 1380 exit(1); 1381 } 1382 } 1383 else 1384 { 1385 printf("[XML ERROR] missing IRQ <dstid> for periph %d in cluster %d\n", 1386 cluster_index, periph_loc_index); 1387 exit(1); 1388 } 1389 1390 irq_index++; 1391 irq_loc_index++; 1392 1393 } // end irqNode 1394 1395 1396 1101 1397 //////////////////////////////////////// 1102 1398 void cpPortNode(xmlTextReaderPtr reader) … … 1115 1411 1116 1412 #if XML_PARSER_DEBUG 1117 1413 printf("\n port %d\n", cp_port_index); 1118 1414 #endif 1119 1415 … … 1126 1422 { 1127 1423 #if XML_PARSER_DEBUG 1128 1424 printf(" direction = %s\n", str); 1129 1425 #endif 1130 1426 if (strcmp(str, "TO_COPROC") == 0) … … 1153 1449 str = getStringValue(reader, "vspacename", &ok); 1154 1450 #if XML_PARSER_DEBUG 1155 1451 printf(" vspacename = %s\n", str); 1156 1452 #endif 1157 1453 if (ok) … … 1169 1465 str = getStringValue(reader, "vobjname", &ok); 1170 1466 #if XML_PARSER_DEBUG 1171 1467 printf(" vobjname = %s\n", str); 1172 1468 #endif 1173 1469 if (ok) … … 1192 1488 unsigned int ok; 1193 1489 1490 irq_loc_index = 0; 1491 1194 1492 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 1195 1493 … … 1201 1499 1202 1500 #if XML_PARSER_DEBUG 1203 printf("\nperiph %d\n", periph_index);1501 printf("\n periph %d\n", periph_index); 1204 1502 #endif 1205 1503 … … 1211 1509 { 1212 1510 #if XML_PARSER_DEBUG 1213 printf(" channels= %d\n", value);1511 printf(" channels = %d\n", value); 1214 1512 #endif 1215 1513 periph[periph_index]->channels = value; … … 1234 1532 { 1235 1533 #if XML_PARSER_DEBUG 1236 printf(" clusterid= %d\n", cluster_index);1237 printf(" psegname= %s\n", str);1238 printf(" psegid= %d\n", index);1534 printf(" clusterid = %d\n", cluster_index); 1535 printf(" psegname = %s\n", str); 1536 printf(" psegid = %d\n", index); 1239 1537 #endif 1240 1538 periph[periph_index]->psegid = index; … … 1252 1550 { 1253 1551 #if XML_PARSER_DEBUG 1254 printf(" type= %s\n", str);1552 printf(" type = %s\n", str); 1255 1553 #endif 1256 1554 unsigned int error = 0; … … 1260 1558 1261 1559 // The CMA, FBF, HBA, IOB, IOC, NIC, ROM, SIM, TTY, peripherals are not 1262 // replicated in all clusters but can be replicated in two clusters (fault tolerance) 1263 // In case of replication, the two copies must have same number of channels. 1560 // replicated in all clusters but can be instanciated twice. 1264 1561 1265 1562 //////////////////////////// … … 1267 1564 { 1268 1565 periph[periph_index]->type = PERIPH_TYPE_CMA; 1269 if ( header->cma_cluster == 0xFFFFFFFF)1566 if ( cma_channels < periph[periph_index]->channels ) 1270 1567 { 1271 header->cma_cluster = cluster_index;1272 1568 cma_channels = periph[periph_index]->channels; 1273 1569 } 1274 else if (header->cma_cluster_bis == 0xFFFFFFFF)1275 {1276 header->cma_cluster_bis = cluster_index;1277 assert( (cma_channels == periph[periph_index]->channels) &&1278 "[XML ERROR] unconsistent non replicated peripheral");1279 }1280 else1281 {1282 error = 1;1283 }1284 1570 } 1285 1571 ///////////////////////////////// … … 1287 1573 { 1288 1574 periph[periph_index]->type = PERIPH_TYPE_FBF; 1289 if (header->fbf_cluster == 0xFFFFFFFF)1290 {1291 header->fbf_cluster = cluster_index;1292 }1293 else if (header->fbf_cluster_bis == 0xFFFFFFFF)1294 {1295 header->fbf_cluster_bis = cluster_index;1296 }1297 else1298 {1299 error = 1;1300 }1301 1575 } 1302 1576 ///////////////////////////////// … … 1305 1579 periph[periph_index]->type = PERIPH_TYPE_IOB; 1306 1580 use_iob = 1; 1307 if (header->iob_cluster == 0xFFFFFFFF)1308 {1309 header->iob_cluster = cluster_index;1310 }1311 else if (header->iob_cluster_bis == 0xFFFFFFFF)1312 {1313 header->iob_cluster_bis = cluster_index;1314 }1315 else1316 {1317 error = 1;1318 }1319 1581 } 1320 1582 ///////////////////////////////// 1321 1583 else if (strcmp(str, "IOC") == 0) 1322 1584 { 1323 periph[periph_index]->type = PERIPH_TYPE_IOC; 1324 if (header->ioc_cluster == 0xFFFFFFFF) 1325 { 1326 header->ioc_cluster = cluster_index; 1327 } 1328 else if (header->ioc_cluster_bis == 0xFFFFFFFF) 1329 { 1330 header->ioc_cluster_bis = cluster_index; 1331 } 1332 else 1333 { 1334 printf("[XML ERROR] At most two copies for non replicated " 1335 "peripheral\n"); 1336 exit(1); 1337 } 1338 1339 str = getStringValue(reader, "subtype", &ok); 1340 1585 char* subtype = getStringValue(reader, "subtype", &ok); 1341 1586 if (!ok) 1342 1587 { 1343 printf("[XML ERROR] IOC peripheral needs a subtype parameter: " 1344 "BDV, HBA or SPI\n"); 1588 printf("[XML ERROR] IOC peripheral needs a subtype: BDV, HBA or SPI\n"); 1345 1589 exit(1); 1346 1590 } 1347 1591 1348 if (strcmp(str, "BDV") == 0) 1349 { 1592 if ( strcmp(subtype, "BDV") == 0 ) 1593 { 1594 periph[periph_index]->type = PERIPH_TYPE_IOC; 1350 1595 periph[periph_index]->subtype = PERIPH_SUBTYPE_BDV; 1351 use_bdv = 1; 1596 ioc_channels = 1; 1597 if ( header->use_ramdisk == 0 ) use_bdv = 1; 1352 1598 } 1353 else if ( strcmp(str, "HBA") == 0)1599 else if ( strcmp(subtype, "HBA") == 0 ) 1354 1600 { 1601 periph[periph_index]->type = PERIPH_TYPE_IOC; 1355 1602 periph[periph_index]->subtype = PERIPH_SUBTYPE_HBA; 1356 1357 if (use_hba == 0) 1358 { 1359 use_hba = 1; 1360 hba_channels = periph[periph_index]->channels; 1361 } 1362 else 1363 { 1364 assert( (hba_channels == periph[periph_index]->channels) && 1365 "[XML ERROR] unconsistent non replicated peripheral"); 1366 } 1603 ioc_channels = periph[periph_index]->channels; 1604 if ( header->use_ramdisk == 0 ) use_hba = 1; 1367 1605 } 1368 else if ( strcmp(str, "SPI") == 0)1606 else if ( strcmp(subtype, "SPI") == 0 ) 1369 1607 { 1608 periph[periph_index]->type = PERIPH_TYPE_IOC; 1370 1609 periph[periph_index]->subtype = PERIPH_SUBTYPE_SPI; 1371 use_spi = 1; 1610 ioc_channels = periph[periph_index]->channels; 1611 if ( header->use_ramdisk == 0 ) use_spi = 1; 1372 1612 } 1373 1613 else … … 1381 1621 { 1382 1622 periph[periph_index]->type = PERIPH_TYPE_NIC; 1383 if ( header->nic_cluster == 0xFFFFFFFF)1623 if ( nic_channels < periph[periph_index]->channels ) 1384 1624 { 1385 header->nic_cluster = cluster_index;1386 1625 nic_channels = periph[periph_index]->channels; 1387 1626 } 1388 else if (header->nic_cluster_bis == 0xFFFFFFFF)1389 {1390 header->nic_cluster_bis = cluster_index;1391 assert( (nic_channels == periph[periph_index]->channels) &&1392 "[XML ERROR] unconsistent non replicated peripheral");1393 }1394 else1395 {1396 error = 1;1397 }1398 1627 } 1399 1628 ///////////////////////////////// … … 1401 1630 { 1402 1631 periph[periph_index]->type = PERIPH_TYPE_ROM; 1403 if (header->rom_cluster == 0xFFFFFFFF)1404 {1405 header->rom_cluster = cluster_index;1406 }1407 else if (header->rom_cluster_bis == 0xFFFFFFFF)1408 {1409 header->rom_cluster_bis = cluster_index;1410 }1411 else1412 {1413 error = 1;1414 }1415 1632 } 1416 1633 ///////////////////////////////// … … 1418 1635 { 1419 1636 periph[periph_index]->type = PERIPH_TYPE_SIM; 1420 if (header->sim_cluster == 0xFFFFFFFF)1421 {1422 header->sim_cluster = cluster_index;1423 }1424 else if (header->sim_cluster_bis == 0xFFFFFFFF)1425 {1426 header->sim_cluster_bis = cluster_index;1427 }1428 else1429 {1430 error = 1;1431 }1432 1637 } 1433 1638 ///////////////////////////////// … … 1435 1640 { 1436 1641 periph[periph_index]->type = PERIPH_TYPE_TTY; 1437 if ( header->tty_cluster == 0xFFFFFFFF)1642 if ( tty_channels < periph[periph_index]->channels ) 1438 1643 { 1439 header->tty_cluster = cluster_index;1440 1644 tty_channels = periph[periph_index]->channels; 1441 1645 } 1442 else if (header->tty_cluster_bis == 0xFFFFFFFF) 1646 } 1647 ///////////////////////////////// 1648 else if (strcmp(str, "PIC") == 0) 1649 { 1650 periph[periph_index]->type = PERIPH_TYPE_PIC; 1651 if ( pic_channels < periph[periph_index]->channels ) 1443 1652 { 1444 header->tty_cluster_bis = cluster_index; 1445 assert( (tty_channels == periph[periph_index]->channels) && 1446 "[XML ERROR] unconsistent non replicated peripheral"); 1653 pic_channels = periph[periph_index]->channels; 1447 1654 } 1448 else 1449 { 1450 error = 1; 1451 } 1452 } 1655 use_pic = 1; 1656 } 1657 1453 1658 1454 1659 // The DMA, ICU, MMC, TIM, XCU peripherals can be replicated in all clusters 1455 // but it must exist onlyone component of each type per cluster1660 // but no more than one component of each type per cluster 1456 1661 1457 1662 ///////////////////////////////// … … 1471 1676 found_icu = 1; 1472 1677 1473 if (icu_channels > 0) 1678 if ( periph[periph_index]->channels < 1679 (header->irq_per_proc * cluster[cluster_index]->procs) ) 1474 1680 { 1475 assert( (periph[periph_index]->channels == icu_channels) && 1476 "[XML ERROR] the number of interruptions per processor " 1477 "from the ICU (icu channels) must be the same on all " 1478 "clusters"); 1479 } 1480 else 1481 { 1482 icu_channels = periph[periph_index]->channels; 1681 printf("[XML ERROR] ICU channels smaller than PROCS * IRQ_PER_PROC\n"); 1682 printf(" - icu channels = %d\n - nprocs = %d\n - irq_per_proc = %d\n", 1683 periph[periph_index]->channels, 1684 cluster[cluster_index]->procs, 1685 header->irq_per_proc ); 1686 exit(1); 1483 1687 } 1484 1688 } … … 1498 1702 found_timer = 1; 1499 1703 if (tim_channels < periph[periph_index]->channels) 1500 {1501 1704 tim_channels = periph[periph_index]->channels; 1502 }1503 1705 } 1504 1706 ////////////////////////////////// … … 1512 1714 use_xcu = 1; 1513 1715 1514 if (icu_channels > 0) 1716 if ( periph[periph_index]->channels < 1717 (header->irq_per_proc * cluster[cluster_index]->procs) ) 1515 1718 { 1516 assert( (periph[periph_index]->channels == icu_channels) && 1517 "[XML ERROR] the number of interruptions per processor " 1518 "from the ICU (icu channels) must be the same on all " 1519 "clusters"); 1719 printf("[XML ERROR] XCU channels smaller than PROCS * IRQ_PER_PROC\n"); 1720 printf(" - xcu channels = %d\n - nprocs = %d\n - irq_per_proc = %d\n", 1721 periph[periph_index]->channels, 1722 cluster[cluster_index]->procs, 1723 header->irq_per_proc ); 1724 exit(1); 1725 } 1726 } 1727 else 1728 { 1729 printf("[XML ERROR] illegal peripheral type: %s in cluster %d\n", 1730 str, cluster_index); 1731 exit(1); 1732 } 1733 1734 if (error) 1735 { 1736 printf("[XML ERROR] illegal peripheral %s in cluster %d\n", 1737 str, cluster_index); 1738 exit(1); 1739 } 1740 } 1741 else 1742 { 1743 printf("[XML ERROR] illegal or missing <type> for peripheral %d in cluster %d\n", 1744 periph_loc_index, cluster_index); 1745 exit(1); 1746 } 1747 1748 ////////////// set irq_offset attribute 1749 periph[periph_index]->irq_offset = irq_index; 1750 1751 #if XML_PARSER_DEBUG 1752 printf(" irq_offset = %d\n", irq_index ); 1753 #endif 1754 1755 ///////////// get IRQs 1756 int status = xmlTextReaderRead(reader); 1757 while (status == 1) 1758 { 1759 const char * tag = (const char *) xmlTextReaderConstName(reader); 1760 1761 if (strcmp(tag, "irq") == 0) 1762 { 1763 if ( (periph[periph_index]->type != PERIPH_TYPE_ICU) && 1764 (periph[periph_index]->type != PERIPH_TYPE_XCU) && 1765 (periph[periph_index]->type != PERIPH_TYPE_PIC) ) 1766 { 1767 printf("[XML ERROR] periph %d in cluster(%d,%d) " 1768 " only ICU, XCU and PIC can contain IRQs", 1769 periph_loc_index, cluster[cluster_index]->x, cluster[cluster_index]->y); 1770 exit(1); 1520 1771 } 1521 1772 else 1522 1773 { 1523 icu_channels = periph[periph_index]->channels;1774 irqNode(reader); 1524 1775 } 1525 1776 } 1777 else if (strcmp(tag, "#text") == 0) { } 1778 else if (strcmp(tag, "#comment") == 0) { } 1779 else if (strcmp(tag, "periph") == 0) 1780 { 1781 periph[periph_index]->irqs = irq_loc_index; 1782 cluster[cluster_index]->periphs++; 1783 periph_loc_index++; 1784 periph_index++; 1785 1786 #if XML_PARSER_DEBUG 1787 printf(" irqs = %d\n", irq_loc_index); 1788 printf(" irq_offset = %d\n", irq_index); 1789 #endif 1790 return; 1791 } 1526 1792 else 1527 1793 { 1528 printf("[XML ERROR] illegal <type>: %s for peripheral %d in cluster %d\n", 1529 str, periph_loc_index, cluster_index); 1794 printf("[XML ERROR] Unknown tag %s", tag); 1530 1795 exit(1); 1531 1796 } 1532 1533 if (error) 1534 { 1535 printf("[XML ERROR] illegal <type>: %s for peripheral %d in cluster %d\n", 1536 str, periph_loc_index, cluster_index); 1537 exit(1); 1538 } 1539 } 1540 else 1541 { 1542 printf("[XML ERROR] missing <type> for peripheral %d in cluster %d\n", 1543 periph_loc_index, cluster_index); 1544 exit(1); 1545 } 1546 1547 periph_index++; 1548 periph_loc_index++; 1549 cluster[cluster_index]->periphs++; 1550 1797 status = xmlTextReaderRead(reader); 1798 } 1551 1799 } // end periphNode 1552 1800 … … 1568 1816 1569 1817 #if XML_PARSER_DEBUG 1570 1818 printf("\n coproc %d\n", coproc_index); 1571 1819 #endif 1572 1820 … … 1578 1826 { 1579 1827 #if XML_PARSER_DEBUG 1580 1828 printf(" name = %s\n", str); 1581 1829 #endif 1582 1830 strncpy(coproc[coproc_index]->name, str, 31); … … 1603 1851 { 1604 1852 #if XML_PARSER_DEBUG 1605 1606 1607 1853 printf(" clusterid = %d\n", cluster_index); 1854 printf(" psegname = %s\n", str); 1855 printf(" psegid = %d\n", index); 1608 1856 #endif 1609 1857 coproc[coproc_index]->psegid = index; 1610 assert(pseg[index]->type == PSEG_TYPE_PERI && "coproc psegname attribute must refer to a pseg of type PERI" ); 1858 assert(pseg[index]->type == PSEG_TYPE_PERI && 1859 "coproc psegname attribute must refer to a pseg of type PERI" ); 1611 1860 } 1612 1861 else … … 1621 1870 1622 1871 #if XML_PARSER_DEBUG 1623 1872 printf(" port_offset = %d\n", cp_port_index); 1624 1873 #endif 1625 1874 … … 1653 1902 1654 1903 1655 ///////////////////////////////////// 1656 void irqNode(xmlTextReaderPtr reader)1904 ////////////////////////////////////// 1905 void procNode(xmlTextReaderPtr reader) 1657 1906 { 1658 1907 unsigned int ok; 1659 1908 unsigned int value; 1660 char * str;1661 1909 1662 1910 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 1663 1911 1664 if (irq_index >= MAX_IRQS) {1665 printf("[XML ERROR] The number of irqs is larger than %d\n", MAX_IRQS);1666 }1667 1668 #if XML_PARSER_DEBUG1669 printf(" irq %d\n", irq_loc_index);1670 #endif1671 1672 irq[irq_index] = (mapping_irq_t *) malloc(sizeof(mapping_irq_t));1673 1674 ///////// get type attribute1675 str = getStringValue(reader, "type", &ok);1676 if (ok)1677 {1678 #if XML_PARSER_DEBUG1679 printf(" type = %s\n", str);1680 #endif1681 if ( strcmp(str, "HARD") == 0 ) irq[irq_index]->type = IRQ_TYPE_HWI;1682 else if ( strcmp(str, "SOFT") == 0 ) irq[irq_index]->type = IRQ_TYPE_SWI;1683 else if ( strcmp(str, "TIME") == 0 ) irq[irq_index]->type = IRQ_TYPE_PTI;1684 else1685 {1686 printf("[XML ERROR] illegal IRQ <type> for processor %d in cluster %d\n",1687 cluster_index, proc_loc_index);1688 exit(1);1689 }1690 }1691 else1692 {1693 printf("[XML ERROR] missing IRQ <type> for processor %d in cluster %d\n",1694 cluster_index, proc_loc_index);1695 exit(1);1696 }1697 1698 ///////// get icuid attribute1699 value = getIntValue(reader, "icuid", &ok);1700 if (ok)1701 {1702 #if XML_PARSER_DEBUG1703 printf(" icuid = %d\n", value);1704 #endif1705 irq[irq_index]->icuid = value;1706 if (value >= 32)1707 {1708 printf("[XML ERROR] IRQ <icuid> too large for processor %d in cluster %d\n",1709 cluster_index, proc_loc_index);1710 exit(1);1711 }1712 }1713 else1714 {1715 printf("[XML ERROR] missing IRQ <icuid> for processor %d in cluster %d\n",1716 cluster_index, proc_loc_index);1717 exit(1);1718 }1719 1720 ///////// get isr attribute1721 str = getStringValue(reader, "isr", &ok);1722 if (ok)1723 {1724 #if XML_PARSER_DEBUG1725 printf(" isr = %s\n", str);1726 #endif1727 if (strcmp(str, "ISR_SWITCH" ) == 0) irq[irq_index]->isr = ISR_SWITCH;1728 else if (strcmp(str, "ISR_IOC" ) == 0) irq[irq_index]->isr = ISR_IOC;1729 else if (strcmp(str, "ISR_DMA" ) == 0) irq[irq_index]->isr = ISR_DMA;1730 else if (strcmp(str, "ISR_TTY" ) == 0) irq[irq_index]->isr = ISR_TTY;1731 else if (strcmp(str, "ISR_TIMER" ) == 0) irq[irq_index]->isr = ISR_TIMER;1732 else if (strcmp(str, "ISR_WAKUP" ) == 0) irq[irq_index]->isr = ISR_WAKUP;1733 else if (strcmp(str, "ISR_DEFAULT") == 0) irq[irq_index]->isr = ISR_DEFAULT;1734 else1735 {1736 printf("[XML ERROR] illegal IRQ <isr> for processor %d in cluster %d\n",1737 cluster_index, proc_loc_index);1738 exit(1);1739 }1740 #if XML_PARSER_DEBUG1741 printf(" isrnum = %d\n", irq[irq_index]->isr);1742 #endif1743 }1744 else1745 {1746 printf("[XML ERROR] missing IRQ <isr> for processor %d in cluster %d\n",1747 cluster_index, proc_loc_index);1748 exit(1);1749 }1750 1751 ///////// get channel attribute (optionnal : 0 if missing)1752 value = getIntValue(reader, "channel", &ok);1753 if (ok)1754 {1755 #if XML_PARSER_DEBUG1756 printf(" channel = %d\n", value);1757 #endif1758 irq[irq_index]->channel = value;1759 }1760 else1761 {1762 irq[irq_index]->channel = 0;1763 }1764 1765 irq_index++;1766 irq_loc_index++;1767 1768 } // end irqNode1769 1770 1771 //////////////////////////////////////1772 void procNode(xmlTextReaderPtr reader)1773 {1774 unsigned int ok;1775 unsigned int value;1776 1777 irq_loc_index = 0;1778 1779 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return;1780 1781 1912 if (proc_index >= MAX_PROCS) 1782 1913 { … … 1786 1917 1787 1918 #if XML_PARSER_DEBUG 1788 printf("\nproc %d\n", proc_index);1919 printf("\n proc %d\n", proc_index); 1789 1920 #endif 1790 1921 … … 1799 1930 exit(1); 1800 1931 } 1801 1802 ////////// set irq_offset attribute 1803 proc[proc_index]->irq_offset = irq_index; 1804 1805 #if XML_PARSER_DEBUG 1806 printf(" irq_offset = %d\n", irq_index); 1807 #endif 1808 1809 int status = xmlTextReaderRead(reader); 1810 while (status == 1) 1811 { 1812 const char * tag = (const char *) xmlTextReaderConstName(reader); 1813 1814 if (strcmp(tag, "irq") == 0) 1815 { 1816 irqNode(reader); 1817 } 1818 else if (strcmp(tag, "#text") == 0) { } 1819 else if (strcmp(tag, "#comment") == 0) { } 1820 else if (strcmp(tag, "proc") == 0) 1821 { 1822 proc[proc_index]->irqs = irq_loc_index; 1823 cluster[cluster_index]->procs++; 1824 proc_loc_index++; 1825 proc_index++; 1826 return; 1827 } 1828 else 1829 { 1830 printf("[XML ERROR] Unknown tag %s", tag); 1831 exit(1); 1832 } 1833 status = xmlTextReaderRead(reader); 1834 } 1932 proc[proc_index]->index = proc_loc_index; 1933 1934 cluster[cluster_index]->procs++; 1935 proc_loc_index++; 1936 proc_index++; 1835 1937 } // end procNode() 1836 1938 … … 1852 1954 1853 1955 #if XML_PARSER_DEBUG 1854 1956 printf(" pseg %d\n", pseg_index); 1855 1957 #endif 1856 1958 … … 1860 1962 str = getStringValue(reader, "name", &ok); 1861 1963 #if XML_PARSER_DEBUG 1862 1964 printf(" name = %s\n", str); 1863 1965 #endif 1864 1966 if (ok) … … 1876 1978 str = getStringValue(reader, "type", &ok); 1877 1979 #if XML_PARSER_DEBUG 1878 1980 printf(" type = %s\n", str); 1879 1981 #endif 1880 1982 if (ok && (strcmp(str, "RAM" ) == 0)) { pseg[pseg_index]->type = PSEG_TYPE_RAM; } … … 1891 1993 ll_value = getPaddrValue(reader, "base", &ok); 1892 1994 #if XML_PARSER_DEBUG 1893 1995 printf(" base = 0x%llx\n", ll_value); 1894 1996 #endif 1895 1997 if (ok) … … 1906 2008 ll_value = getPaddrValue(reader, "length", &ok); 1907 2009 #if XML_PARSER_DEBUG 1908 2010 printf(" length = 0x%llx\n", ll_value); 1909 2011 #endif 1910 2012 if (ok) … … 1956 2058 found_mmc = 0; 1957 2059 1958 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) { 1959 return; 1960 } 2060 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 1961 2061 1962 2062 #if XML_PARSER_DEBUG … … 2024 2124 else if (strcmp(tag, "cluster") == 0) 2025 2125 { 2026 2027 ///////// TIMER and ICU peripheral are mandatory //////////////2028 if ( !found_timer && !found_xcu)2126 ///////// TIMER and ICU peripheral are mandatory when nprocs != 0 2127 unsigned int procs = cluster[cluster_index]->procs; 2128 if ( procs && !found_timer && !found_xcu) 2029 2129 { 2030 2130 printf("[XML ERROR] missing timer peripheral in cluster %d\n", cluster_index); … … 2032 2132 } 2033 2133 2034 if ( !found_icu && !found_xcu)2134 if ( procs && !found_icu && !found_xcu) 2035 2135 { 2036 2136 printf("[XML ERROR] missing icu peripheral in cluster %d\n", cluster_index); … … 2038 2138 } 2039 2139 2040 if (nb_proc_max < cluster[cluster_index]->procs) 2041 { 2042 nb_proc_max = cluster[cluster_index]->procs; 2043 } 2140 if (nb_procs_max < procs) nb_procs_max = procs; 2044 2141 2045 2142 #if XML_PARSER_DEBUG … … 2077 2174 else if (strcmp(tag, "clusterset") == 0) 2078 2175 { 2079 // checking source file consistency2176 // checking number of clusters 2080 2177 if ( cluster_index != (header->x_size * header->y_size) ) 2081 2178 { … … 2084 2181 } 2085 2182 2086 // At least oneTTY terminal for system boot2087 if ( header->tty_cluster == 0xFFFFFFFF)2183 // checking TTY terminal for system boot 2184 if ( tty_channels == 0 ) 2088 2185 { 2089 printf("[XML ERROR] illegal or missing tty peripheral");2186 printf("[XML ERROR] missing TTY peripheral\n"); 2090 2187 exit(1); 2091 2188 } 2092 2189 2093 // the number of ICU channels must be NB_PROCS * irq_per_proc2094 if ( icu_channels != (header->irq_per_proc * proc_loc_index))2190 // checking IOC sub-types 2191 if ( (use_bdv + use_hba + use_spi) > 1 ) 2095 2192 { 2096 printf("[XML ERROR] illegal ICU number of channels. " 2097 "It must be equal to NB_PROCS * IRQ_PER_PROC\n"); 2193 printf("[XML ERROR] all IOC peripherals must have the same type\n"); 2098 2194 exit(1); 2099 2195 } … … 2134 2230 const char * tag = (const char *) xmlTextReaderConstName(reader); 2135 2231 2136 if (strcmp(tag, "vseg") == 0) { vsegNode(reader); } 2232 if (strcmp(tag, "vseg") == 0) 2233 { 2234 vsegNode( reader ); 2235 header->globals = header->globals + 1; 2236 } 2137 2237 else if (strcmp(tag, "#text") == 0) { } 2138 2238 else if (strcmp(tag, "#comment") == 0) { } … … 2142 2242 printf(" end global set\n\n"); 2143 2243 #endif 2144 header->globals = vseg_index;2145 2244 vseg_loc_index = 0; 2146 2245 return; … … 2178 2277 else if (strcmp(tag, "vspaceset") == 0 ) 2179 2278 { 2180 // checking source file consistency 2181 if (vspace_index != header->vspaces) 2182 { 2183 printf("[XML ERROR] Wrong number of vspaces\n"); 2184 exit(1); 2185 } 2186 else 2187 { 2188 header->vsegs = vseg_index; 2189 header->vobjs = vobj_index; 2190 header->tasks = task_index; 2191 return; 2192 } 2279 header->vsegs = vseg_index; 2280 header->vobjs = vobj_index; 2281 header->tasks = task_index; 2282 return; 2193 2283 } 2194 2284 else … … 2282 2372 } 2283 2373 2284 //check the number of cluster 2374 /////////// get x_io attribute 2375 unsigned int x_io = getIntValue(reader, "x_io", &ok); 2376 #if XML_PARSER_DEBUG 2377 printf(" x_io = %d\n", x_io); 2378 #endif 2379 if ( ok && (x_io < x_size) ) 2380 { 2381 header->x_io = x_io; 2382 } 2383 else 2384 { 2385 printf("[XML ERROR] illegal or missing <x_io> attribute in header\n"); 2386 exit(1); 2387 } 2388 2389 /////////// get y_io attribute 2390 unsigned int y_io = getIntValue(reader, "y_io", &ok); 2391 #if XML_PARSER_DEBUG 2392 printf(" y_io = %d\n", y_size); 2393 #endif 2394 if ( ok &&(y_io < y_size) ) 2395 { 2396 header->y_io = y_io; 2397 } 2398 else 2399 { 2400 printf("[XML ERROR] illegal or missing <y_io> attribute in header\n"); 2401 exit(1); 2402 } 2403 2404 // check the number of cluster 2285 2405 if ( (x_size * y_size) >= MAX_CLUSTERS ) 2286 2406 { … … 2289 2409 } 2290 2410 2291 ///////// get vspaces attribute 2292 value = getIntValue(reader, "vspaces", &ok); 2293 if (ok) 2294 { 2295 if (value >= MAX_VSPACES) 2296 { 2297 printf("[XML ERROR] The number of vspaces is larger than %d\n", MAX_VSPACES); 2298 exit(1); 2299 } 2300 #if XML_PARSER_DEBUG 2301 printf(" vspaces = %d\n", value); 2302 #endif 2303 header->vspaces = value; 2304 } 2305 else 2306 { 2307 printf("[XML ERROR] illegal or missing <vspaces> attribute in mapping\n"); 2308 exit(1); 2309 } 2310 2311 ///////// get increment attribute 2312 value = getIntValue(reader, "increment", &ok); 2313 if (ok) 2314 { 2315 if ( (value != 0x10000) && (value != 0x8000) && 2316 (value != 0x4000) && (value != 0x2000) ) 2317 2318 { 2319 printf("[XML ERROR] The vseg increment must be one of the following: "); 2320 printf(" 0x00010000 / 0x00008000 / 0x00004000 / 0x00002000"); 2321 exit(1); 2322 } 2323 #if XML_PARSER_DEBUG 2324 printf(" increment = %d\n", value); 2325 #endif 2326 header->increment = value; 2327 } 2328 else 2329 { 2330 printf("[XML ERROR] illegal or missing <increment> attribute in mapping\n"); 2331 exit(1); 2332 } 2333 2334 ///////// get increment attribute 2411 ///////// get irq_per_proc attribute 2335 2412 value = getIntValue(reader, "irq_per_proc", &ok); 2336 2413 if (ok) … … 2347 2424 } 2348 2425 2349 //////// initialise non replicated peripherals cluster index 2350 header->cma_cluster = 0xFFFFFFFF; 2351 header->cma_cluster_bis = 0xFFFFFFFF; 2352 2353 header->fbf_cluster = 0xFFFFFFFF; 2354 header->fbf_cluster_bis = 0xFFFFFFFF; 2355 2356 header->iob_cluster = 0xFFFFFFFF; 2357 header->iob_cluster_bis = 0xFFFFFFFF; 2358 2359 header->ioc_cluster = 0xFFFFFFFF; 2360 header->ioc_cluster_bis = 0xFFFFFFFF; 2361 2362 header->nic_cluster = 0xFFFFFFFF; 2363 header->nic_cluster_bis = 0xFFFFFFFF; 2364 2365 header->rom_cluster = 0xFFFFFFFF; 2366 header->rom_cluster_bis = 0xFFFFFFFF; 2367 2368 header->sim_cluster = 0xFFFFFFFF; 2369 header->sim_cluster_bis = 0xFFFFFFFF; 2370 2371 header->tty_cluster = 0xFFFFFFFF; 2372 header->tty_cluster_bis = 0xFFFFFFFF; 2373 2374 ///////// set signature 2426 ///////// get use_ramdisk attribute (default = 0) 2427 value = getIntValue(reader, "use_ramdisk", &ok); 2428 if (ok) 2429 { 2430 #if XML_PARSER_DEBUG 2431 printf(" use_ramdisk = %d\n", value); 2432 #endif 2433 header->use_ramdisk = value; 2434 } 2435 else 2436 { 2437 header->use_ramdisk = 0; 2438 } 2439 2440 ///////// set other header fields 2441 header->increment = 0x10000; 2375 2442 header->signature = IN_MAPPING_SIGNATURE; 2443 header->globals = 0; 2444 header->vspaces = 0; 2445 header->psegs = 0; 2446 header->vsegs = 0; 2447 header->vobjs = 0; 2448 header->tasks = 0; 2449 header->procs = 0; 2450 header->irqs = 0; 2451 header->coprocs = 0; 2452 header->cp_ports = 0; 2453 header->periphs = 0; 2454 2376 2455 2377 2456 int status = xmlTextReaderRead(reader); … … 2380 2459 const char * tag = (const char *) xmlTextReaderConstName(reader); 2381 2460 2382 if (strcmp(tag, "clusterset") == 0) 2383 { 2384 clusterSetNode(reader); 2385 } 2461 if (strcmp(tag, "clusterset") == 0) { clusterSetNode(reader); } 2386 2462 else if (strcmp(tag, "globalset") == 0) { globalSetNode(reader); } 2387 2463 else if (strcmp(tag, "vspaceset") == 0) { vspaceSetNode(reader); } … … 2591 2667 def_int_write(fdout, "X_WIDTH ", header->x_width); 2592 2668 def_int_write(fdout, "Y_WIDTH ", header->y_width); 2669 def_int_write(fdout, "X_IO ", header->x_io); 2670 def_int_write(fdout, "Y_IO ", header->y_io); 2593 2671 2594 2672 file_write(fdout, "\n"); 2595 2673 2596 def_int_write(fdout, "NB_PROCS_MAX ", nb_proc _max);2674 def_int_write(fdout, "NB_PROCS_MAX ", nb_procs_max); 2597 2675 def_int_write(fdout, "NB_TASKS_MAX ", nb_tasks_max); 2598 2676 … … 2605 2683 2606 2684 def_int_write(fdout, "NB_TTY_CHANNELS ", tty_channels); 2607 def_int_write(fdout, "NB_ HBA_CHANNELS ", hba_channels);2685 def_int_write(fdout, "NB_IOC_CHANNELS ", ioc_channels); 2608 2686 def_int_write(fdout, "NB_NIC_CHANNELS ", nic_channels); 2609 2687 def_int_write(fdout, "NB_CMA_CHANNELS ", cma_channels); … … 2613 2691 def_int_write(fdout, "USE_XICU ", use_xcu); 2614 2692 def_int_write(fdout, "USE_IOB ", use_iob); 2615 def_int_write(fdout, "USE_HBA ", use_hba); 2616 def_int_write(fdout, "USE_BDV ", use_bdv); 2617 def_int_write(fdout, "USE_SPI ", use_spi); 2693 def_int_write(fdout, "USE_PIC ", use_pic); 2694 2695 file_write(fdout, "\n"); 2696 2697 def_int_write(fdout, "USE_IOC_RDK ", header->use_ramdisk); 2698 def_int_write(fdout, "USE_IOC_HBA ", use_hba); 2699 def_int_write(fdout, "USE_IOC_BDV ", use_bdv); 2700 def_int_write(fdout, "USE_IOC_SPI ", use_spi); 2618 2701 2619 2702 file_write(fdout, "\n"); … … 2638 2721 { 2639 2722 int fdout = open_file(file_path); 2640 unsigned int count = 0;2723 unsigned int count; 2641 2724 unsigned int vseg_id; 2642 2725 unsigned int base; // vseg base … … 2648 2731 file_write(fdout, prol); 2649 2732 2650 // boot and kernel segments2651 for (vseg_id = 0 ; vseg_id < header->vsegs ; vseg_id++)2733 // boot mandatory global vsegs 2734 for (vseg_id = 0 , count = 0 ; vseg_id < header->vsegs ; vseg_id++) 2652 2735 { 2653 2736 if ( strcmp(vseg[vseg_id]->name, "seg_boot_code") == 0 ) … … 2691 2774 count++; 2692 2775 } 2693 else if ( strcmp(vseg[vseg_id]->name, "seg_kernel_code") == 0 ) 2694 { 2695 base = vseg[vseg_id]->vbase; 2696 size = vobj[vseg[vseg_id]->vobj_offset]->length; 2697 ld_write(fdout, "seg_kernel_code_base ", base); 2698 ld_write(fdout, "seg_kernel_code_size ", size); 2699 count++; 2700 } 2701 else if ( strcmp(vseg[vseg_id]->name, "seg_kernel_data") == 0 ) 2702 { 2703 base = vseg[vseg_id]->vbase; 2704 size = vobj[vseg[vseg_id]->vobj_offset]->length; 2705 ld_write(fdout, "seg_kernel_data_base ", base); 2706 ld_write(fdout, "seg_kernel_data_size ", size); 2707 count++; 2708 } 2709 else if ( strcmp(vseg[vseg_id]->name, "seg_kernel_uncdata") == 0 ) 2710 { 2711 base = vseg[vseg_id]->vbase; 2712 size = vobj[vseg[vseg_id]->vobj_offset]->length; 2713 ld_write(fdout, "seg_kernel_uncdata_base ", base); 2714 ld_write(fdout, "seg_kernel_uncdata_size ", size); 2715 count++; 2716 } 2717 else if ( strcmp(vseg[vseg_id]->name, "seg_kernel_init") == 0 ) 2718 { 2719 base = vseg[vseg_id]->vbase; 2720 size = vobj[vseg[vseg_id]->vobj_offset]->length; 2721 ld_write(fdout, "seg_kernel_init_base ", base); 2722 ld_write(fdout, "seg_kernel_init_size ", size); 2723 count++; 2724 } 2725 } 2726 if ( count != 9 ) 2776 } 2777 2778 if ( count != 5 ) 2727 2779 { 2728 printf ("[XML ERROR] Missing Boot or Kernel vseg : only %d\n", count);2780 printf ("[XML ERROR] Missing mandatory Boot global vseg : only %d\n", count); 2729 2781 printf ("Mandatory segments are :\n"); 2730 2782 printf (" - seg_boot_code\n"); … … 2733 2785 printf (" - seg_boot_mapping\n"); 2734 2786 printf (" - seg_boot_buffer\n"); 2787 exit(0); 2788 } 2789 2790 file_write(fdout, "\n"); 2791 2792 // kernel mandatory global vsegs 2793 for (vseg_id = 0, count = 0 ; vseg_id < header->vsegs ; vseg_id++) 2794 { 2795 if ( strcmp(vseg[vseg_id]->name, "seg_kernel_code") == 0 ) 2796 { 2797 base = vseg[vseg_id]->vbase; 2798 size = vobj[vseg[vseg_id]->vobj_offset]->length; 2799 ld_write(fdout, "seg_kernel_code_base ", base); 2800 ld_write(fdout, "seg_kernel_code_size ", size); 2801 count++; 2802 } 2803 else if ( strcmp(vseg[vseg_id]->name, "seg_kernel_data") == 0 ) 2804 { 2805 base = vseg[vseg_id]->vbase; 2806 size = vobj[vseg[vseg_id]->vobj_offset]->length; 2807 ld_write(fdout, "seg_kernel_data_base ", base); 2808 ld_write(fdout, "seg_kernel_data_size ", size); 2809 count++; 2810 } 2811 else if ( strcmp(vseg[vseg_id]->name, "seg_kernel_uncdata") == 0 ) 2812 { 2813 base = vseg[vseg_id]->vbase; 2814 size = vobj[vseg[vseg_id]->vobj_offset]->length; 2815 ld_write(fdout, "seg_kernel_uncdata_base ", base); 2816 ld_write(fdout, "seg_kernel_uncdata_size ", size); 2817 count++; 2818 } 2819 else if ( strcmp(vseg[vseg_id]->name, "seg_kernel_init") == 0 ) 2820 { 2821 base = vseg[vseg_id]->vbase; 2822 size = vobj[vseg[vseg_id]->vobj_offset]->length; 2823 ld_write(fdout, "seg_kernel_init_base ", base); 2824 ld_write(fdout, "seg_kernel_init_size ", size); 2825 count++; 2826 } 2827 } 2828 if ( count != 4 ) 2829 { 2830 printf ("[XML ERROR] Missing mandatory Kernel global vseg : only %d\n", count); 2831 printf ("Mandatory segments are :\n"); 2735 2832 printf (" - seg_kernel_code\n"); 2736 2833 printf (" - seg_kernel_data\n"); 2737 2834 printf (" - seg_kernel_uncdata\n"); 2738 2835 printf (" - seg_kernel_init\n"); 2739 } 2740 2836 exit(0); 2837 } 2838 2839 file_write(fdout, "\n"); 2840 2841 // boot and kernel optionnal global vsegs (pseudo ROMs) 2842 unsigned int seg_ram_disk_base = 0xFFFFFFFF; 2843 unsigned int seg_ram_disk_size = 0; 2844 unsigned int seg_reset_code_base = 0xFFFFFFFF; 2845 unsigned int seg_reset_code_size = 0; 2846 for (vseg_id = 0 ; vseg_id < header->vsegs ; vseg_id++) 2847 { 2848 if ( strcmp(vseg[vseg_id]->name, "seg_reset_code") == 0 ) 2849 { 2850 seg_reset_code_base = vseg[vseg_id]->vbase; 2851 seg_reset_code_size = vobj[vseg[vseg_id]->vobj_offset]->length; 2852 } 2853 if ( strcmp(vseg[vseg_id]->name, "seg_ram_disk") == 0 ) 2854 { 2855 seg_ram_disk_base = vseg[vseg_id]->vbase; 2856 seg_ram_disk_size = vobj[vseg[vseg_id]->vobj_offset]->length; 2857 } 2858 } 2859 2860 ld_write(fdout, "seg_reset_code_base ", seg_reset_code_base); 2861 ld_write(fdout, "seg_reset_code_size ", seg_reset_code_size); 2862 ld_write(fdout, "seg_ram_disk_base ", seg_ram_disk_base); 2863 ld_write(fdout, "seg_ram_disk_size ", seg_ram_disk_size); 2864 2741 2865 file_write(fdout, "\n"); 2742 2866 … … 2744 2868 set_periph_vbase_array(); 2745 2869 2746 // non replicated peripherals2870 // non replicated peripherals 2747 2871 ld_write(fdout, "seg_cma_base ", periph_vbase_array[PERIPH_TYPE_CMA]); 2748 2872 ld_write(fdout, "seg_fbf_base ", periph_vbase_array[PERIPH_TYPE_FBF]); … … 2753 2877 ld_write(fdout, "seg_sim_base ", periph_vbase_array[PERIPH_TYPE_SIM]); 2754 2878 ld_write(fdout, "seg_tty_base ", periph_vbase_array[PERIPH_TYPE_TTY]); 2879 ld_write(fdout, "seg_pic_base ", periph_vbase_array[PERIPH_TYPE_PIC]); 2755 2880 2756 2881 file_write(fdout, "\n");
Note: See TracChangeset
for help on using the changeset viewer.