Index: c/src/lib/libbsp/m68k/dmv152/include/bsp.h
===================================================================
--- c/src/lib/libbsp/m68k/dmv152/include/bsp.h	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/dmv152/include/bsp.h	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -121,7 +121,4 @@
 /* constants */
 
-#define RAM_START 0
-#define RAM_END   0x100000
-
 #define TIMER 0x0c000000
 #define TIMER_VECTOR 0x4D
Index: c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in
===================================================================
--- c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -17,6 +17,6 @@
 
 # C source names, if any, go here -- minus the .c
-C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \
-    vmeintr gnatinstallhandler
+C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
+    main sbrk setvec vmeintr gnatinstallhandler
 C_FILES = $(C_PIECES:%=%.c)
 C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
Index: c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -40,30 +40,5 @@
 void bsp_postdriver_hook(void);
 void bsp_libc_init( void *, unsigned32, int );
-
-/*
- *  Function:   bsp_pretasking_hook
- *  Created:    95/03/10
- *
- *  Description:
- *      BSP pretasking hook.  Called just before drivers are initialized.
- *      Used to setup libc and install any BSP extensions.
- *
- *  NOTES:
- *      Must not use libc (to do io) from here, since drivers are
- *      not yet initialized.
- *
- */
- 
-void bsp_pretasking_hook(void)
-{
-    extern void             *_HeapStart;
-    extern rtems_unsigned32  HeapSize;
-
-    bsp_libc_init( &_HeapStart, HeapSize, 0 );
- 
-#ifdef RTEMS_DEBUG
-    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
+void bsp_pretasking_hook(void);               /* m68k version */
  
 /*
@@ -78,4 +53,5 @@
   int             index;
   void           *vbr;
+  extern void    *_WorkspaceBase;
 
   monitors_vector_table = (m68k_isr_entry *)0;   /* Monitor Vectors are at 0 */
@@ -119,6 +95,5 @@
   Cpu_table.interrupt_vector_table = vbr;
 
-  BSP_Configuration.work_space_start = (void *)
-     (RAM_END - BSP_Configuration.work_space_size);
+  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
 
   /*
Index: c/src/lib/libbsp/m68k/dmv152/startup/linkcmds
===================================================================
--- c/src/lib/libbsp/m68k/dmv152/startup/linkcmds	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/dmv152/startup/linkcmds	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -16,6 +16,6 @@
  * Declare some sizes.
  */
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
+_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
+_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
 
 MEMORY
@@ -23,4 +23,7 @@
 	ram : org = 0x0, l = 1M
 }
+
+_RamBase = 0;
+_RamSize = 1M;
 
 SECTIONS
@@ -118,13 +121,8 @@
                 PROVIDE (end = .);
 
-                . += StackSize;
-                PROVIDE (_stack_init = .);
-
+                . += _StackSize;
                 . = ALIGN (16);
-                PROVIDE (_HeapStart = .);
-                . += HeapSize;
-                PROVIDE (_HeapEnd = .);
-
-                PROVIDE (_clear_end = .);
+                _stack_init = .;
+                _clear_end = .;
 
                 _WorkspaceBase = .;
Index: c/src/lib/libbsp/m68k/efi332/startup/Makefile.in
===================================================================
--- c/src/lib/libbsp/m68k/efi332/startup/Makefile.in	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/efi332/startup/Makefile.in	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -17,6 +17,6 @@
 
 # C source names, if any, go here -- minus the .c
-C_PIECES = bsplibc bsppost bspstart bspclean bootcard main sbrk setvec \
-    gnatinstallhandler
+C_PIECES = bsplibc bsppost bspstart bspclean bootcard m68kpretaskinghook \
+    main sbrk setvec gnatinstallhandler
 C_FILES = $(C_PIECES:%=%.c)
 C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
Index: c/src/lib/libbsp/m68k/efi332/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/m68k/efi332/startup/bspstart.c	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/efi332/startup/bspstart.c	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -39,41 +39,5 @@
 void bsp_postdriver_hook(void);
 void bsp_libc_init( void *, unsigned32, int );
-
-/*
- *  Function:   bsp_pretasking_hook
- *  Created:    95/03/10
- *
- *  Description:
- *      BSP pretasking hook.  Called just before drivers are initialized.
- *      Used to setup libc and install any BSP extensions.
- *
- *  NOTES:
- *      Must not use libc (to do io) from here, since drivers are
- *      not yet initialized.
- *
- */
- 
-void bsp_pretasking_hook(void)
-{
-/*   extern int end; */
-  rtems_unsigned32        heap_start;
-  
-  heap_start = (rtems_unsigned32) BSP_Configuration.work_space_start +
-               (rtems_unsigned32) BSP_Configuration.work_space_size;
-  if (heap_start & (CPU_ALIGNMENT-1))
-    heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-  
-  if (heap_start > (rtems_unsigned32) RAM_END) {
-    /* rtems_fatal_error_occurred can not be used before initalization */
-    RAW_PUTS("\n\rRTEMS: Out of memory.\n\r");
-    RAW_PUTS("RTEMS:    Check RAM_END and the size of the work space.\n\r");
-  }
-
-  bsp_libc_init((void *) heap_start, (RAM_END - heap_start), 0);
- 
-#ifdef RTEMS_DEBUG
-    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
+void bsp_pretasking_hook(void);               /* m68k version */
  
 /*
@@ -86,5 +50,5 @@
 {
   void           *vbr;
-  extern 	unsigned int _WorkspaceBase;
+  extern void    *_WorkspaceBase;
 
   /*
@@ -98,10 +62,5 @@
   Cpu_table.interrupt_vector_table = vbr;
 
-  BSP_Configuration.work_space_start = (void *)
-    (((unsigned int)_WorkspaceBase + STACK_SIZE + 0x100) & 0xffffff00);
-
-#if 0
-    (((unsigned int)_end + STACK_SIZE + 0x100) & 0xffffff00);
-#endif
+  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
 
   /* Clock_exit is done as an atexit() function */
Index: c/src/lib/libbsp/m68k/efi332/startup/linkcmds
===================================================================
--- c/src/lib/libbsp/m68k/efi332/startup/linkcmds	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/efi332/startup/linkcmds	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -34,6 +34,6 @@
  * Declare some sizes.
  */
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
+_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
+_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
 
 MEMORY
@@ -41,4 +41,7 @@
   ram     : ORIGIN = 0x80000, LENGTH = 512K
 }
