Changeset 262


Ignore:
Timestamp:
Dec 14, 2013, 8:39:48 PM (11 years ago)
Author:
cfuguet
Message:
  • Modification in giet_xml/xml_parser.c: When parsing IRQs, compare agains IRQ_TYPE_* constants instead of numbers for readibility
  • Modification in giet_common/utils.c Adding utility function to write on CP0 status register
  • Modification in giet_boot/boot.c After loading the kernel.elf file, the GIET exception handler is available (giet entry point). Therefore, we can reset the BEV bit of the status register to use the giet entry point instead of the preloader entry point in case of exception during kernel init function.
Location:
soft/giet_vm
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_boot/boot.c

    r258 r262  
    20992099    }  // end monoprocessor boot
    21002100
     2101    // reset BEV bit in the status register to use GIET exception
     2102    // handler instead of the PRELOADER exception handler
     2103    _set_sr( 0 );
     2104
    21012105    // all processor initialise SCHED register
    21022106    _set_sched( (unsigned int)_schedulers[procid] );
  • soft/giet_vm/giet_common/utils.c

    r258 r262  
    150150    asm volatile( "mfc0    %0,        $12" : "=r"(ret));
    151151    return ret;
     152}
     153//////////////////////////////////////////////////////////////////////////////
     154// This function set a new value for the CP0 status register.
     155//////////////////////////////////////////////////////////////////////////////
     156inline void _set_sr(unsigned int val)
     157{
     158    asm volatile( "mtc0    %0,        $12" ::"r" (val));
    152159}
    153160//////////////////////////////////////////////////////////////////////////////////
  • soft/giet_vm/giet_xml/Makefile

    r258 r262  
    33
    44bin2xml: xml_driver.c mapping_info.h
    5         gcc -Wall -g -I. -I../sys xml_driver.c -o bin2xml
     5        gcc -Wall -I. -I../sys xml_driver.c -o bin2xml
    66
    77xml2bin: xml_parser.c mapping_info.h
    8         gcc -Wall -g -I. -I../giet_kernel -I/usr/include/libxml2 xml_parser.c -o xml2bin -lxml2
     8        gcc -Wall -I. -I../giet_kernel -I/usr/include/libxml2 xml_parser.c -o xml2bin -lxml2
    99
    1010test:
     
    1818
    1919clean:
    20         rm xml2bin bin2xml
    21 
    22 
     20        rm -f xml2bin bin2xml
  • soft/giet_vm/giet_xml/xml_parser.c

    r258 r262  
    15451545        printf("        type    = %s\n", str);
    15461546#endif
    1547         if      ( strcmp(str, "HARD") == 0 ) irq[irq_index]->type = 0;
    1548         else if ( strcmp(str, "SOFT") == 0 ) irq[irq_index]->type = 1;
    1549         else if ( strcmp(str, "TIME") == 0 ) irq[irq_index]->type = 2;
     1547        if      ( strcmp(str, "HARD") == 0 ) irq[irq_index]->type = IRQ_TYPE_HWI;
     1548        else if ( strcmp(str, "SOFT") == 0 ) irq[irq_index]->type = IRQ_TYPE_SWI;
     1549        else if ( strcmp(str, "TIME") == 0 ) irq[irq_index]->type = IRQ_TYPE_PTI;
    15501550        else   
    15511551        {
Note: See TracChangeset for help on using the changeset viewer.