Changeset 2cdde6d in rtems


Ignore:
Timestamp:
Apr 16, 2001, 8:03:31 PM (19 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
4055e6f8
Parents:
d74a92d
Message:

2001-04-16 Joel Sherrill <joel@…>

  • start/start.S, startup/bspstart.c, startup/linkcmds: Cleanup that was not merged from the simple non-RTEMS program.
Location:
c/src/lib/libbsp/mips/genmongoosev
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/mips/genmongoosev/ChangeLog

    rd74a92d r2cdde6d  
     12001-04-16      Joel Sherrill <joel@OARcorp.com>
     2
     3        * start/start.S, startup/bspstart.c, startup/linkcmds:
     4        Cleanup that was not merged from the simple non-RTEMS program.
     5
    162001-04-16      Joel Sherrill <joel@OARcorp.com>
    27
  • c/src/lib/libbsp/mips/genmongoosev/start/start.S

    rd74a92d r2cdde6d  
    11/*
    2  * start.S -- startup file for GENMONGOOSE-V BSP. 
    3  * It is based on the JMR3904 BSP which is in turn based upon
    4  * support in newlib-1.8.2/libgloss/mips and adapted for RTEMS.
     2 * start.S -- startup file for JMR3904 BSP based upon crt0.S from
     3 * newlib-1.8.2/libgloss/mips and adapted for RTEMS.
    54 *
    6  *  COPYRIGHT (c) 2001.
    7  *  On-Line Applications Research Corporation (OAR).
    8  *  Mongoose-V Modifications
    9  *
    105 * crt0.S -- startup file for MIPS.
    116 *
     
    2318 */
    2419
     20#include <asm.h>
     21#include "regs.S"
     22
    2523#ifdef __mips16
    2624/* This file contains 32 bit assembly code.  */
    2725        .set nomips16
    2826#endif
    29 
    30 #include "regs.S"
    3127
    3228/* This is for referencing addresses that are not in the .sdata or
     
    4238#endif /* __mips_embedded_pic */
    4339
    44 #define zero            $0
    45 #define AT              $1              /* assembler temporaries */
    46 #define v0              $2              /* value holders */
    47 #define v1              $3
    48 #define a0              $4              /* arguments */
    49 #define a1              $5
    50 #define a2              $6
    51 #define a3              $7
    52 #define t0              $8              /* temporaries */
    53 #define t1              $9
    54 #define t2              $10
    55 #define t3              $11
    56 #define t4              $12
    57 #define t5              $13
    58 #define t6              $14
    59 #define t7              $15
    60 #define s0              $16             /* saved registers */
    61 #define s1              $17
    62 #define s2              $18
    63 #define s3              $19
    64 #define s4              $20
    65 #define s5              $21
    66 #define s6              $22
    67 #define s7              $23
    68 #define t8              $24             /* temporaries */
    69 #define t9              $25
    70 #define k0              $26             /* kernel registers */
    71 #define k1              $27
    72 #define gp              $28             /* global pointer */
    73 #define sp              $29             /* stack pointer */
    74 #define s8              $30             /* saved register */
    75 #define fp              $30             /* frame pointer (old usage) */
    76 #define ra              $31             /* return address */
    77 
    78 
    79 
    80        
    8140        .text
    8241        .align  2
     
    8746 */
    8847        nop
    89        
     48
    9049        .globl  _start
    9150        .ent    _start
     
    10059_branch:
    10160        move    $5, $31                         # $5 == where are we
    102         li      $6, 0x8002000c                  # $6 == where we want to be
     61        li      $6, 0x8800000c                  # $6 == where we want to be
     62        #la      $6,_branch
    10363        beq     $5, $6, _start_in_ram
    10464        nop
     
    11272        bne     $6, $7, relocate                # copied all the way to edata?
    11373        nop
    114 
    11574        la      $6, _start_in_ram
    11675        jr      $6
     
    235194        .end _sys_exit
    236195
    237 #define FRAME(name,frm_reg,offset,ret_reg)      \
    238         .globl  name;                           \
    239         .ent    name;                           \
    240 name:;                                          \
    241         .frame  frm_reg,offset,ret_reg
    242 #define ENDFRAME(name)                          \
    243         .end name
    244 
    245 FRAME(mips_enable_interrupts,sp,0,ra)
    246         mfc0 t0,C0_SR           /* get status reg */
    247         nop
    248         or t0,t0,a0
    249         mtc0 t0,C0_SR           /* save updated status reg */
    250         j ra
    251         nop
    252 ENDFRAME(mips_enable_interrupts)
    253 #define SR_IEC          0x00000001      /* cur interrupt enable, 1 => enable */
    254 #define C0_SR           $12             /* status register */
    255 
    256 /*
    257 FRAME(_CPU_ISR_Set_level,sp,0,ra)
    258         nop
    259         mfc0 t0,C0_SR
    260         andi a0, SR_IEC
    261         or   t0, a0
    262         mtc0 t0,C0_SR
    263         nop
    264         j ra
    265 ENDFRAME(_CPU_ISR_Set_level)
    266 */
    267 
    268         .section vectors
    269         .align  2
    270 
    271 FRAME(__ISR_MAIN,sp,0,ra)
    272        
    273 ENDFRAME(__ISR_MAIN)
    274 
    275196/* EOF crt0.S */
  • c/src/lib/libbsp/mips/genmongoosev/startup/bspstart.c

    rd74a92d r2cdde6d  
    5858void bsp_pretasking_hook(void)
    5959{
    60     extern int HeapBase;
    61     extern int HeapSize;
     60    extern int   HeapBase;
     61    extern int   HeapSize;
    6262    void         *heapStart = &HeapBase;
    6363    unsigned long heapSize = (unsigned long)&HeapSize;
    64     unsigned long ramSpace;
    6564
    6665    bsp_libc_init(heapStart, (unsigned32) heapSize, 0);
     
    6968    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
    7069#endif
    71 
    7270}
    7371 
     
    8280  extern int _end;
    8381  extern int WorkspaceBase;
    84   /* Configure Number of Register Caches */
     82  extern int _RamSize, _RamBase;
     83  int ram_left;
     84
     85  ram_left = (unsigned32) &_RamSize -
     86             (unsigned32)&WorkspaceBase - (unsigned32) &_RamBase;
    8587
    8688  Cpu_table.pretasking_hook = bsp_pretasking_hook;  /* init libc, etc. */
     
    8890  Cpu_table.interrupt_stack_size = 4096;
    8991
    90   /* HACK -- tied to value linkcmds */
    91   if ( BSP_Configuration.work_space_size >(4096*1024) )
    92    _sys_exit( 1 );
     92  if ( BSP_Configuration.work_space_size >  ram_left )
     93    _sys_exit( 1 );
    9394
    9495  BSP_Configuration.work_space_start = (void *) &WorkspaceBase;
    9596
    96   /*mips_set_sr( 0xff00 );   all interrupts unmasked but globally off */
    97                           /* depend on the IRC to take care of things */
    98 
     97  /* Clear all pending peripheral interrupts and mask them. */
     98   
    9999  MONGOOSEV_WRITE( MONGOOSEV_PERIPHERAL_FUNCTION_INTERRUPT_CAUSE_REGISTER, 0 );
    100100  MONGOOSEV_WRITE( MONGOOSEV_PERIPHERAL_FUNCTION_INTERRUPT_MASK_REGISTER, 0 );
    101101
    102102  /*
    103   mips_set_sr( (SR_CU0 | SR_CU1 | SR_IBIT1 | SR_IBIT2 | SR_IBIT3 | SR_IBIT4 | SR_IBIT6 | SR_IBIT8) );
    104   */
     103   *  Enable coprocessors.
     104   *  Disable external interrupts.
     105   *  Enable software interrupts.
     106   */
     107
    105108  mips_set_sr( (SR_CU0 | SR_CU1 | SR_IBIT1 | SR_IBIT2) );
    106109
    107110  mips_install_isr_entries();
    108 
    109   MONGOOSEV_WRITE( MONGOOSEV_PERIPHERAL_FUNCTION_INTERRUPT_CAUSE_REGISTER, 0 );
    110111}
    111 
    112 /* XXX */
    113 void clear_cache( void *address, size_t n )
    114 {
    115 }
    116 
    117 /* Structure filled in by get_mem_info.  Only the size field is
    118    actually used (to clear bss), so the others aren't even filled in.  */
    119 
    120 struct s_mem
    121 {
    122   unsigned int size;
    123   unsigned int icsize;
    124   unsigned int dcsize;
    125 };
    126 
    127 
    128 void
    129 get_mem_info (mem)
    130      struct s_mem *mem;
    131 {
    132   mem->size = 0x1000000;        /* XXX figure out something here */
    133 }
    134 
  • c/src/lib/libbsp/mips/genmongoosev/startup/linkcmds

    rd74a92d r2cdde6d  
    118118    _stack_init = .;
    119119    _clear_end = .;
    120     WorkspaceBase = .;
    121      /* HACK -- tied to value bspstart */
    122     . += 4096K;    /* reserve some memory for workspace */
    123120    HeapBase = .;
    124121    . += HeapSize;    /* reserve some memory for heap */
     122    WorkspaceBase = .;
    125123  }
    126124 end = .;
Note: See TracChangeset for help on using the changeset viewer.