+
+_RamBase = 0x80000;
+_RamSize = 0x80000;
 
 __end_of_ram = 0x100000;
@@ -136,5 +139,5 @@
         } >ram
         .bss : {
-                PROVIDE (_clear_start = .);
+                _clear_start = .;
                 *(.bss)
                 *(COMMON)
@@ -142,15 +145,10 @@
                 PROVIDE (end = .);
 
-                . += StackSize;
-                PROVIDE (_stack_init = .);
+                . += _StackSize;
+                . = ALIGN (16);
+                _stack_init = .;
+                _clear_end = .;
 
-                . = ALIGN (16);
-                PROVIDE (_HeapStart = .);
-                . += HeapSize;
-                PROVIDE (_HeapEnd = .);
-
-                PROVIDE (_clear_end = .);
-
-                PROVIDE (_WorkspaceBase = .);
+                _WorkspaceBase = .;
         } >ram
 }
Index: c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in
===================================================================
--- c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -12,5 +12,5 @@
 PROJECT_ROOT = @PROJECT_ROOT@
 
-VPATH = @srcdir@:@srcdir@/../../../shared
+VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
 
 PGM = ${ARCH}/startup.rel
@@ -18,5 +18,5 @@
 # C source names, if any, go here -- minus the .c
 C_PIECES = bsplibc bsppost bspstart bspclean efi68k_tcp efi68k_wd bootcard \
-    main sbrk setvec gnatinstallhandler
+    m68kpretaskinghook main sbrk setvec gnatinstallhandler
 C_FILES = $(C_PIECES:%=%.c)
 C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
Index: c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -44,42 +44,6 @@
 void bsp_postdriver_hook(void);
 void bsp_libc_init( void *, unsigned32, int );
+void bsp_pretasking_hook(void);               /* m68k version */
 
-/*
- *  Function:   bsp_pretasking_hook
- *  Created:    95/03/10
- *
- *  Description:
- *      BSP pretasking hook.  Called just before drivers are initialized.
- *      Used to setup libc and install any BSP extensions.
- *
- *  NOTES:
- *      Must not use libc (to do io) from here, since drivers are
- *      not yet initialized.
- *
- */
- 
-void bsp_pretasking_hook(void)
-{
-/*   extern int end; */
-  rtems_unsigned32        heap_start;
-  
-  heap_start = (rtems_unsigned32) BSP_Configuration.work_space_start +
-               (rtems_unsigned32) BSP_Configuration.work_space_size;
-  if (heap_start & (CPU_ALIGNMENT-1))
-    heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-  
-  if (heap_start > (rtems_unsigned32) RAM_END) {
-    /* rtems_fatal_error_occurred can not be used before initalization */
-    RAW_PUTS("\n\rRTEMS: Out of memory.\n\r");
-    RAW_PUTS("RTEMS:    Check RAM_END and the size of the work space.\n\r");
-  }
-
-  bsp_libc_init((void *) heap_start, (RAM_END - heap_start), 0);
- 
-#ifdef RTEMS_DEBUG
-    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
- 
 /*
  *  bsp_start
@@ -91,5 +55,5 @@
 {
   void           *vbr;
-  extern 	unsigned int _WorkspaceBase;
+  extern void    *_WorkspaceBase;
 
 /*   set_debug_traps();    */
@@ -106,10 +70,5 @@
   Cpu_table.interrupt_vector_table = vbr;
 
-  BSP_Configuration.work_space_start = (void *)
-    (((unsigned int)_WorkspaceBase + STACK_SIZE + 0x100) & 0xffffff00);
-
-#if 0
-    (((unsigned int)_end + STACK_SIZE + 0x100) & 0xffffff00);
-#endif
+  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
 
   /* Clock_exit is done as an atexit() function */
Index: c/src/lib/libbsp/m68k/efi68k/startup/linkcmds
===================================================================
--- c/src/lib/libbsp/m68k/efi68k/startup/linkcmds	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/efi68k/startup/linkcmds	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -43,4 +43,7 @@
 }
 
+_RamBase = 0x200000;
+_RamSize = 256K;
+
 _VBR = 0x200000;		/* location of the VBR table (in RAM) */
 __end_of_ram = 0x240000;
