Changeset 2ae52c75 in rtems


Ignore:
Timestamp:
Mar 18, 2003, 7:24:59 PM (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
7e9c793b
Parents:
2e0ee93e
Message:

2003-03-18 Till Straumann <strauman@…>

PR 356/bsps
This patch makes RTEMS/powerpc/shared EABI compliant.

  • irq/irq_init.c, start/Makefile.am, start/start.S, startup/bspstart.c, startup/pgtbl_setup.c, vectors/vectors.h, vectors/vectors_init.c: zero_bss() should clear not only bss but sbss and sbss2 also (this is probably a bugfix, as sbss/sbss2 are probably used even if -msdata=eabi is not specified).
  • start/rtems_crti.S: New file which must be linked immediately after ecrti.o. rtems_crti.o contains a code snippet who lets init() return immediately. Also, a new entry point '_init' to the C++ Ctors is generated for use by the RTEMS Thread_Handler.
Location:
c/src/lib/libbsp/powerpc/shared
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/shared/ChangeLog

    r2e0ee93e r2ae52c75  
     12003-03-18  Till Straumann <strauman@slac.stanford.edu>
     2
     3        PR 356/bsps
     4        This patch makes RTEMS/powerpc/shared EABI compliant.
     5        * irq/irq_init.c, start/Makefile.am, start/start.S, startup/bspstart.c,
     6        startup/pgtbl_setup.c, vectors/vectors.h, vectors/vectors_init.c:
     7        zero_bss() should clear not only bss but sbss and sbss2
     8        also (this is probably a bugfix, as sbss/sbss2 are
     9        probably used even if -msdata=eabi is not specified).
     10        * start/rtems_crti.S: New file which must
     11        be linked immediately after ecrti.o. rtems_crti.o contains
     12        a code snippet who lets __init() return immediately. Also,
     13        a new entry point '_init' to the C++ Ctors is generated
     14        for use by the RTEMS Thread_Handler.
     15
    1162003-02-20      Till Straumann <strauman@slac.stanford.edu>
    217
  • c/src/lib/libbsp/powerpc/shared/irq/irq_init.c

    r2e0ee93e r2ae52c75  
    4444static pci_isa_bridge_device bridge;
    4545
    46 extern unsigned int external_exception_vector_prolog_code_size;
     46extern unsigned int external_exception_vector_prolog_code_size[];
    4747extern void external_exception_vector_prolog_code();
    48 extern unsigned int decrementer_exception_vector_prolog_code_size;
     48extern unsigned int decrementer_exception_vector_prolog_code_size[];
    4949extern void decrementer_exception_vector_prolog_code();
    5050
     
    297297    vectorDesc.hdl.vector       =       ASM_DEC_VECTOR;
    298298    vectorDesc.hdl.raw_hdl      =       decrementer_exception_vector_prolog_code;
    299     vectorDesc.hdl.raw_hdl_size =       (unsigned) &decrementer_exception_vector_prolog_code_size;
     299    vectorDesc.hdl.raw_hdl_size =       (unsigned) decrementer_exception_vector_prolog_code_size;
    300300    vectorDesc.on               =       nop_func;
    301301    vectorDesc.off              =       nop_func;
     
    307307    vectorDesc.hdl.vector       =       ASM_EXT_VECTOR;
    308308    vectorDesc.hdl.raw_hdl      =       external_exception_vector_prolog_code;
    309     vectorDesc.hdl.raw_hdl_size =       (unsigned) &external_exception_vector_prolog_code_size;
     309    vectorDesc.hdl.raw_hdl_size =       (unsigned) external_exception_vector_prolog_code_size;
    310310    if (!mpc60x_set_exception (&vectorDesc)) {
    311311      BSP_panic("Unable to initialize RTEMS external raw exception\n");
  • c/src/lib/libbsp/powerpc/shared/start/Makefile.am

    r2e0ee93e r2ae52c75  
    44
    55
    6 S_FILES = start.S
     6S_FILES = start.S rtems_crti.S
    77
    8 EXTRA_DIST = start.S
     8EXTRA_DIST = start.S rtems_crti.S
    99
    1010include $(top_srcdir)/../../../../../automake/local.am
  • c/src/lib/libbsp/powerpc/shared/start/start.S

    r2e0ee93e r2ae52c75  
    2828        li      r10,0x63        ;       \
    2929        sc
    30                        
     30
     31               
    3132        .text
    3233        .globl  __rtems_entry_point
     
    8788enter_C_code:
    8889        bl      MMUon
     90        bl  __eabi      /* setup EABI and SYSV environment */
    8991        bl      zero_bss
    9092        /*
  • c/src/lib/libbsp/powerpc/shared/startup/bspstart.c

    r2e0ee93e r2ae52c75  
    3737
    3838extern void _return_to_ppcbug();
    39 extern unsigned long __rtems_end;
    40 extern unsigned long _end;
    41 extern unsigned long __bss_start;
     39extern unsigned long __rtems_end[];
    4240extern void L1_caches_enables();
    4341extern unsigned get_L2CR();
     
    136134    rtems_unsigned32        heap_size;
    137135
    138     heap_start = ((rtems_unsigned32) &__rtems_end) +INIT_STACK_SIZE + INTR_STACK_SIZE;
     136    heap_start = ((rtems_unsigned32) __rtems_end) +INIT_STACK_SIZE + INTR_STACK_SIZE;
    139137    if (heap_start & (CPU_ALIGNMENT-1))
    140138        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     
    154152void zero_bss()
    155153{
    156   memset(&__bss_start, 0, ((unsigned) (&__rtems_end)) - ((unsigned) &__bss_start));
     154  /* prevent these from being accessed in the short data areas */
     155  extern unsigned long __bss_start[], __SBSS_START__[], __SBSS_END__[];
     156  extern unsigned long __SBSS2_START__[], __SBSS2_END__[];
     157  memset(__SBSS_START__, 0, ((unsigned) __SBSS_END__) - ((unsigned)__SBSS_START__));
     158  memset(__SBSS2_START__, 0, ((unsigned) __SBSS2_END__) - ((unsigned)__SBSS2_START__));
     159  memset(__bss_start, 0, ((unsigned) __rtems_end) - ((unsigned)__bss_start));
    157160}
    158161
     
    210213   * so that It can be printed without accessing R1.
    211214   */
    212   stack = ((unsigned char*) &__rtems_end) + INIT_STACK_SIZE - CPU_MINIMUM_STACK_FRAME_SIZE;
     215  stack = ((unsigned char*) __rtems_end) + INIT_STACK_SIZE - CPU_MINIMUM_STACK_FRAME_SIZE;
    213216
    214217 /* tag the bottom (T. Straumann 6/36/2001 <strauman@slac.stanford.edu>) */
     
    223226   * some settings below...
    224227   */
    225   intrStack = ((unsigned char*) &__rtems_end) + INIT_STACK_SIZE + INTR_STACK_SIZE - CPU_MINIMUM_STACK_FRAME_SIZE;
    226 
    227  /* tag the bottom (T. Straumann 6/36/2001 <strauman@slac.stanford.edu>) */
     228  intrStack = ((unsigned char*) __rtems_end) + INIT_STACK_SIZE + INTR_STACK_SIZE - CPU_MINIMUM_STACK_FRAME_SIZE;
     229
     230  /* make sure it's properly aligned */
     231  (unsigned32)intrStack &= ~(CPU_STACK_ALIGNMENT-1);
     232
     233  /* tag the bottom (T. Straumann 6/36/2001 <strauman@slac.stanford.edu>) */
    228234  *((unsigned32 *)intrStack) = 0;
    229235
     
    358364    (unsigned char *)BSP_mem_size - BSP_Configuration.work_space_size;
    359365
    360   if ( work_space_start <= ((unsigned char *)&__rtems_end) + INIT_STACK_SIZE + INTR_STACK_SIZE) {
     366  if ( work_space_start <= ((unsigned char *)__rtems_end) + INIT_STACK_SIZE + INTR_STACK_SIZE) {
    361367    printk( "bspstart: Not enough RAM!!!\n" );
    362368    bsp_cleanup();
  • c/src/lib/libbsp/powerpc/shared/startup/pgtbl_setup.c

    r2e0ee93e r2ae52c75  
    5151         * NOTE THAT THE CORRECTNESS OF THE LINKER SCRIPT IS CRUCIAL
    5252         */
    53         extern unsigned long __DATA_START__, _etext;
     53        extern unsigned long __DATA_START__[], _etext[];
    5454
    5555        /* map text and RO data read-only */
     
    5858                                                TRIV121_121_VSID,
    5959                                                0,
    60                                                 (PAGE_ALIGN((unsigned long)&_etext) - 0) >> PG_SHIFT,
     60                                                (PAGE_ALIGN((unsigned long)_etext) - 0) >> PG_SHIFT,
    6161                                                0, /* WIMG */
    6262                                                TRIV121_PP_RO_PAGE);
     
    7070                                                pt,
    7171                                                TRIV121_121_VSID,
    72                                                 (unsigned long)&__DATA_START__,
    73                                                 (*pmemsize - (1<<ldPtSize) -  (unsigned long)&__DATA_START__ )>> PG_SHIFT,
     72                                                (unsigned long)__DATA_START__,
     73                                                (*pmemsize - (1<<ldPtSize) -  (unsigned long)__DATA_START__ )>> PG_SHIFT,
    7474                                                0, /* WIMG */
    7575                                                TRIV121_PP_RW_PAGE);
  • c/src/lib/libbsp/powerpc/shared/vectors/vectors.h

    r2e0ee93e r2ae52c75  
    7676
    7777extern  void default_exception_vector_code_prolog();
    78 extern  int  default_exception_vector_code_prolog_size;
     78/* This symbol is generated by the linker; prevent it from
     79 * being accessed in one of the short data areas by declaring
     80 * it as an array
     81 */
     82extern  int  default_exception_vector_code_prolog_size[];
    7983
    8084/* codemove is like memmove, but it also gets the cache line size
  • c/src/lib/libbsp/powerpc/shared/vectors/vectors_init.c

    r2e0ee93e r2ae52c75  
    161161   * is not a bug as it is defined a .set directly in asm...
    162162   */
    163   exception_config.defaultRawEntry.hdl.raw_hdl_size = (unsigned) &default_exception_vector_code_prolog_size;
     163  exception_config.defaultRawEntry.hdl.raw_hdl_size = (unsigned) default_exception_vector_code_prolog_size;
    164164  for (i=0; i <= exception_config.exceptSize; i++) {
    165165    if (!mpc60x_vector_is_valid (i)) {
Note: See TracChangeset for help on using the changeset viewer.