Ignore:
Timestamp:
Jul 10, 2014, 11:23:57 AM (10 years ago)
Author:
cfuguet
Message:

giet_tsar: using CLUSTER_IO constant in stdio functions

  • Erasing also extra end-of-line spaces
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/softs/giet_tsar/giet.S

    r743 r744  
    44*       Date : 15/01/2014
    55*********************************************************************************
    6 * This is a very simple Interrupts/Exception/Traps handler for a generic 
     6* This is a very simple Interrupts/Exception/Traps handler for a generic
    77* multi-clusters / multi-processors TSAR architecture (up to 256 clusters,
    8 * up to 4  processors per cluster). 
     8* up to 4  processors per cluster).
    99* The physical address is 40 bits, and the 8 MSB bits A[39:32] define the
    1010* cluster index.
     
    1515    .section .giet,"ax",@progbits
    1616    .align 2
    17     .global _interrupt_vector   
     17    .global _interrupt_vector
    1818
    1919    .extern seg_xcu_base
     
    7878*   System Call Handler
    7979*
    80 * As the GIET_TSAR does not support system calls, 
     80* As the GIET_TSAR does not support system calls,
    8181* an error message is displayed on TTY0, the program is killed.
    8282****************************************************************/
     
    9797
    9898    mfc0    $4,     $14             /* $4 <= EPC */
    99     la      $5,     _itoa_buffer    /* $5 <= buffer address */ 
     99    la      $5,     _itoa_buffer    /* $5 <= buffer address */
    100100    addiu   $5,     $5,     2       /* skip the 0x prefix */
    101101    jal     _itoa_hex               /* fill the buffer */
     
    108108    nop
    109109
    110     j       _exit                   /* end of program */ 
     110    j       _exit                   /* end of program */
    111111
    112112_itoa_buffer: .ascii "0x00000000"
     
    122122* It makes the assumption that there is only one interrupt per
    123123* entry in the interrupt vector (it can be PTI, HWI, or WTI).
    124 * In case of a multi-clusters architecture, it exist one XCU 
    125 * per cluster, and the base address of the ICU segment depends 
     124* In case of a multi-clusters architecture, it exist one XCU
     125* per cluster, and the base address of the ICU segment depends
    126126* on both the cluster_xy and the proc_id:
    127127* - base_address = seg_xcu_base + (32*local_id) + (4G*cluster_xy)
     
    164164    sw      $31,    4*21($29)       /* save $31 */
    165165    mfc0    $27,    $14
    166     sw      $27,    4*22($29)       /* save EPC */ 
     166    sw      $27,    4*22($29)       /* save EPC */
    167167
    168168    /* XICU PRIO register address computation         */
     
    170170    /* and we must use the physical address extension */
    171171    mfc0    $10,    $15,    1        /* $10 <= proc_id                                 */
    172     andi    $10,    $10,    0x3FF    /* at most 1024 processors                        */ 
     172    andi    $10,    $10,    0x3FF    /* at most 1024 processors                        */
    173173    li      $11,    NB_PROCS_MAX
    174174    divu    $10,    $11
     
    194194    andi    $27,    $15,    0x4      /* test bit W in PRIO register                    */
    195195    bne     $27,    $0,     _int_WTI /* branch to WTI handler                          */
    196    
     196
    197197    /* exit interrupt handler: restore registers */
    198198_int_restore:
     
    200200    lw      $1,     4*4($29)
    201201    .set at
    202     lw      $2,     4*5($29) 
    203     lw      $3,     4*6($29) 
     202    lw      $2,     4*5($29)
     203    lw      $3,     4*6($29)
    204204    lw      $4,     4*7($29)
    205     lw      $5,     4*8($29) 
     205    lw      $5,     4*8($29)
    206206    lw      $6,     4*9($29)
    207     lw      $7,     4*10($29) 
     207    lw      $7,     4*10($29)
    208208    lw      $8,     4*11($29)
    209209    lw      $9,     4*12($29)
     
    217217    lw      $25,    4*20($29)
    218218    lw      $31,    4*21($29)
    219     lw      $27,    4*22($29)        /* get EPC */ 
     219    lw      $27,    4*22($29)        /* get EPC */
    220220    addiu   $29,    $29,    23*4     /* restore SP */
    221221    mtc0    $27,    $14              /* restore EPC */
     
    233233    la      $27,    _interrupt_vector
    234234    addu    $26,    $26,    $27
    235     lw      $26,    ($26)            /* read ISR address             */ 
     235    lw      $26,    ($26)            /* read ISR address             */
    236236    jalr    $26                      /* call ISR                     */
    237237    nop
     
    246246    la      $27,    _interrupt_vector
    247247    addu    $26,    $26,    $27      /* $26 <= &ISR[HWI_INDEX        */
    248     lw      $26,    ($26)            /* read ISR address             */ 
     248    lw      $26,    ($26)            /* read ISR address             */
    249249    jalr    $26                      /* call ISR                     */
    250250    nop
     
    262262    la      $27,    _interrupt_vector
    263263    addu    $26,    $26,    $27      /* $26 <= &ISR[WTI_INDEX]       */
    264     lw      $26,    ($26)            /* read ISR address             */ 
     264    lw      $26,    ($26)            /* read ISR address             */
    265265    jalr    $26                      /* call ISR                     */
    266266    nop
    267267    j       _int_restore             /* return from INT handler */
    268268    nop
    269    
     269
    270270/* The default ISR is called when no specific ISR has been installed */
    271271/* in the interrupt vector. It simply displays a message on TTY0     */
     
    273273isr_default:
    274274    addiu   $29,    $29,    -20     /* get space in stack */
    275     sw      $31,    16($29)         /* to save the return address */ 
     275    sw      $31,    16($29)         /* to save the return address */
    276276    la      $4,     _msg_default    /* $4 <= string address */
    277277    addi    $5,     $0,     36      /* $5 <= string length */
    278278    li      $6,     0               /* $6 <= TTY0 */
    279     jal     _tty_write 
    280     lw      $31,    16($29)         /* restore return address */ 
     279    jal     _tty_write
     280    lw      $31,    16($29)         /* restore return address */
    281281    addiu   $29,    $29,    20      /* free space */
    282282    jr      $31                     /* returns to interrupt handler */
     
    284284/****************************************************************
    285285*  Interrupt Vector Table (indexed by interrupt index)
    286 *  32 words corresponding to 32 ISR addresses 
     286*  32 words corresponding to 32 ISR addresses
    287287****************************************************************/
    288288_interrupt_vector:
     
    355355    li      $5,     36              /* $5 <= message length */
    356356    li      $6,     0               /* $6 <= TTY0 */
    357     jal     _tty_write               
     357    jal     _tty_write
    358358    nop
    359359
     
    362362    li      $5,     8               /* $5 <= message length */
    363363    li      $6,     0               /* $6 <= TTY0 */
    364     jal     _tty_write           
    365     nop
    366    
     364    jal     _tty_write
     365    nop
     366
    367367    mfc0    $4,     $14             /* $4 <= EPC value */
    368368    la      $5,     _itoa_buffer    /* $5 <= buffer address */
     
    377377    nop
    378378
    379     /* display BAR value */ 
     379    /* display BAR value */
    380380    la      $4,     _msg_bar        /* $4 <= message address */
    381381    li      $5,     8               /* $5 <= message length */
     
    385385
    386386    mfc0    $4,     $8              /* $4 <= BAR value */
    387     la      $5,     _itoa_buffer    /* $5 <= buffer address */ 
    388     addiu   $5,     $5,     2       /* skip 0x prefix */ 
     387    la      $5,     _itoa_buffer    /* $5 <= buffer address */
     388    addiu   $5,     $5,     2       /* skip 0x prefix */
    389389    jal     _itoa_hex               /* fill buffer */
    390390    nop
     
    393393    li      $5,     10              /* $5 <= message length */
    394394    li      $6,     0               /* $6 <= TTY0 */
    395     jal     _tty_write 
    396     nop
    397 
    398    
     395    jal     _tty_write
     396    nop
     397
     398
    399399    /* release the lock on TTY0 */
    400400    li      $4,     0
Note: See TracChangeset for help on using the changeset viewer.