@@ -50,6 +53,6 @@
  * Declare some sizes.
  */
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
+_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
+_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
 
 /*
@@ -145,5 +148,5 @@
         } >ram
         .bss : {
-                PROVIDE (_clear_start = .);
+                _clear_start = .;
                 *(.bss)
                 *(COMMON)
@@ -151,15 +154,10 @@
                 PROVIDE (end = .);
 
-                . += StackSize;
-                PROVIDE (_stack_init = .);
+                . += _StackSize;
+                . = ALIGN (16);
+                _stack_init = .;
+                _clear_end = .;
 
-                . = ALIGN (16);
-                PROVIDE (_HeapStart = .);
-                . += HeapSize;
-                PROVIDE (_HeapEnd = .);
-
-                PROVIDE (_clear_end = .);
-
-                PROVIDE (_WorkspaceBase = .);
+                _WorkspaceBase = .;
         } >ram
 }
Index: c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in
===================================================================
--- c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -17,6 +17,6 @@
 
 # C source names, if any, go here -- minus the .c
-C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \
-    gnatinstallhandler
+C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
+    main sbrk setvec gnatinstallhandler
 C_FILES = $(C_PIECES:%=%.c)
 C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
Index: c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -40,35 +40,5 @@
 void bsp_postdriver_hook(void);
 void bsp_libc_init( void *, unsigned32, int );
-
-/*
- *  Function:   bsp_pretasking_hook
- *  Created:    95/03/10
- *
- *  Description:
- *      BSP pretasking hook.  Called just before drivers are initialized.
- *      Used to setup libc and install any BSP extensions.
- *
- *  NOTES:
- *      Must not use libc (to do io) from here, since drivers are
- *      not yet initialized.
- *
- */
- 
-void bsp_pretasking_hook(void)
-{
-    extern int end;
-    rtems_unsigned32        heap_start;
-
-    heap_start = (rtems_unsigned32) &end;
-    if (heap_start & (CPU_ALIGNMENT-1))
-        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
-    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
-
- 
-#ifdef RTEMS_DEBUG
-    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
+void bsp_pretasking_hook(void);               /* m68k version */
 
 /*
@@ -80,4 +50,5 @@
 void bsp_start( void )
 {
+  extern void    *_WorkspaceBase;
 
   /*
@@ -98,6 +69,5 @@
    */
 
-  BSP_Configuration.work_space_start = (void *)
-      (RAM_END - BSP_Configuration.work_space_size);
+  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
 
   /*
Index: c/src/lib/libbsp/m68k/gen68302/startup/linkcmds
===================================================================
--- c/src/lib/libbsp/m68k/gen68302/startup/linkcmds	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/gen68302/startup/linkcmds	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -18,4 +18,7 @@
 }
 
+_RamBase = 0;
+_RamSize = 16M;
+
 m302 = 0xf7f000;
 _VBR = 0x000000;		/* location of the VBR table (in RAM) */
@@ -24,6 +27,6 @@
  * Declare some sizes.
  */
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
+_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
+_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
 
 SECTIONS
@@ -115,5 +118,5 @@
         } >ram
         .bss : {
-                PROVIDE (_clear_start = .);
+                _clear_start = .;
                 *(.bss)
                 *(COMMON)
@@ -121,15 +124,10 @@
                 PROVIDE (end = .);
 
-                . += StackSize;
-                PROVIDE (_stack_init = .);
+                . += _StackSize;
+                . = ALIGN (16);
+                _stack_init = .;
+                _clear_end = .;
 
-                . = ALIGN (16);
-                PROVIDE (_HeapStart = .);
-                . += HeapSize;
-                PROVIDE (_HeapEnd = .);
-
-                PROVIDE (_clear_end = .);
-
-                PROVIDE (_WorkspaceBase = .);
+                _WorkspaceBase = .;
         } >ram
 }
Index: c/src/lib/libbsp/m68k/gen68340/start/start.S
===================================================================
--- c/src/lib/libbsp/m68k/gen68340/start/start.S	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/gen68340/start/start.S	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -852,12 +852,4 @@
 
         .align 2
-	PUBLIC (_HeapSize)
-SYM (_HeapSize):
-        .long  HeapSize
-	PUBLIC (_StackSize)
-SYM (_StackSize):
-        .long  StackSize
-END_CODE
-
 BEGIN_DATA_DCL
         .align 2
Index: c/src/lib/libbsp/m68k/gen68340/start/startfor340only.S
===================================================================
--- c/src/lib/libbsp/m68k/gen68340/start/startfor340only.S	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/gen68340/start/startfor340only.S	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -477,11 +477,4 @@
 
         .align 2
-	PUBLIC (_HeapSize)
-SYM (_HeapSize):
-        .long  HeapSize
-	PUBLIC (_StackSize)
-SYM (_StackSize):
-        .long  StackSize
-END_CODE
 
 BEGIN_DATA_DCL
Index: c/src/lib/libbsp/m68k/gen68340/startup/Makefile.in
===================================================================
--- c/src/lib/libbsp/m68k/gen68340/startup/Makefile.in	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/gen68340/startup/Makefile.in	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -17,6 +17,6 @@
 
 # C source names, if any, go here -- minus the .c
-C_PIECES = bspclean bsplibc bsppost bspstart init68340 bootcard main sbrk \
-    setvec dumpanic gnatinstallhandler
+C_PIECES = bspclean bsplibc bsppost bspstart init68340 bootcard \
+    m68kpretaskinghook main sbrk setvec dumpanic gnatinstallhandler
 C_FILES = $(C_PIECES:%=%.c)
 C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
Index: c/src/lib/libbsp/m68k/gen68340/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/m68k/gen68340/startup/bspstart.c	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/gen68340/startup/bspstart.c	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -45,30 +45,5 @@
 void bsp_postdriver_hook(void);
 void bsp_libc_init( void *, unsigned32, int );
