Changeset b8c9883 in rtems


Ignore:
Timestamp:
Jan 13, 2000, 8:45:07 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
4c3ab846
Parents:
11944b9b
Message:

All m68k BSPs now build with new ELF style linkcmds.

Location:
c/src/lib/libbsp/m68k
Files:
46 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/dmv152/include/bsp.h

    r11944b9b rb8c9883  
    121121/* constants */
    122122
    123 #define RAM_START 0
    124 #define RAM_END   0x100000
    125 
    126123#define TIMER 0x0c000000
    127124#define TIMER_VECTOR 0x4D
  • c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in

    r11944b9b rb8c9883  
    1717
    1818# C source names, if any, go here -- minus the .c
    19 C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \
    20     vmeintr gnatinstallhandler
     19C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
     20    main sbrk setvec vmeintr gnatinstallhandler
    2121C_FILES = $(C_PIECES:%=%.c)
    2222C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c

    r11944b9b rb8c9883  
    4040void bsp_postdriver_hook(void);
    4141void bsp_libc_init( void *, unsigned32, int );
    42 
    43 /*
    44  *  Function:   bsp_pretasking_hook
    45  *  Created:    95/03/10
    46  *
    47  *  Description:
    48  *      BSP pretasking hook.  Called just before drivers are initialized.
    49  *      Used to setup libc and install any BSP extensions.
    50  *
    51  *  NOTES:
    52  *      Must not use libc (to do io) from here, since drivers are
    53  *      not yet initialized.
    54  *
    55  */
    56  
    57 void bsp_pretasking_hook(void)
    58 {
    59     extern void             *_HeapStart;
    60     extern rtems_unsigned32  HeapSize;
    61 
    62     bsp_libc_init( &_HeapStart, HeapSize, 0 );
    63  
    64 #ifdef RTEMS_DEBUG
    65     rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
    66 #endif
    67 }
     42void bsp_pretasking_hook(void);               /* m68k version */
    6843 
    6944/*
     
    7853  int             index;
    7954  void           *vbr;
     55  extern void    *_WorkspaceBase;
    8056
    8157  monitors_vector_table = (m68k_isr_entry *)0;   /* Monitor Vectors are at 0 */
     
    11995  Cpu_table.interrupt_vector_table = vbr;
    12096
    121   BSP_Configuration.work_space_start = (void *)
    122      (RAM_END - BSP_Configuration.work_space_size);
     97  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
    12398
    12499  /*
  • c/src/lib/libbsp/m68k/dmv152/startup/linkcmds

    r11944b9b rb8c9883  
    1616 * Declare some sizes.
    1717 */
    18 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
    19 StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
     18_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
     19_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    2020
    2121MEMORY
     
    2323        ram : org = 0x0, l = 1M
    2424}
     25
     26_RamBase = 0;
     27_RamSize = 1M;
    2528
    2629SECTIONS
     
    118121                PROVIDE (end = .);
    119122
    120                 . += StackSize;
    121                 PROVIDE (_stack_init = .);
    122 
     123                . += _StackSize;
    123124                . = ALIGN (16);
    124                 PROVIDE (_HeapStart = .);
    125                 . += HeapSize;
    126                 PROVIDE (_HeapEnd = .);
    127 
    128                 PROVIDE (_clear_end = .);
     125                _stack_init = .;
     126                _clear_end = .;
    129127
    130128                _WorkspaceBase = .;
  • c/src/lib/libbsp/m68k/efi332/startup/Makefile.in

    r11944b9b rb8c9883  
    1717
    1818# C source names, if any, go here -- minus the .c
    19 C_PIECES = bsplibc bsppost bspstart bspclean bootcard main sbrk setvec \
    20     gnatinstallhandler
     19C_PIECES = bsplibc bsppost bspstart bspclean bootcard m68kpretaskinghook \
     20    main sbrk setvec gnatinstallhandler
    2121C_FILES = $(C_PIECES:%=%.c)
    2222C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/efi332/startup/bspstart.c

    r11944b9b rb8c9883  
    3939void bsp_postdriver_hook(void);
    4040void bsp_libc_init( void *, unsigned32, int );
    41 
    42 /*
    43  *  Function:   bsp_pretasking_hook
    44  *  Created:    95/03/10
    45  *
    46  *  Description:
    47  *      BSP pretasking hook.  Called just before drivers are initialized.
    48  *      Used to setup libc and install any BSP extensions.
    49  *
    50  *  NOTES:
    51  *      Must not use libc (to do io) from here, since drivers are
    52  *      not yet initialized.
    53  *
    54  */
    55  
    56 void bsp_pretasking_hook(void)
    57 {
    58 /*   extern int end; */
    59   rtems_unsigned32        heap_start;
    60  
    61   heap_start = (rtems_unsigned32) BSP_Configuration.work_space_start +
    62                (rtems_unsigned32) BSP_Configuration.work_space_size;
    63   if (heap_start & (CPU_ALIGNMENT-1))
    64     heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    65  
    66   if (heap_start > (rtems_unsigned32) RAM_END) {
    67     /* rtems_fatal_error_occurred can not be used before initalization */
    68     RAW_PUTS("\n\rRTEMS: Out of memory.\n\r");
    69     RAW_PUTS("RTEMS:    Check RAM_END and the size of the work space.\n\r");
    70   }
    71 
    72   bsp_libc_init((void *) heap_start, (RAM_END - heap_start), 0);
    73  
    74 #ifdef RTEMS_DEBUG
    75     rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
    76 #endif
    77 }
     41void bsp_pretasking_hook(void);               /* m68k version */
    7842 
    7943/*
     
    8650{
    8751  void           *vbr;
    88   extern        unsigned int _WorkspaceBase;
     52  extern void    *_WorkspaceBase;
    8953
    9054  /*
     
    9862  Cpu_table.interrupt_vector_table = vbr;
    9963
    100   BSP_Configuration.work_space_start = (void *)
    101     (((unsigned int)_WorkspaceBase + STACK_SIZE + 0x100) & 0xffffff00);
    102 
    103 #if 0
    104     (((unsigned int)_end + STACK_SIZE + 0x100) & 0xffffff00);
    105 #endif
     64  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
    10665
    10766  /* Clock_exit is done as an atexit() function */
  • c/src/lib/libbsp/m68k/efi332/startup/linkcmds

    r11944b9b rb8c9883  
    3434 * Declare some sizes.
    3535 */
    36 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
    37 StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
     36_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
     37_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    3838
    3939MEMORY
     
    4141  ram     : ORIGIN = 0x80000, LENGTH = 512K
    4242}
     43
     44_RamBase = 0x80000;
     45_RamSize = 0x80000;
    4346
    4447__end_of_ram = 0x100000;
     
    136139        } >ram
    137140        .bss : {
    138                 PROVIDE (_clear_start = .);
     141                _clear_start = .;
    139142                *(.bss)
    140143                *(COMMON)
     
    142145                PROVIDE (end = .);
    143146
    144                 . += StackSize;
    145                 PROVIDE (_stack_init = .);
     147                . += _StackSize;
     148                . = ALIGN (16);
     149                _stack_init = .;
     150                _clear_end = .;
    146151
    147                 . = ALIGN (16);
    148                 PROVIDE (_HeapStart = .);
    149                 . += HeapSize;
    150                 PROVIDE (_HeapEnd = .);
    151 
    152                 PROVIDE (_clear_end = .);
    153 
    154                 PROVIDE (_WorkspaceBase = .);
     152                _WorkspaceBase = .;
    155153        } >ram
    156154}
  • c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in

    r11944b9b rb8c9883  
    1212PROJECT_ROOT = @PROJECT_ROOT@
    1313
    14 VPATH = @srcdir@:@srcdir@/../../../shared
     14VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
    1515
    1616PGM = ${ARCH}/startup.rel
     
    1818# C source names, if any, go here -- minus the .c
    1919C_PIECES = bsplibc bsppost bspstart bspclean efi68k_tcp efi68k_wd bootcard \
    20     main sbrk setvec gnatinstallhandler
     20    m68kpretaskinghook main sbrk setvec gnatinstallhandler
    2121C_FILES = $(C_PIECES:%=%.c)
    2222C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c

    r11944b9b rb8c9883  
    4444void bsp_postdriver_hook(void);
    4545void bsp_libc_init( void *, unsigned32, int );
     46void bsp_pretasking_hook(void);               /* m68k version */
    4647
    47 /*
    48  *  Function:   bsp_pretasking_hook
    49  *  Created:    95/03/10
    50  *
    51  *  Description:
    52  *      BSP pretasking hook.  Called just before drivers are initialized.
    53  *      Used to setup libc and install any BSP extensions.
    54  *
    55  *  NOTES:
    56  *      Must not use libc (to do io) from here, since drivers are
    57  *      not yet initialized.
    58  *
    59  */
    60  
    61 void bsp_pretasking_hook(void)
    62 {
    63 /*   extern int end; */
    64   rtems_unsigned32        heap_start;
    65  
    66   heap_start = (rtems_unsigned32) BSP_Configuration.work_space_start +
    67                (rtems_unsigned32) BSP_Configuration.work_space_size;
    68   if (heap_start & (CPU_ALIGNMENT-1))
    69     heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    70  
    71   if (heap_start > (rtems_unsigned32) RAM_END) {
    72     /* rtems_fatal_error_occurred can not be used before initalization */
    73     RAW_PUTS("\n\rRTEMS: Out of memory.\n\r");
    74     RAW_PUTS("RTEMS:    Check RAM_END and the size of the work space.\n\r");
    75   }
    76 
    77   bsp_libc_init((void *) heap_start, (RAM_END - heap_start), 0);
    78  
    79 #ifdef RTEMS_DEBUG
    80     rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
    81 #endif
    82 }
    83  
    8448/*
    8549 *  bsp_start
     
    9155{
    9256  void           *vbr;
    93   extern        unsigned int _WorkspaceBase;
     57  extern void    *_WorkspaceBase;
    9458
    9559/*   set_debug_traps();    */
     
    10670  Cpu_table.interrupt_vector_table = vbr;
    10771
    108   BSP_Configuration.work_space_start = (void *)
    109     (((unsigned int)_WorkspaceBase + STACK_SIZE + 0x100) & 0xffffff00);
    110 
    111 #if 0
    112     (((unsigned int)_end + STACK_SIZE + 0x100) & 0xffffff00);
    113 #endif
     72  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
    11473
    11574  /* Clock_exit is done as an atexit() function */
  • c/src/lib/libbsp/m68k/efi68k/startup/linkcmds

    r11944b9b rb8c9883  
    4343}
    4444
     45_RamBase = 0x200000;
     46_RamSize = 256K;
     47
    4548_VBR = 0x200000;                /* location of the VBR table (in RAM) */
    4649__end_of_ram = 0x240000;
     
    5053 * Declare some sizes.
    5154 */
    52 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
    53 StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
     55_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
     56_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    5457
    5558/*
     
    145148        } >ram
    146149        .bss : {
    147                 PROVIDE (_clear_start = .);
     150                _clear_start = .;
    148151                *(.bss)
    149152                *(COMMON)
     
    151154                PROVIDE (end = .);
    152155
    153                 . += StackSize;
    154                 PROVIDE (_stack_init = .);
     156                . += _StackSize;
     157                . = ALIGN (16);
     158                _stack_init = .;
     159                _clear_end = .;
    155160
    156                 . = ALIGN (16);
    157                 PROVIDE (_HeapStart = .);
    158                 . += HeapSize;
    159                 PROVIDE (_HeapEnd = .);
    160 
    161                 PROVIDE (_clear_end = .);
    162 
    163                 PROVIDE (_WorkspaceBase = .);
     161                _WorkspaceBase = .;
    164162        } >ram
    165163}
  • c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in

    r11944b9b rb8c9883  
    1717
    1818# C source names, if any, go here -- minus the .c
    19 C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \
    20     gnatinstallhandler
     19C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
     20    main sbrk setvec gnatinstallhandler
    2121C_FILES = $(C_PIECES:%=%.c)
    2222C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c

    r11944b9b rb8c9883  
    4040void bsp_postdriver_hook(void);
    4141void bsp_libc_init( void *, unsigned32, int );
    42 
    43 /*
    44  *  Function:   bsp_pretasking_hook
    45  *  Created:    95/03/10
    46  *
    47  *  Description:
    48  *      BSP pretasking hook.  Called just before drivers are initialized.
    49  *      Used to setup libc and install any BSP extensions.
    50  *
    51  *  NOTES:
    52  *      Must not use libc (to do io) from here, since drivers are
    53  *      not yet initialized.
    54  *
    55  */
    56  
    57 void bsp_pretasking_hook(void)
    58 {
    59     extern int end;
    60     rtems_unsigned32        heap_start;
    61 
    62     heap_start = (rtems_unsigned32) &end;
    63     if (heap_start & (CPU_ALIGNMENT-1))
    64         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    65 
    66     bsp_libc_init((void *) heap_start, 64 * 1024, 0);
    67 
    68  
    69 #ifdef RTEMS_DEBUG
    70     rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
    71 #endif
    72 }
     42void bsp_pretasking_hook(void);               /* m68k version */
    7343
    7444/*
     
    8050void bsp_start( void )
    8151{
     52  extern void    *_WorkspaceBase;
    8253
    8354  /*
     
    9869   */
    9970
    100   BSP_Configuration.work_space_start = (void *)
    101       (RAM_END - BSP_Configuration.work_space_size);
     71  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
    10272
    10373  /*
  • c/src/lib/libbsp/m68k/gen68302/startup/linkcmds

    r11944b9b rb8c9883  
    1818}
    1919
     20_RamBase = 0;
     21_RamSize = 16M;
     22
    2023m302 = 0xf7f000;
    2124_VBR = 0x000000;                /* location of the VBR table (in RAM) */
     
    2427 * Declare some sizes.
    2528 */
    26 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
    27 StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
     29_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
     30_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    2831
    2932SECTIONS
     
    115118        } >ram
    116119        .bss : {
    117                 PROVIDE (_clear_start = .);
     120                _clear_start = .;
    118121                *(.bss)
    119122                *(COMMON)
     
    121124                PROVIDE (end = .);
    122125
    123                 . += StackSize;
    124                 PROVIDE (_stack_init = .);
     126                . += _StackSize;
     127                . = ALIGN (16);
     128                _stack_init = .;
     129                _clear_end = .;
    125130
    126                 . = ALIGN (16);
    127                 PROVIDE (_HeapStart = .);
    128                 . += HeapSize;
    129                 PROVIDE (_HeapEnd = .);
    130 
    131                 PROVIDE (_clear_end = .);
    132 
    133                 PROVIDE (_WorkspaceBase = .);
     131                _WorkspaceBase = .;
    134132        } >ram
    135133}
  • c/src/lib/libbsp/m68k/gen68340/start/start.S

    r11944b9b rb8c9883  
    852852
    853853        .align 2
    854         PUBLIC (_HeapSize)
    855 SYM (_HeapSize):
    856         .long  HeapSize
    857         PUBLIC (_StackSize)
    858 SYM (_StackSize):
    859         .long  StackSize
    860 END_CODE
    861 
    862854BEGIN_DATA_DCL
    863855        .align 2
  • c/src/lib/libbsp/m68k/gen68340/start/startfor340only.S

    r11944b9b rb8c9883  
    477477
    478478        .align 2
    479         PUBLIC (_HeapSize)
    480 SYM (_HeapSize):
    481         .long  HeapSize
    482         PUBLIC (_StackSize)
    483 SYM (_StackSize):
    484         .long  StackSize
    485 END_CODE
    486479
    487480BEGIN_DATA_DCL
  • c/src/lib/libbsp/m68k/gen68340/startup/Makefile.in

    r11944b9b rb8c9883  
    1717
    1818# C source names, if any, go here -- minus the .c
    19 C_PIECES = bspclean bsplibc bsppost bspstart init68340 bootcard main sbrk \
    20     setvec dumpanic gnatinstallhandler
     19C_PIECES = bspclean bsplibc bsppost bspstart init68340 bootcard \
     20    m68kpretaskinghook main sbrk setvec dumpanic gnatinstallhandler
    2121C_FILES = $(C_PIECES:%=%.c)
    2222C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/gen68340/startup/bspstart.c

    r11944b9b rb8c9883  
    4545void bsp_postdriver_hook(void);
    4646void bsp_libc_init( void *, unsigned32, int );
    47 
    48 /*
    49  *  Function:   bsp_pretasking_hook
    50  *  Created:    95/03/10
    51  *
    52  *  Description:
    53  *      BSP pretasking hook.  Called just before drivers are initialized.
    54  *      Used to setup libc and install any BSP extensions.
    55  *
    56  *  NOTES:
    57  *      Must not use libc (to do io) from here, since drivers are
    58  *      not yet initialized.
    59  *
    60  */
    61  
    62 void bsp_pretasking_hook(void)
    63 {
    64     extern void *_HeapStart;
    65     extern rtems_unsigned32 _HeapSize;
    66 
    67     bsp_libc_init(&_HeapStart, _HeapSize, 0);
    68  
    69 #ifdef RTEMS_DEBUG
    70     rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
    71 #endif
    72 }
     47void bsp_pretasking_hook(void);               /* m68k version */
    7348
    7449/*
  • c/src/lib/libbsp/m68k/gen68340/startup/linkcmds

    r11944b9b rb8c9883  
    1919
    2020/*
    21  * a.out format doesn't handle prom images very well
    22  */
    23 OUTPUT_FORMAT(coff-m68k)
    24 
    25 /*
    2621 * Declare some sizes.
    2722 */
    28 RamSize = DEFINED(RamSize) ? RamSize : 4M;
    29 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
    30 StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
     23_RamBase = 0x10000000;
     24_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
     25_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
     26_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    3127
    3228/*
    3329 * Declare on-board memory.
    3430 * It would be nice if the ram length could be given as
    35  * LENGTH=RamSize, but gld doesn't allow non-constant
     31 * LENGTH=_RamSize, but gld doesn't allow non-constant
    3632 * values in the LENGTH expression. 
    3733 */
     
    5147 */
    5248SECTIONS {
    53         /*
    54          * Hardware variations
    55          */
    56         _RamSize = RamSize;
    57         __RamSize = RamSize;
    5849
    5950        /*
     
    6960         */
    7061        ram : {
    71                 _RamBase = .;
    72                 __RamBase = .;
     62                . = .;
    7363        } >ram
    7464
     
    155145        } >ram
    156146        .bss : {
    157                 M68Kvec = .;
    158                 _M68Kvec = .;
    159                 . += (256 * 4);
    160                 PROVIDE (_bss_start = .);
    161                 PROVIDE (_clear_start = .);
     147                M68Kvec = .;
     148                . += (256 * 4);
     149                _clear_start = .;
    162150                *(.bss)
    163151                *(COMMON)
     
    165153                PROVIDE (end = .);
    166154
    167                 . += StackSize;
    168                 PROVIDE (_stack_init = .);
     155                . += _StackSize;
     156                . = ALIGN (16);
     157                _stack_init = .;
     158                _clear_end = .;
    169159
    170                 . = ALIGN (16);
    171                 PROVIDE (_HeapStart = .);
    172                 . += HeapSize;
    173                 PROVIDE (_HeapEnd = .);
    174 
    175                 PROVIDE (_clear_end = .);
    176 
    177                 PROVIDE (_WorkspaceBase = .);
     160                _WorkspaceBase = .;
    178161        } >ram
    179162
  • c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp

    r11944b9b rb8c9883  
    1919 * Declare some sizes.
    2020 */
    21 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
    22 StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
     21_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
     22_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    2323
    2424/*
     
    121121
    122122                _HeapStart = .;
    123                 . += HeapSize;
    124                 . += StackSize;
     123                . += _HeapSize;
     124                . += _StackSize;
    125125                . = ALIGN (16);
    126126                stack_init = .;
  • c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom

    r11944b9b rb8c9883  
    1919 * Declare some sizes.
    2020 */
    21 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
    22 StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
     21_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
     22_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    2323
    2424/*
     
    120120
    121121                _HeapStart = .;
    122                 . += HeapSize;
    123                 . += StackSize;
     122                . += _HeapSize;
     123                . += _StackSize;
    124124                . = ALIGN (16);
    125125                stack_init = .;
  • c/src/lib/libbsp/m68k/idp/startup/Makefile.in

    r11944b9b rb8c9883  
    1717
    1818# C source names, if any, go here -- minus the .c
    19 C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \
    20     gnatinstallhandler
     19C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
     20    main sbrk setvec gnatinstallhandler
    2121C_FILES = $(C_PIECES:%=%.c)
    2222C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/idp/startup/bspstart.c

    r11944b9b rb8c9883  
    4747void bsp_postdriver_hook(void);
    4848void bsp_libc_init( void *, unsigned32, int );
     49void bsp_pretasking_hook(void);               /* m68k version */
    4950
    50 /*
    51  *  Function:   bsp_pretasking_hook
    52  *  Created:    95/03/10
    53  *
    54  *  Description:
    55  *      BSP pretasking hook.  Called just before drivers are initialized.
    56  *      Used to setup libc and install any BSP extensions.
    57  *
    58  *  NOTES:
    59  *      Must not use libc (to do io) from here, since drivers are
    60  *      not yet initialized.
    61  *
    62  */
    63  
    64 void bsp_pretasking_hook(void)
    65 {
    66     extern int _end;
    67     rtems_unsigned32        heap_start;
    68  
    69     heap_start = (rtems_unsigned32) &_end;
    70     if (heap_start & (CPU_ALIGNMENT-1))
    71         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    72  
    73         /* Create 64 KByte memory region for RTEMS executive */
    74     bsp_libc_init((void *) heap_start, 64 * 1024, 0);
    75  
    76 #ifdef RTEMS_DEBUG
    77     rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
    78 #endif
    79 }
    80  
    8151/*
    8252 *  bsp_start
     
    8959  m68k_isr_entry *monitors_vector_table;
    9060  int             index;
     61  extern void    *_WorkspaceBase;
    9162
    9263  duart_base = (unsigned char *)DUART_ADDR;
     
    12798  Cpu_table.interrupt_stack_size = 4096;
    12899
    129   BSP_Configuration.work_space_start = (void *)
    130      (RAM_END - BSP_Configuration.work_space_size);
     100  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
    131101 
    132102/*  led_putnum('e'); * for debugging purposes only */
  • c/src/lib/libbsp/m68k/idp/startup/linkcmds

    r11944b9b rb8c9883  
    2121 * Declare some sizes.
    2222 */
    23 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
    24 StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
     23_RamBase = 0x0;
     24_RamSize = DEFINED(_RamSize) ? _RamSize : 2M;
     25_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
     26_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    2527
    2628SECTIONS
     
    112114        } >ram
    113115        .bss : {
    114                 PROVIDE (_bss_start = .);
    115                 PROVIDE (_clear_start = .);
     116                _clear_start = .;
    116117                *(.bss)
    117118                *(COMMON)
     
    119120                PROVIDE (end = .);
    120121
    121                 . += StackSize;
    122                 PROVIDE (_stack_init = .);
     122                . += _StackSize;
     123                . = ALIGN (16);
     124                _stack_init = .;
     125                _clear_end = .;
    123126
    124                 . = ALIGN (16);
    125                 PROVIDE (_HeapStart = .);
    126                 . += HeapSize;
    127                 PROVIDE (_HeapEnd = .);
    128 
    129                 PROVIDE (_clear_end = .);
    130 
    131                 PROVIDE (_WorkspaceBase = .);
     127                _WorkspaceBase = .;
    132128        } >ram
    133129}
  • c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in

    r11944b9b rb8c9883  
    1717
    1818# C source names, if any, go here -- minus the .c
    19 C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \
    20     gnatinstallhandler
     19C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
     20    main sbrk setvec gnatinstallhandler
    2121C_FILES = $(C_PIECES:%=%.c)
    2222C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c

    r11944b9b rb8c9883  
    4141void bsp_postdriver_hook(void);
    4242void bsp_libc_init( void *, unsigned32, int );
    43 
    44 /*
    45  *  Function:   bsp_pretasking_hook
    46  *  Created:    95/03/10
    47  *
    48  *  Description:
    49  *      BSP pretasking hook.  Called just before drivers are initialized.
    50  *      Used to setup libc and install any BSP extensions.
    51  *
    52  *  NOTES:
    53  *      Must not use libc (to do io) from here, since drivers are
    54  *      not yet initialized.
    55  *
    56  */
    57  
    58 void bsp_pretasking_hook(void)
    59 {
    60     extern int end;
    61     rtems_unsigned32        heap_start;
    62 
    63     heap_start = (rtems_unsigned32) &end;
    64     if (heap_start & (CPU_ALIGNMENT-1))
    65         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    66 
    67     bsp_libc_init((void *) heap_start, 64 * 1024, 0);
    68 
    69  
    70 #ifdef RTEMS_DEBUG
    71     rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
    72 #endif
    73 }
     43void bsp_pretasking_hook(void);               /* m68k version */
    7444
    7545/*
     
    8353  m68k_isr_entry *monitors_vector_table;
    8454  int             index;
     55  extern void    *_WorkspaceBase;
    8556
    8657  monitors_vector_table = (m68k_isr_entry *)0;   /* 135Bug Vectors are at 0 */
     
    11081  Cpu_table.interrupt_stack_size = 4096;
    11182
    112   BSP_Configuration.work_space_start = (void *)
    113      (RAM_END - BSP_Configuration.work_space_size);
    114 
     83  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
    11584}
  • c/src/lib/libbsp/m68k/mvme136/startup/linkcmds

    r11944b9b rb8c9883  
    1616 * Declare some sizes.
    1717 */
    18 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
    19 StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
     18_RamBase = 0x0;
     19_RamSize = DEFINED(_RamSize) ? _RamSize : 1M;
     20_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
     21_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    2022
    2123MEMORY
     
    112114        } >ram
    113115        .bss : {
    114                 PROVIDE (_bss_start = .);
    115                 PROVIDE (_clear_start = .);
     116                _clear_start = .;
    116117                *(.bss)
    117118                *(COMMON)
     
    119120                PROVIDE (end = .);
    120121
    121                 . += StackSize;
    122                 PROVIDE (_stack_init = .);
     122                . += _StackSize;
     123                . = ALIGN (16);
     124                _stack_init = .;
     125                _clear_end = .;
    123126
    124                 . = ALIGN (16);
    125                 PROVIDE (_HeapStart = .);
    126                 . += HeapSize;
    127                 PROVIDE (_HeapEnd = .);
    128 
    129                 PROVIDE (_clear_end = .);
    130 
    131                 PROVIDE (_WorkspaceBase = .);
     127                _WorkspaceBase = .;
    132128        } >ram
    133129}
  • c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in

    r11944b9b rb8c9883  
    1717
    1818# C source names, if any, go here -- minus the .c
    19 C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \
    20     gnatinstallhandler
     19C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
     20    main sbrk setvec gnatinstallhandler
    2121C_FILES = $(C_PIECES:%=%.c)
    2222C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c

    r11944b9b rb8c9883  
    4444void bsp_postdriver_hook(void);
    4545void bsp_libc_init( void *, unsigned32, int );
     46void bsp_pretasking_hook(void);               /* m68k version */
    4647
    47 /*
    48  *  Function:   bsp_pretasking_hook
    49  *  Created:    95/03/10
    50  *
    51  *  Description:
    52  *      BSP pretasking hook.  Called just before drivers are initialized.
    53  *      Used to setup libc and install any BSP extensions.
    54  *
    55  *  NOTES:
    56  *      Must not use libc (to do io) from here, since drivers are
    57  *      not yet initialized.
    58  *
    59  */
    60  
    61 void bsp_pretasking_hook(void)
    62 {
    63     extern int end;
    64     rtems_unsigned32        heap_start;
    65 
    66     heap_start = (rtems_unsigned32) &end;
    67     if (heap_start & (CPU_ALIGNMENT-1))
    68         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    69 
    70     bsp_libc_init((void *) heap_start, 64 * 1024, 0);
    71 
    72  
    73 #ifdef RTEMS_DEBUG
    74     rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
    75 #endif
    76 }
    77  
    7848/*
    7949 *  bsp_start
     
    8656  m68k_isr_entry *monitors_vector_table;
    8757  int             index;
     58  extern void    *_WorkspaceBase;
    8859
    8960  monitors_vector_table = (m68k_isr_entry *)0;   /* 135Bug Vectors are at 0 */
     
    11687  Cpu_table.interrupt_stack_size = 4096;
    11788
    118   BSP_Configuration.work_space_start = (void *)
    119      (RAM_END - BSP_Configuration.work_space_size);
    120 
     89  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
    12190}
  • c/src/lib/libbsp/m68k/mvme147/startup/linkcmds

    r11944b9b rb8c9883  
    2020 * Declare some sizes.
    2121 */
    22 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
    23 StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
     22_RamBase = 0x0;
     23_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
     24_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
     25_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    2426
    2527MEMORY
     
    116118        } >ram
    117119        .bss : {
    118                 PROVIDE (_bss_start = .);
    119                 PROVIDE (_clear_start = .);
     120                _clear_start = .;
    120121                *(.bss)
    121122                *(COMMON)
     
    123124                PROVIDE (end = .);
    124125
    125                 . += StackSize;
    126                 PROVIDE (_stack_init = .);
     126                . += _StackSize;
     127                . = ALIGN (16);
     128                _stack_init = .;
     129                _clear_end = .;
    127130
    128                 . = ALIGN (16);
    129                 PROVIDE (_HeapStart = .);
    130                 . += HeapSize;
    131                 PROVIDE (_HeapEnd = .);
    132 
    133                 PROVIDE (_clear_end = .);
    134 
    135                 PROVIDE (_WorkspaceBase = .);
     131                _WorkspaceBase = .;
    136132        } >ram
    137133}
  • c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in

    r11944b9b rb8c9883  
    1818
    1919# C source names, if any, go here -- minus the .c
    20 C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \
    21     gnatinstallhandler
     20C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
     21    main sbrk setvec gnatinstallhandler
    2222C_FILES = $(C_PIECES:%=%.c)
    2323C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c

    r11944b9b rb8c9883  
    4444void bsp_postdriver_hook(void);
    4545void bsp_libc_init( void *, unsigned32, int );
     46void bsp_pretasking_hook(void);               /* m68k version */
    4647
    47 /*
    48  *  Function:   bsp_pretasking_hook
    49  *  Created:    95/03/10
    50  *
    51  *  Description:
    52  *      BSP pretasking hook.  Called just before drivers are initialized.
    53  *      Used to setup libc and install any BSP extensions.
    54  *
    55  *  NOTES:
    56  *      Must not use libc (to do io) from here, since drivers are
    57  *      not yet initialized.
    58  *
    59  */
    60  
    61 void bsp_pretasking_hook(void)
    62 {
    63     extern int end;
    64     rtems_unsigned32        heap_start;
    65 
    66     heap_start = (rtems_unsigned32) &end;
    67     if (heap_start & (CPU_ALIGNMENT-1))
    68         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    69 
    70     bsp_libc_init((void *) heap_start, 64 * 1024, 0);
    71  
    72 #ifdef RTEMS_DEBUG
    73     rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
    74 #endif
    75 }
    76  
    7748/*
    7849 *  bsp_start
     
    8657  int             index;
    8758  rtems_unsigned8 node_number;
     59  extern void    *_WorkspaceBase;
    8860
    8961  monitors_vector_table = (m68k_isr_entry *)0;   /* 147Bug Vectors are at 0 */
     
    175147  Cpu_table.interrupt_stack_size = 4096;
    176148
    177   BSP_Configuration.work_space_start = (void *)
    178      (RAM_END - BSP_Configuration.work_space_size);
    179 
     149  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
    180150}
  • c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds

    r11944b9b rb8c9883  
    2020 * Declare some sizes.
    2121 */
    22 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
    23 StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
     22_RamBase = 0x0;
     23_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
     24_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
     25_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    2426
    2527MEMORY
     
    116118        } >ram
    117119        .bss : {
    118                 PROVIDE (_bss_start = .);
    119                 PROVIDE (_clear_start = .);
     120                _clear_start = .;
    120121                *(.bss)
    121122                *(COMMON)
     
    123124                PROVIDE (end = .);
    124125
    125                 . += StackSize;
    126                 PROVIDE (_stack_init = .);
     126                . += _StackSize;
     127                . = ALIGN (16);
     128                _stack_init = .;
     129                _clear_end = .;
    127130
    128                 . = ALIGN (16);
    129                 PROVIDE (_HeapStart = .);
    130                 . += HeapSize;
    131                 PROVIDE (_HeapEnd = .);
    132 
    133                 PROVIDE (_clear_end = .);
    134 
    135                 PROVIDE (_WorkspaceBase = .);
     131                _WorkspaceBase = .;
    136132        } >ram
    137133}
  • c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in

    r11944b9b rb8c9883  
    1717
    1818# C source names, if any, go here -- minus the .c
    19 C_PIECES = bspclean bsplibc bsppost bspstart bootcard main page_table sbrk \
    20     setvec gnatinstallhandler
     19C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
     20    main page_table sbrk setvec gnatinstallhandler
    2121C_FILES = $(C_PIECES:%=%.c)
    2222C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c

    r11944b9b rb8c9883  
    4848void bsp_postdriver_hook(void);
    4949void bsp_libc_init( void *, unsigned32, int );
    50 
    51 /*
    52  *  Function:   bsp_pretasking_hook
    53  *  Created:    95/03/10
    54  *
    55  *  Description:
    56  *      BSP pretasking hook.  Called just before drivers are initialized.
    57  *      Used to setup libc and install any BSP extensions.
    58  *
    59  *  NOTES:
    60  *      Must not use libc (to do io) from here, since drivers are
    61  *      not yet initialized.
    62  *
    63  */
    64  
    65 void bsp_pretasking_hook(void)
    66 {
    67     extern int end;
    68     rtems_unsigned32        heap_start;
    69 
    70     heap_start = (rtems_unsigned32) &end;
    71     if (heap_start & (CPU_ALIGNMENT-1))
    72         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    73 
    74     bsp_libc_init((void *) heap_start, 64 * 1024, 0);
    75  
    76 #ifdef RTEMS_DEBUG
    77     rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
    78 #endif
    79 }
     50void bsp_pretasking_hook(void);               /* m68k version */
    8051
    8152/*
     
    8960  m68k_isr_entry *monitors_vector_table;
    9061  int             index;
     62  extern void    *_WorkspaceBase;
    9163
    9264  /*
     
    133105  Cpu_table.interrupt_stack_size = 4096;
    134106
    135   BSP_Configuration.work_space_start = (void *)
    136      (RAM_END - BSP_Configuration.work_space_size);
     107  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
    137108}
  • c/src/lib/libbsp/m68k/mvme162/startup/linkcmds

    r11944b9b rb8c9883  
    2323 * Declare some sizes.
    2424 */
    25 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
    26 StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
     25_RamBase = 0x100000;
     26_RamSize = DEFINED(_RamSize) ? _RamSize : 1M;
     27_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
     28_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    2729
    2830MEMORY
     
    119121        } >ram
    120122        .bss : {
    121                 PROVIDE (_bss_start = .);
    122                 PROVIDE (_clear_start = .);
     123                _clear_start = .;
    123124                *(.bss)
    124125                *(COMMON)
     
    126127                PROVIDE (end = .);
    127128
    128                 . += StackSize;
    129                 PROVIDE (_stack_init = .);
     129                . += _StackSize;
     130                . = ALIGN (16);
     131                _stack_init = .;
     132                _clear_end = .;
    130133
    131                 . = ALIGN (16);
    132                 PROVIDE (_HeapStart = .);
    133                 . += HeapSize;
    134                 PROVIDE (_HeapEnd = .);
    135 
    136                 PROVIDE (_clear_end = .);
    137 
    138                 PROVIDE (_WorkspaceBase = .);
     134                _WorkspaceBase = .;
    139135        } >ram
    140136}
  • c/src/lib/libbsp/m68k/mvme167/bsp_specs

    r11944b9b rb8c9883  
    1616-lc -lgcc --end-group \
    1717%{!qelf: %{!qnolinkcmds: -T linkcmds%s}} %{qelf: %{!qnolinkcmd: -T
    18 elflinkcmds%s}}}
     18linkcmds%s}}}
    1919
    2020*startfile:
  • c/src/lib/libbsp/m68k/mvme167/startup/Makefile.in

    r11944b9b rb8c9883  
    1717
    1818# C source names, if any, go here -- minus the .c
    19 C_PIECES = bspclean bsplibc bsppost bspstart bootcard main page_table sbrk \
    20     setvec gnatinstallhandler
     19C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
     20    main page_table sbrk setvec gnatinstallhandler
    2121C_FILES = $(C_PIECES:%=%.c)
    2222C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/mvme167/startup/bspstart.c

    r11944b9b rb8c9883  
    4949void bsp_postdriver_hook( void );
    5050void bsp_libc_init( void *, unsigned32, int );
    51 
    52 
    53 /*
    54  *  bsp_pretasking_hook
    55  *
    56  *  Called when RTEMS initialization is complete but before interrupts and
    57  *  tasking are enabled. Used to setup libc and install any BSP extensions.
    58  *
    59  *  Must not use libc (to do io) from here, since drivers are not yet
    60  *  initialized.
    61  *
    62  *  Installed in the rtems_cpu_table defined in
    63  *  rtems/c/src/exec/score/cpu/m68k/cpu.h in main() below. Called from
    64  *  rtems_initialize_executive() defined in rtems/c/src/exec/sapi/src/init.c
    65  *
    66  *  Input parameters: NONE
    67  *
    68  *  Output parameters: NONE
    69  *
    70  *  Return values: NONE
    71  */
    72 void bsp_pretasking_hook( void )
    73 {   
    74   /*
    75    *  These are assigned addresses in the linkcmds file for the BSP. This
    76    *  approach is better than having these defined as manifest constants and
    77    *  compiled into the kernel, but it is still not ideal when dealing with
    78    *  multiprocessor configuration in which each board as a different memory
    79    *  map. A better place for defining these symbols might be the makefiles.
    80    *  Consideration should also be given to developing an approach in which
    81    *  the kernel and the application can be linked and burned into ROM
    82    *  independently of each other.
    83    */
    84   extern unsigned char _HeapStart, _HeapEnd;
    85 
    86   bsp_libc_init(&_HeapStart, &_HeapEnd - &_HeapStart, 0);
    87 
    88 #ifdef RTEMS_DEBUG
    89     rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
    90 #endif
    91 }
    92 
     51void bsp_pretasking_hook(void);               /* m68k version */
    9352
    9453/*
     
    12382  extern void *_WorkspaceBase;
    12483  extern m68k_isr_entry M68Kvec[];
     84  extern void    *_WorkspaceBase;
    12585 
    12686  void M68KFPSPInstallExceptionHandlers (void);
  • c/src/lib/libbsp/m68k/mvme167/startup/elflinkcmds

    r11944b9b rb8c9883  
    2222ENTRY(_start)
    2323
    24 /* Base address and size of RAM on the MVME167 */
    25 
    26 RAM_SIZE = 4M;
    27 RAM_START = 0x00800000;
    28 RAM_END = RAM_START + RAM_SIZE;
    29 
    3024/*
    3125 * Declare some sizes.
    32  * XXX: The assignment of ". += XyzSize;" fails in older gld's if the
    33  *      number used there is not constant.  If this happens to you, edit
    34  *      the lines marked XXX below to use a constant value.
    3526 */
    36 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
    37 StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
     27_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
     28_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    3829
    3930MEMORY
     
    171162  _HeapEnd = .;
    172163  _StackStart = .;
    173   . += StackSize;       /* XXX -- Old gld can't handle this     */
     164  . += _StackSize;      /* XXX -- Old gld can't handle this     */
    174165  /* . +=       0x10000; */     /* HeapSize     for     old     gld     */
    175   /* . +=       0x1000;  */     /* StackSize for old gld */
     166  /* . +=       0x1000;  */     /* _StackSize for old gld */
    176167  . =   ALIGN (16);
    177168  _StackEnd = .;
  • c/src/lib/libbsp/m68k/mvme167/startup/linkcmds

    r11944b9b rb8c9883  
    2222ENTRY(_start)
    2323
    24 /* Base address and size of RAM on the MVME167 */
    25 
    26 RAM_SIZE = 4M;
    27 RAM_START = 0x00800000;
    28 RAM_END = RAM_START + RAM_SIZE;
    29 
    3024/*
    3125 * Declare some sizes.
    3226 */
    33 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
    34 StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
     27_RamBase = 0x00800000;
     28_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
     29_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
     30_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    3531
    3632MEMORY
     
    133129        } >ram
    134130        .bss : {
    135                 PROVIDE (_bss_start = .);
    136                 PROVIDE (_clear_start = .);
     131                _clear_start = .;
    137132                *(.bss)
    138133                *(COMMON)
     
    140135                PROVIDE (end = .);
    141136
    142                 . += StackSize;
    143                 PROVIDE (_stack_init = .);
     137                . += _StackSize;
     138                . = ALIGN (16);
     139                _stack_init = .;
     140                _clear_end = .;
    144141
    145                 . = ALIGN (16);
    146                 PROVIDE (_HeapStart = .);
    147                 . += HeapSize;
    148                 PROVIDE (_HeapEnd = .);
    149                 PROVIDE (_clear_end = .);
    150 
    151                 PROVIDE (_WorkspaceBase = .);
     142                _WorkspaceBase = .;
    152143        } >ram
    153144}
  • c/src/lib/libbsp/m68k/ods68302/start/debugreset.S

    r11944b9b rb8c9883  
    4848
    4949zerobss:
    50         moveal  #end,%a0                        | find end of .bss
    51         moveal  #bss_start,%a1                  | find beginning of .bss
     50        moveal  #_clear_end,%a0                 | find end of .bss
     51        moveal  #_clear_start,%a1               | find beginning of .bss
    5252        moveq   #0,%d0
    5353       
     
    5656        movel   %d0,%a1@+                       | to zero out uninitialized
    5757        cmpal   %a0,%a1
    58         jlt     zerobss_loop                    | loop until _end reached
     58        jlt     zerobss_loop                    | loop until end reached
    5959
    60         movel   #end,%d0                        | d0 = end of bss/start of heap
    61         addl    #heap_size,%d0                  | d0 = end of heap
    62 
    63         movel   %d0,stack_start                 | Save for brk() routine
    64         addl    #stack_size,%d0                 | make room for stack
    65         andl    #0xffffffc0,%d0                 | align it on 16 byte boundary
     60        movel   %d0,_stack_init                 | load stack top
    6661
    6762        movw    #0x3700,%sr                     | SUPV MODE,INTERRUPTS OFF!!!
     
    8075       
    8176start_frame:
    82         .space  4,0
    83 
    84         .global stack_start
    85        
    86 stack_start:
    8777        .space  4,0
    8878
  • c/src/lib/libbsp/m68k/ods68302/start/reset.S

    r11944b9b rb8c9883  
    454454
    455455zerobss:
    456         moveal  #end,%a0                        | find end of .bss
    457         moveal  #_bss_start,%a1                 | find beginning of .bss
     456        moveal  #_clear_end,%a0                 | find end of .bss
     457        moveal  #_clear_start,%a1               | find beginning of .bss
    458458        moveq   #0,%d0
    459459       
     
    464464        jlt     zerobss_loop                    | loop until _end reached
    465465
    466         movel   #end,%d0                        | d0 = end of bss/start of heap
    467         addl    #heap_size,%d0                  | d0 = end of heap
    468 
    469         movel   %d0,stack_start                 | Save for brk() routine
    470         addl    #stack_size,%d0                 | make room for stack
    471         andl    #0xffffffc0,%d0                 | align it on 16 byte boundary
     466        movel   %d0,_stack_init                 | load stack top
    472467
    473468        movw    #0x3700,%sr                     | SUPV MODE,INTERRUPTS OFF!!!
  • c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in

    r11944b9b rb8c9883  
    1818# C source names, if any, go here -- minus the .c
    1919C_PIECES = crc debugport gdb-hooks bootcard main m68302scc m68k-stub \
    20     memcheck trace gnatinstallhandler bsplibc bsppost bspstart bspclean sbrk \
    21     setvec
     20    m68kpretaskinghook memcheck trace gnatinstallhandler bsplibc \
     21    bsppost bspstart bspclean sbrk setvec
    2222C_FILES = $(C_PIECES:%=%.c)
    2323C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
  • c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c

    r11944b9b rb8c9883  
    4141void bsp_postdriver_hook(void);
    4242void bsp_libc_init( void *, unsigned32, int );
     43void bsp_pretasking_hook(void);               /* m68k version */
    4344
    44 /*
    45  *  Function:   bsp_pretasking_hook
    46  *  Created:    95/03/10
    47  *
    48  *  Description:
    49  *      BSP pretasking hook.  Called just before drivers are initialized.
    50  *      Used to setup libc and install any BSP extensions.
    51  *
    52  *  NOTES:
    53  *      Must not use libc (to do io) from here, since drivers are
    54  *      not yet initialized.
    55  *
    56  */
    57  
    58 void bsp_pretasking_hook(void)
    59 {
    60     extern int end;
    61     rtems_unsigned32        heap_start;
    62 
    63     heap_start = (rtems_unsigned32) &end;
    64     if (heap_start & (CPU_ALIGNMENT-1))
    65         heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    66 
    67     bsp_libc_init((void *) heap_start, 64 * 1024, 0);
    68  
    69 #ifdef RTEMS_DEBUG
    70     rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
    71 #endif
    72 }
    73  
    7445/*
    7546 *  bsp_start
     
    8051void bsp_start( void )
    8152{
    82   /*
    83    *  Allocate the memory for the RTEMS Work Space.  This can come from
    84    *  a variety of places: hard coded address, malloc'ed from outside
    85    *  RTEMS world (e.g. simulator or primitive memory manager), or (as
    86    *  typically done by stock BSPs) by subtracting the required amount
    87    *  of work space from the last physical address on the CPU board.
    88    */
     53  extern void *_WorkspaceBase;
     54
    8955#if 0
    9056  Cpu_table.interrupt_vector_table = (mc68000_isr *) 0/*&M68Kvec*/;
     
    9763   */
    9864
    99   BSP_Configuration.work_space_start = (void *)
    100       (RAM_END - BSP_Configuration.work_space_size);
     65  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
    10166
    10267  /*
  • c/src/lib/libbsp/m68k/ods68302/startup/linkcmds

    r11944b9b rb8c9883  
    99 * Declare some sizes.
    1010 */
    11 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
    12 StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
     11_RamBase = 0x0;
     12_RamSize = DEFINED(_RamSize) ? _RamSize : 1M;
     13_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
     14_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    1315
    1416/*
     
    114116        } >ram
    115117        .bss : {
    116                 PROVIDE (_bss_start = .);
    117                 PROVIDE (_clear_start = .);
     118                _clear_start = .;
    118119                *(.bss)
    119120                *(COMMON)
     
    121122                PROVIDE (end = .);
    122123
    123                 . += StackSize;
    124                 PROVIDE (_stack_init = .);
     124                . += _StackSize;
     125                . = ALIGN (16);
     126                _stack_init = .;
     127                _clear_end = .;
    125128
    126                 . = ALIGN (16);
    127                 PROVIDE (_HeapStart = .);
    128                 . += HeapSize;
    129                 PROVIDE (_HeapEnd = .);
    130 
    131                 PROVIDE (_clear_end = .);
    132 
    133                 PROVIDE (_WorkspaceBase = .);
     129                _WorkspaceBase = .;
    134130        } >ram
    135131}
  • c/src/lib/libbsp/m68k/shared/start.S

    r11944b9b rb8c9883  
    7878
    7979        movel   # SYM (_stack_init),d0  | d0 = stop of stack
    80         andl    #0xffffffc0,d0          | align it on 16 byte boundary
    8180        movw    #0x3700,sr              | SUPV MODE,INTERRUPTS OFF!!!
    8281        movel   d0,a7                   | set master stack pointer
Note: See TracChangeset for help on using the changeset viewer.