-
-/*
- *  Function:   bsp_pretasking_hook
- *  Created:    95/03/10
- *
- *  Description:
- *      BSP pretasking hook.  Called just before drivers are initialized.
- *      Used to setup libc and install any BSP extensions.
- *
- *  NOTES:
- *      Must not use libc (to do io) from here, since drivers are
- *      not yet initialized.
- *
- */
- 
-void bsp_pretasking_hook(void)
-{
-    extern void *_HeapStart;
-    extern rtems_unsigned32 _HeapSize;
-
-    bsp_libc_init(&_HeapStart, _HeapSize, 0);
- 
-#ifdef RTEMS_DEBUG
-    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
+void bsp_pretasking_hook(void);               /* m68k version */
 
 /*
Index: c/src/lib/libbsp/m68k/gen68340/startup/linkcmds
===================================================================
--- c/src/lib/libbsp/m68k/gen68340/startup/linkcmds	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/gen68340/startup/linkcmds	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -19,19 +19,15 @@
 
 /*
- * a.out format doesn't handle prom images very well
- */
-OUTPUT_FORMAT(coff-m68k)
-
-/*
  * Declare some sizes.
  */
-RamSize = DEFINED(RamSize) ? RamSize : 4M;
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
+_RamBase = 0x10000000;
+_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
+_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
+_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
 
 /*
  * Declare on-board memory.
  * It would be nice if the ram length could be given as
- * LENGTH=RamSize, but gld doesn't allow non-constant
+ * LENGTH=_RamSize, but gld doesn't allow non-constant
  * values in the LENGTH expression.  
  */
@@ -51,9 +47,4 @@
  */
 SECTIONS {
-	/*
-	 * Hardware variations
-	 */
-	_RamSize = RamSize;
-	__RamSize = RamSize;
 
         /*
@@ -69,6 +60,5 @@
          */
         ram : {
-                _RamBase = .;
-                __RamBase = .;
+                . = .;
         } >ram
 
@@ -155,9 +145,7 @@
         } >ram
         .bss : {
-		M68Kvec = .;
-		_M68Kvec = .;
-		. += (256 * 4);
-                PROVIDE (_bss_start = .);
-                PROVIDE (_clear_start = .);
+                M68Kvec = .;
+                . += (256 * 4);
+                _clear_start = .;
                 *(.bss)
                 *(COMMON)
@@ -165,15 +153,10 @@
                 PROVIDE (end = .);
 
-                . += StackSize;
-                PROVIDE (_stack_init = .);
+                . += _StackSize;
+                . = ALIGN (16);
+                _stack_init = .;
+                _clear_end = .;
 
-                . = ALIGN (16);
-                PROVIDE (_HeapStart = .);
-                . += HeapSize;
-                PROVIDE (_HeapEnd = .);
-
-                PROVIDE (_clear_end = .);
-
-                PROVIDE (_WorkspaceBase = .);
+                _WorkspaceBase = .;
         } >ram
 
Index: c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp
===================================================================
--- c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -19,6 +19,6 @@
  * Declare some sizes.
  */
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
+_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
+_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
 
 /*
@@ -121,6 +121,6 @@
 
                 _HeapStart = .;
-                . += HeapSize;
-                . += StackSize;
+                . += _HeapSize;
+                . += _StackSize;
                 . = ALIGN (16);
                 stack_init = .;
Index: c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom
===================================================================
--- c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -19,6 +19,6 @@
  * Declare some sizes.
  */
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
+_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
+_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
 
 /*
@@ -120,6 +120,6 @@
 
                 _HeapStart = .;
-                . += HeapSize;
-                . += StackSize;
+                . += _HeapSize;
+                . += _StackSize;
                 . = ALIGN (16);
                 stack_init = .;
Index: c/src/lib/libbsp/m68k/idp/startup/Makefile.in
===================================================================
--- c/src/lib/libbsp/m68k/idp/startup/Makefile.in	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/idp/startup/Makefile.in	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -17,6 +17,6 @@
 
 # C source names, if any, go here -- minus the .c
-C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \
-    gnatinstallhandler
+C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
+    main sbrk setvec gnatinstallhandler
 C_FILES = $(C_PIECES:%=%.c)
 C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
Index: c/src/lib/libbsp/m68k/idp/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/m68k/idp/startup/bspstart.c	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/idp/startup/bspstart.c	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -47,36 +47,6 @@
 void bsp_postdriver_hook(void);
 void bsp_libc_init( void *, unsigned32, int );
+void bsp_pretasking_hook(void);               /* m68k version */
 
-/*
- *  Function:   bsp_pretasking_hook
- *  Created:    95/03/10
- *
- *  Description:
- *      BSP pretasking hook.  Called just before drivers are initialized.
- *      Used to setup libc and install any BSP extensions.
- *
- *  NOTES:
- *      Must not use libc (to do io) from here, since drivers are
- *      not yet initialized.
- *
- */
- 
-void bsp_pretasking_hook(void)
-{
-    extern int _end;
-    rtems_unsigned32        heap_start;
- 
-    heap_start = (rtems_unsigned32) &_end;
-    if (heap_start & (CPU_ALIGNMENT-1))
-        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
- 
-	/* Create 64 KByte memory region for RTEMS executive */
-    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
- 
-#ifdef RTEMS_DEBUG
-    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
- 
 /*
  *  bsp_start
@@ -89,4 +59,5 @@
   m68k_isr_entry *monitors_vector_table;
   int             index;
+  extern void    *_WorkspaceBase;
 
   duart_base = (unsigned char *)DUART_ADDR;
@@ -127,6 +98,5 @@
   Cpu_table.interrupt_stack_size = 4096;
 
-  BSP_Configuration.work_space_start = (void *)
-     (RAM_END - BSP_Configuration.work_space_size);
+  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
  
 /*  led_putnum('e'); * for debugging purposes only */
Index: c/src/lib/libbsp/m68k/idp/startup/linkcmds
===================================================================
--- c/src/lib/libbsp/m68k/idp/startup/linkcmds	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/idp/startup/linkcmds	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -21,6 +21,8 @@
  * Declare some sizes.
  */
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
+_RamBase = 0x0;
+_RamSize = DEFINED(_RamSize) ? _RamSize : 2M;
+_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
+_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
 
 SECTIONS
@@ -112,6 +114,5 @@
         } >ram
         .bss : {
-                PROVIDE (_bss_start = .);
-                PROVIDE (_clear_start = .);
+                _clear_start = .;
                 *(.bss)
                 *(COMMON)
@@ -119,15 +120,10 @@
                 PROVIDE (end = .);
 
-                . += StackSize;
-                PROVIDE (_stack_init = .);
+                . += _StackSize;
+                . = ALIGN (16);
+                _stack_init = .;
+                _clear_end = .;
 
-                . = ALIGN (16);
-                PROVIDE (_HeapStart = .);
-                . += HeapSize;
-                PROVIDE (_HeapEnd = .);
-
-                PROVIDE (_clear_end = .);
-
-                PROVIDE (_WorkspaceBase = .);
+                _WorkspaceBase = .;
         } >ram
 }
Index: c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in
===================================================================
--- c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -17,6 +17,6 @@
 
 # C source names, if any, go here -- minus the .c
-C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \
-    gnatinstallhandler
+C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
+    main sbrk setvec gnatinstallhandler
 C_FILES = $(C_PIECES:%=%.c)
 C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
Index: c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -41,35 +41,5 @@
 void bsp_postdriver_hook(void);
 void bsp_libc_init( void *, unsigned32, int );
-
-/*
- *  Function:   bsp_pretasking_hook
- *  Created:    95/03/10
- *
- *  Description:
- *      BSP pretasking hook.  Called just before drivers are initialized.
- *      Used to setup libc and install any BSP extensions.
- *
- *  NOTES:
- *      Must not use libc (to do io) from here, since drivers are
- *      not yet initialized.
- *
- */
- 
-void bsp_pretasking_hook(void)
-{
-    extern int end;
-    rtems_unsigned32        heap_start;
-
-    heap_start = (rtems_unsigned32) &end;
-    if (heap_start & (CPU_ALIGNMENT-1))
-        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
-    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
-
- 
-#ifdef RTEMS_DEBUG
-    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
+void bsp_pretasking_hook(void);               /* m68k version */
 
 /*
@@ -83,4 +53,5 @@
   m68k_isr_entry *monitors_vector_table;
   int             index;
+  extern void    *_WorkspaceBase;
 
   monitors_vector_table = (m68k_isr_entry *)0;   /* 135Bug Vectors are at 0 */
@@ -110,6 +81,4 @@
   Cpu_table.interrupt_stack_size = 4096;
 
-  BSP_Configuration.work_space_start = (void *)
-     (RAM_END - BSP_Configuration.work_space_size);
-
+  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
 }
Index: c/src/lib/libbsp/m68k/mvme136/startup/linkcmds
===================================================================
--- c/src/lib/libbsp/m68k/mvme136/startup/linkcmds	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/mvme136/startup/linkcmds	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -16,6 +16,8 @@
  * Declare some sizes.
  */
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
+_RamBase = 0x0;
+_RamSize = DEFINED(_RamSize) ? _RamSize : 1M;
+_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
+_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
 
 MEMORY
@@ -112,6 +114,5 @@
         } >ram
         .bss : {
-                PROVIDE (_bss_start = .);
-                PROVIDE (_clear_start = .);
+                _clear_start = .;
                 *(.bss)
                 *(COMMON)
@@ -119,15 +120,10 @@
                 PROVIDE (end = .);
 
-                . += StackSize;
-                PROVIDE (_stack_init = .);
+                . += _StackSize;
+                . = ALIGN (16);
+                _stack_init = .;
+                _clear_end = .;
 
-                . = ALIGN (16);
-                PROVIDE (_HeapStart = .);
-                . += HeapSize;
-                PROVIDE (_HeapEnd = .);
-
-                PROVIDE (_clear_end = .);
-
-                PROVIDE (_WorkspaceBase = .);
+                _WorkspaceBase = .;
         } >ram
 }
Index: c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in
===================================================================
--- c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -17,6 +17,6 @@
 
 # C source names, if any, go here -- minus the .c
-C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \
-    gnatinstallhandler
+C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
+    main sbrk setvec gnatinstallhandler
 C_FILES = $(C_PIECES:%=%.c)
 C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
Index: c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -44,36 +44,6 @@
 void bsp_postdriver_hook(void);
 void bsp_libc_init( void *, unsigned32, int );
+void bsp_pretasking_hook(void);               /* m68k version */
 
-/*
- *  Function:   bsp_pretasking_hook
- *  Created:    95/03/10
- *
- *  Description:
- *      BSP pretasking hook.  Called just before drivers are initialized.
- *      Used to setup libc and install any BSP extensions.
- *
- *  NOTES:
- *      Must not use libc (to do io) from here, since drivers are
- *      not yet initialized.
- *
- */
- 
-void bsp_pretasking_hook(void)
-{
-    extern int end;
-    rtems_unsigned32        heap_start;
-
-    heap_start = (rtems_unsigned32) &end;
-    if (heap_start & (CPU_ALIGNMENT-1))
-        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
-    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
-
- 
-#ifdef RTEMS_DEBUG
-    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
- 
 /*
  *  bsp_start
@@ -86,4 +56,5 @@
   m68k_isr_entry *monitors_vector_table;
   int             index;
+  extern void    *_WorkspaceBase;
 
   monitors_vector_table = (m68k_isr_entry *)0;   /* 135Bug Vectors are at 0 */
@@ -116,6 +87,4 @@
   Cpu_table.interrupt_stack_size = 4096;
 
-  BSP_Configuration.work_space_start = (void *)
-     (RAM_END - BSP_Configuration.work_space_size);
-
+  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
 }
Index: c/src/lib/libbsp/m68k/mvme147/startup/linkcmds
===================================================================
--- c/src/lib/libbsp/m68k/mvme147/startup/linkcmds	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/mvme147/startup/linkcmds	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -20,6 +20,8 @@
  * Declare some sizes.
  */
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
+_RamBase = 0x0;
+_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
+_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
+_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
 
 MEMORY
@@ -116,6 +118,5 @@
         } >ram
         .bss : {
-                PROVIDE (_bss_start = .);
-                PROVIDE (_clear_start = .);
+                _clear_start = .;
                 *(.bss)
                 *(COMMON)
@@ -123,15 +124,10 @@
                 PROVIDE (end = .);
 
-                . += StackSize;
-                PROVIDE (_stack_init = .);
+                . += _StackSize;
+                . = ALIGN (16);
+                _stack_init = .;
+                _clear_end = .;
 
-                . = ALIGN (16);
-                PROVIDE (_HeapStart = .);
-                . += HeapSize;
-                PROVIDE (_HeapEnd = .);
-
-                PROVIDE (_clear_end = .);
-
-                PROVIDE (_WorkspaceBase = .);
+                _WorkspaceBase = .;
         } >ram
 }
Index: c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in
===================================================================
--- c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -18,6 +18,6 @@
 
 # C source names, if any, go here -- minus the .c
-C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \
-    gnatinstallhandler
+C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
+    main sbrk setvec gnatinstallhandler
 C_FILES = $(C_PIECES:%=%.c)
 C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
Index: c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -44,35 +44,6 @@
 void bsp_postdriver_hook(void);
 void bsp_libc_init( void *, unsigned32, int );
+void bsp_pretasking_hook(void);               /* m68k version */
 
-/*
- *  Function:   bsp_pretasking_hook
- *  Created:    95/03/10
- *
- *  Description:
- *      BSP pretasking hook.  Called just before drivers are initialized.
- *      Used to setup libc and install any BSP extensions.
- *
- *  NOTES:
- *      Must not use libc (to do io) from here, since drivers are
- *      not yet initialized.
- *
- */
- 
-void bsp_pretasking_hook(void)
-{
-    extern int end;
-    rtems_unsigned32        heap_start;
-
-    heap_start = (rtems_unsigned32) &end;
-    if (heap_start & (CPU_ALIGNMENT-1))
-        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
-    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
- 
-#ifdef RTEMS_DEBUG
-    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
- 
 /*
  *  bsp_start
@@ -86,4 +57,5 @@
   int             index;
   rtems_unsigned8 node_number;
+  extern void    *_WorkspaceBase;
 
   monitors_vector_table = (m68k_isr_entry *)0;   /* 147Bug Vectors are at 0 */
@@ -175,6 +147,4 @@
   Cpu_table.interrupt_stack_size = 4096;
 
-  BSP_Configuration.work_space_start = (void *)
-     (RAM_END - BSP_Configuration.work_space_size);
-
+  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
 }
Index: c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds
===================================================================
--- c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -20,6 +20,8 @@
  * Declare some sizes.
  */
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
+_RamBase = 0x0;
+_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
+_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
+_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
 
 MEMORY
@@ -116,6 +118,5 @@
         } >ram
         .bss : {
-                PROVIDE (_bss_start = .);
-                PROVIDE (_clear_start = .);
+                _clear_start = .;
                 *(.bss)
                 *(COMMON)
@@ -123,15 +124,10 @@
                 PROVIDE (end = .);
 
-                . += StackSize;
-                PROVIDE (_stack_init = .);
+                . += _StackSize;
+                . = ALIGN (16);
+                _stack_init = .;
+                _clear_end = .;
 
-                . = ALIGN (16);
-                PROVIDE (_HeapStart = .);
-                . += HeapSize;
-                PROVIDE (_HeapEnd = .);
-
-                PROVIDE (_clear_end = .);
-
-                PROVIDE (_WorkspaceBase = .);
+                _WorkspaceBase = .;
         } >ram
 }
Index: c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in
===================================================================
--- c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -17,6 +17,6 @@
 
 # C source names, if any, go here -- minus the .c
-C_PIECES = bspclean bsplibc bsppost bspstart bootcard main page_table sbrk \
-    setvec gnatinstallhandler
+C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
+    main page_table sbrk setvec gnatinstallhandler
 C_FILES = $(C_PIECES:%=%.c)
 C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
Index: c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -48,34 +48,5 @@
 void bsp_postdriver_hook(void);
 void bsp_libc_init( void *, unsigned32, int );
-
-/*
- *  Function:   bsp_pretasking_hook
- *  Created:    95/03/10
- *
- *  Description:
- *      BSP pretasking hook.  Called just before drivers are initialized.
- *      Used to setup libc and install any BSP extensions.
- *
- *  NOTES:
- *      Must not use libc (to do io) from here, since drivers are
- *      not yet initialized.
- *
- */
- 
-void bsp_pretasking_hook(void)
-{
-    extern int end;
-    rtems_unsigned32        heap_start;
-
-    heap_start = (rtems_unsigned32) &end;
-    if (heap_start & (CPU_ALIGNMENT-1))
-        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
-    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
- 
-#ifdef RTEMS_DEBUG
-    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
+void bsp_pretasking_hook(void);               /* m68k version */
 
 /*
@@ -89,4 +60,5 @@
   m68k_isr_entry *monitors_vector_table;
   int             index;
+  extern void    *_WorkspaceBase;
 
   /*
@@ -133,5 +105,4 @@
   Cpu_table.interrupt_stack_size = 4096;
 
-  BSP_Configuration.work_space_start = (void *)
-     (RAM_END - BSP_Configuration.work_space_size);
+  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
 }
Index: c/src/lib/libbsp/m68k/mvme162/startup/linkcmds
===================================================================
--- c/src/lib/libbsp/m68k/mvme162/startup/linkcmds	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/mvme162/startup/linkcmds	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -23,6 +23,8 @@
  * Declare some sizes.
  */
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
+_RamBase = 0x100000;
+_RamSize = DEFINED(_RamSize) ? _RamSize : 1M;
+_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
+_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
 
 MEMORY
@@ -119,6 +121,5 @@
         } >ram
         .bss : {
-                PROVIDE (_bss_start = .);
-                PROVIDE (_clear_start = .);
+                _clear_start = .;
                 *(.bss)
                 *(COMMON)
@@ -126,15 +127,10 @@
                 PROVIDE (end = .);
 
-                . += StackSize;
-                PROVIDE (_stack_init = .);
+                . += _StackSize;
+                . = ALIGN (16);
+                _stack_init = .;
+                _clear_end = .;
 
-                . = ALIGN (16);
-                PROVIDE (_HeapStart = .);
-                . += HeapSize;
-                PROVIDE (_HeapEnd = .);
-
-                PROVIDE (_clear_end = .);
-
-                PROVIDE (_WorkspaceBase = .);
+                _WorkspaceBase = .;
         } >ram
 }
Index: c/src/lib/libbsp/m68k/mvme167/bsp_specs
===================================================================
--- c/src/lib/libbsp/m68k/mvme167/bsp_specs	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/mvme167/bsp_specs	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -16,5 +16,5 @@
 -lc -lgcc --end-group \
 %{!qelf: %{!qnolinkcmds: -T linkcmds%s}} %{qelf: %{!qnolinkcmd: -T
-elflinkcmds%s}}}
+linkcmds%s}}}
 
 *startfile:
Index: c/src/lib/libbsp/m68k/mvme167/startup/Makefile.in
===================================================================
--- c/src/lib/libbsp/m68k/mvme167/startup/Makefile.in	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/mvme167/startup/Makefile.in	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -17,6 +17,6 @@
 
 # C source names, if any, go here -- minus the .c
-C_PIECES = bspclean bsplibc bsppost bspstart bootcard main page_table sbrk \
-    setvec gnatinstallhandler
+C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
+    main page_table sbrk setvec gnatinstallhandler
 C_FILES = $(C_PIECES:%=%.c)
 C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
Index: c/src/lib/libbsp/m68k/mvme167/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/m68k/mvme167/startup/bspstart.c	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/mvme167/startup/bspstart.c	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -49,46 +49,5 @@
 void bsp_postdriver_hook( void );
 void bsp_libc_init( void *, unsigned32, int );
-
-
-/*
- *  bsp_pretasking_hook
- *
- *  Called when RTEMS initialization is complete but before interrupts and
- *  tasking are enabled. Used to setup libc and install any BSP extensions.
- *
- *  Must not use libc (to do io) from here, since drivers are not yet
- *  initialized.
- *
- *  Installed in the rtems_cpu_table defined in 
- *  rtems/c/src/exec/score/cpu/m68k/cpu.h in main() below. Called from
- *  rtems_initialize_executive() defined in rtems/c/src/exec/sapi/src/init.c
- *
- *  Input parameters: NONE
- *
- *  Output parameters: NONE
- *
- *  Return values: NONE
- */
-void bsp_pretasking_hook( void )
-{    
-  /* 
-   *  These are assigned addresses in the linkcmds file for the BSP. This
-   *  approach is better than having these defined as manifest constants and
-   *  compiled into the kernel, but it is still not ideal when dealing with
-   *  multiprocessor configuration in which each board as a different memory
-   *  map. A better place for defining these symbols might be the makefiles.
-   *  Consideration should also be given to developing an approach in which
-   *  the kernel and the application can be linked and burned into ROM
-   *  independently of each other.
-   */
-  extern unsigned char _HeapStart, _HeapEnd;
-
-  bsp_libc_init(&_HeapStart, &_HeapEnd - &_HeapStart, 0);
-
-#ifdef RTEMS_DEBUG
-    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
-
+void bsp_pretasking_hook(void);               /* m68k version */
 
 /*
@@ -123,4 +82,5 @@
   extern void *_WorkspaceBase;
   extern m68k_isr_entry M68Kvec[];
+  extern void    *_WorkspaceBase;
   
   void M68KFPSPInstallExceptionHandlers (void);
Index: c/src/lib/libbsp/m68k/mvme167/startup/elflinkcmds
===================================================================
--- c/src/lib/libbsp/m68k/mvme167/startup/elflinkcmds	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/mvme167/startup/elflinkcmds	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -22,18 +22,9 @@
 ENTRY(_start)
 
-/* Base address and size of RAM on the MVME167 */
-
-RAM_SIZE = 4M;
-RAM_START = 0x00800000;
-RAM_END = RAM_START + RAM_SIZE;
-
 /*
  * Declare some sizes.
- * XXX: The assignment of ". += XyzSize;" fails in older gld's if the
- *      number used there is not constant.  If this happens to you, edit
- *      the lines marked XXX below to use a constant value.
  */
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
+_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
+_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
 
 MEMORY
@@ -171,7 +162,7 @@
   _HeapEnd = .;
   _StackStart = .;
-  . += StackSize;	/* XXX -- Old gld can't	handle this	*/
+  . += _StackSize;	/* XXX -- Old gld can't	handle this	*/
   /* . +=	0x10000; */	/* HeapSize	for	old	gld	*/
-  /* . +=	0x1000;	 */	/* StackSize for old gld */
+  /* . +=	0x1000;	 */	/* _StackSize for old gld */
   . =	ALIGN (16);
   _StackEnd = .;
Index: c/src/lib/libbsp/m68k/mvme167/startup/linkcmds
===================================================================
--- c/src/lib/libbsp/m68k/mvme167/startup/linkcmds	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/mvme167/startup/linkcmds	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -22,15 +22,11 @@
 ENTRY(_start)
 
-/* Base address and size of RAM on the MVME167 */
-
-RAM_SIZE = 4M;
-RAM_START = 0x00800000;
-RAM_END = RAM_START + RAM_SIZE;
-
 /*
  * Declare some sizes.
  */
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
+_RamBase = 0x00800000;
+_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
+_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
+_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
 
 MEMORY
@@ -133,6 +129,5 @@
         } >ram
         .bss : {
-                PROVIDE (_bss_start = .);
-                PROVIDE (_clear_start = .);
+                _clear_start = .;
                 *(.bss)
                 *(COMMON)
@@ -140,14 +135,10 @@
                 PROVIDE (end = .);
 
-                . += StackSize;
-                PROVIDE (_stack_init = .);
+                . += _StackSize;
+                . = ALIGN (16);
+                _stack_init = .;
+                _clear_end = .;
 
-                . = ALIGN (16);
-		PROVIDE (_HeapStart = .);
-		. += HeapSize;
-		PROVIDE (_HeapEnd = .);
-                PROVIDE (_clear_end = .);
-
-                PROVIDE (_WorkspaceBase = .);
+                _WorkspaceBase = .;
         } >ram
 }
Index: c/src/lib/libbsp/m68k/ods68302/start/debugreset.S
===================================================================
--- c/src/lib/libbsp/m68k/ods68302/start/debugreset.S	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/ods68302/start/debugreset.S	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -48,6 +48,6 @@
 
 zerobss:
-        moveal  #end,%a0                        | find end of .bss
-        moveal  #bss_start,%a1                  | find beginning of .bss
+        moveal  #_clear_end,%a0                 | find end of .bss
+        moveal  #_clear_start,%a1               | find beginning of .bss
         moveq   #0,%d0
         
@@ -56,12 +56,7 @@
         movel   %d0,%a1@+                       | to zero out uninitialized
         cmpal   %a0,%a1
-        jlt     zerobss_loop                    | loop until _end reached
+        jlt     zerobss_loop                    | loop until end reached
 
-        movel   #end,%d0                        | d0 = end of bss/start of heap
-        addl    #heap_size,%d0                  | d0 = end of heap
-
-        movel   %d0,stack_start                 | Save for brk() routine
-        addl    #stack_size,%d0                 | make room for stack
-        andl    #0xffffffc0,%d0                 | align it on 16 byte boundary
+        movel   %d0,_stack_init                 | load stack top
 
         movw    #0x3700,%sr                     | SUPV MODE,INTERRUPTS OFF!!!
@@ -80,9 +75,4 @@
         
 start_frame:
-        .space  4,0
-
-        .global stack_start
-        
-stack_start:
         .space  4,0
 
Index: c/src/lib/libbsp/m68k/ods68302/start/reset.S
===================================================================
--- c/src/lib/libbsp/m68k/ods68302/start/reset.S	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/ods68302/start/reset.S	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -454,6 +454,6 @@
 
 zerobss:
-        moveal  #end,%a0                        | find end of .bss
-        moveal  #_bss_start,%a1                 | find beginning of .bss
+        moveal  #_clear_end,%a0                 | find end of .bss
+        moveal  #_clear_start,%a1               | find beginning of .bss
         moveq   #0,%d0
         
@@ -464,10 +464,5 @@
         jlt     zerobss_loop                    | loop until _end reached
 
-        movel   #end,%d0                        | d0 = end of bss/start of heap
-        addl    #heap_size,%d0                  | d0 = end of heap
-
-        movel   %d0,stack_start                 | Save for brk() routine
-        addl    #stack_size,%d0                 | make room for stack
-        andl    #0xffffffc0,%d0                 | align it on 16 byte boundary
+        movel   %d0,_stack_init                 | load stack top
 
         movw    #0x3700,%sr                     | SUPV MODE,INTERRUPTS OFF!!!
Index: c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in
===================================================================
--- c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -18,6 +18,6 @@
 # C source names, if any, go here -- minus the .c
 C_PIECES = crc debugport gdb-hooks bootcard main m68302scc m68k-stub \
-    memcheck trace gnatinstallhandler bsplibc bsppost bspstart bspclean sbrk \
-    setvec
+    m68kpretaskinghook memcheck trace gnatinstallhandler bsplibc \
+    bsppost bspstart bspclean sbrk setvec
 C_FILES = $(C_PIECES:%=%.c)
 C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
Index: c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -41,35 +41,6 @@
 void bsp_postdriver_hook(void);
 void bsp_libc_init( void *, unsigned32, int );
+void bsp_pretasking_hook(void);               /* m68k version */
 
-/*
- *  Function:   bsp_pretasking_hook
- *  Created:    95/03/10
- *
- *  Description:
- *      BSP pretasking hook.  Called just before drivers are initialized.
- *      Used to setup libc and install any BSP extensions.
- *
- *  NOTES:
- *      Must not use libc (to do io) from here, since drivers are
- *      not yet initialized.
- *
- */
- 
-void bsp_pretasking_hook(void)
-{
-    extern int end;
-    rtems_unsigned32        heap_start;
-
-    heap_start = (rtems_unsigned32) &end;
-    if (heap_start & (CPU_ALIGNMENT-1))
-        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
-    bsp_libc_init((void *) heap_start, 64 * 1024, 0);
- 
-#ifdef RTEMS_DEBUG
-    rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
-}
- 
 /*
  *  bsp_start
@@ -80,11 +51,6 @@
 void bsp_start( void )
 {
-  /*
-   *  Allocate the memory for the RTEMS Work Space.  This can come from
-   *  a variety of places: hard coded address, malloc'ed from outside
-   *  RTEMS world (e.g. simulator or primitive memory manager), or (as
-   *  typically done by stock BSPs) by subtracting the required amount
-   *  of work space from the last physical address on the CPU board.
-   */
+  extern void *_WorkspaceBase;
+
 #if 0
   Cpu_table.interrupt_vector_table = (mc68000_isr *) 0/*&M68Kvec*/;
@@ -97,6 +63,5 @@
    */
 
-  BSP_Configuration.work_space_start = (void *)
-      (RAM_END - BSP_Configuration.work_space_size);
+  BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
 
   /*
Index: c/src/lib/libbsp/m68k/ods68302/startup/linkcmds
===================================================================
--- c/src/lib/libbsp/m68k/ods68302/startup/linkcmds	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/ods68302/startup/linkcmds	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -9,6 +9,8 @@
  * Declare some sizes.
  */
-HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
-StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
+_RamBase = 0x0;
+_RamSize = DEFINED(_RamSize) ? _RamSize : 1M;
+_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
+_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
 
 /*
@@ -114,6 +116,5 @@
         } >ram
         .bss : {
-                PROVIDE (_bss_start = .);
-                PROVIDE (_clear_start = .);
+                _clear_start = .;
                 *(.bss)
                 *(COMMON)
@@ -121,15 +122,10 @@
                 PROVIDE (end = .);
 
-                . += StackSize;
-                PROVIDE (_stack_init = .);
+                . += _StackSize;
+                . = ALIGN (16);
+                _stack_init = .;
+                _clear_end = .;
 
-                . = ALIGN (16);
-                PROVIDE (_HeapStart = .);
-                . += HeapSize;
-                PROVIDE (_HeapEnd = .);
-
-                PROVIDE (_clear_end = .);
-
-                PROVIDE (_WorkspaceBase = .);
+                _WorkspaceBase = .;
         } >ram
 }
Index: c/src/lib/libbsp/m68k/shared/start.S
===================================================================
--- c/src/lib/libbsp/m68k/shared/start.S	(revision 11944b9bc356ee7a40bcb46aaeee287762265cf7)
+++ c/src/lib/libbsp/m68k/shared/start.S	(revision b8c98837559029b807fc80b54d170b2c3184df1f)
@@ -78,5 +78,4 @@
 
         movel   # SYM (_stack_init),d0  | d0 = stop of stack
-        andl    #0xffffffc0,d0          | align it on 16 byte boundary
         movw    #0x3700,sr              | SUPV MODE,INTERRUPTS OFF!!!
         movel   d0,a7                   | set master stack pointer
