summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/powerpc/psim/ChangeLog15
-rw-r--r--c/src/lib/libbsp/powerpc/psim/Makefile.am3
-rw-r--r--c/src/lib/libbsp/powerpc/psim/configure.ac6
-rw-r--r--c/src/lib/libbsp/powerpc/psim/startup/bspstart.c64
-rw-r--r--c/src/lib/libbsp/sparc/leon3/ChangeLog15
-rw-r--r--c/src/lib/libbsp/sparc/leon3/Makefile.am117
-rw-r--r--c/src/lib/libbsp/sparc/leon3/configure.ac2
-rw-r--r--c/src/lib/libbsp/sparc/leon3/startup/bspstart.c68
8 files changed, 115 insertions, 175 deletions
diff --git a/c/src/lib/libbsp/powerpc/psim/ChangeLog b/c/src/lib/libbsp/powerpc/psim/ChangeLog
index 2b08044573..0c2ccc141a 100644
--- a/c/src/lib/libbsp/powerpc/psim/ChangeLog
+++ b/c/src/lib/libbsp/powerpc/psim/ChangeLog
@@ -1,3 +1,18 @@
+2008-05-15 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * Makefile.am, configure.ac, startup/bspstart.c: Add capability for
+ bootcard.c BSP Initialization Framework to ask the BSP where it has
+ memory for the RTEMS Workspace and C Program Heap. These collectively
+ are referred to as work area. If the BSP supports this, then it does
+ not have to include code to split the available memory between the
+ two areas. This reduces the amount of code in the BSP specific
+ bspstart.c file. Additionally, the shared framework can initialize
+ the C Library, call rtems_debug_enable(), and dirty the work area
+ memory. Until most/all BSPs support this new capability, if the BSP
+ supports this, it should call
+ RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION from its configure.ac. When
+ the transition is complete, this autoconf macro can be removed.
+
2008-05-12 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/bspstart.c: Refactored and renamed initialization routines to
diff --git a/c/src/lib/libbsp/powerpc/psim/Makefile.am b/c/src/lib/libbsp/powerpc/psim/Makefile.am
index 78c1c09c40..ebf7179d11 100644
--- a/c/src/lib/libbsp/powerpc/psim/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/psim/Makefile.am
@@ -41,7 +41,8 @@ noinst_LIBRARIES = libbsp.a
startup_SOURCES = startup/bspclean.c ../../shared/bsplibc.c \
startup/bspclean.c ../../shared/bsplibc.c \
- ../../shared/bsppost.c ../../shared/bsppredriverhook.c \
+ ../../shared/bsppost.c ../../shared/bsppretaskinghook.c \
+ ../../shared/bsppredriverhook.c \
startup/bspstart.c ../../shared/bootcard.c ../../shared/sbrk.c \
../../shared/gnatinstallhandler.c
pclock_SOURCES = ../shared/clock/p_clock.c
diff --git a/c/src/lib/libbsp/powerpc/psim/configure.ac b/c/src/lib/libbsp/powerpc/psim/configure.ac
index 79c1c5a5df..2398aeb12e 100644
--- a/c/src/lib/libbsp/powerpc/psim/configure.ac
+++ b/c/src/lib/libbsp/powerpc/psim/configure.ac
@@ -29,11 +29,7 @@ RTEMS_BSPOPTS_HELP([PPC_VECTOR_FILE_BASE],
[This defines the base address of the exception table.
NOTE: Vectors are actually at 0xFFF00000 but file starts at offset.])
-RTEMS_BSPOPTS_SET([BSP_DIRTY_MEMORY],[*],[0])
-RTEMS_BSPOPTS_HELP([BSP_DIRTY_MEMORY],
-[If defined, then PSIM will put a non-zero pattern into the RTEMS
- Workspace and C program heap. This should assist in finding
- code that assumes memory starts set to zero.])
+RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
# Explicitly list all Makefiles here
AC_CONFIG_FILES([Makefile])
diff --git a/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c b/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c
index be9f217223..77e5cd4c9f 100644
--- a/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c
@@ -4,7 +4,7 @@
* The generic CPU dependent initialization has been performed
* before any of these are invoked.
*
- * COPYRIGHT (c) 1989-2007.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -30,8 +30,6 @@
SPR_RW(SPRG0)
SPR_RW(SPRG1)
-extern unsigned long __rtems_end[];
-
void initialize_exceptions(void);
/* On psim, each click of the decrementer register corresponds
@@ -41,7 +39,6 @@ void initialize_exceptions(void);
* per cycle at 100 Mhz. Whether this is a good guess or not
* is anyone's guess.
*/
-
extern int PSIM_INSTRUCTIONS_PER_MICROSECOND;
/*
@@ -55,12 +52,6 @@ unsigned int BSP_bus_frequency;
unsigned int BSP_time_base_divisor;
/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_libc_init( void *, uint32_t, int );
-
-/*
* system init stack
*/
#define INIT_STACK_SIZE 0x1000
@@ -78,30 +69,19 @@ void _BSP_Fatal_error(unsigned int v)
}
/*
- * bsp_pretasking_hook
- *
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
+ * This method returns the base address and size of the area which
+ * is to be allocated between the RTEMS Workspace and the C Program
+ * Heap.
*/
-
-void bsp_pretasking_hook(void)
+void bsp_get_workarea(
+ void **workarea_base,
+ size_t *workarea_size,
+ size_t *requested_heap_size
+)
{
- extern int end;
- uint32_t heap_start;
- uint32_t heap_size;
-
- heap_start = (uint32_t) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- heap_size = Configuration.work_space_start - (void *)&end;
- heap_size &= 0xfffffff0; /* keep it as a multiple of 16 bytes */
-
- bsp_libc_init((void *) heap_start, heap_size, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
+ *workarea_base = &end;
+ *workarea_size = (void *)&RAM_END - (void *)&end;
+ *requested_heap_size = 0;
}
/*
@@ -112,7 +92,7 @@ void bsp_pretasking_hook(void)
void bsp_start( void )
{
- unsigned char *work_space_start;
+ extern unsigned long __rtems_end[];
register uint32_t intrStack;
register uint32_t *intrStackPtr;
@@ -134,23 +114,6 @@ void bsp_start( void )
bsp_exceptions_in_RAM = FALSE;
- rtems_configuration_get_work_space_size() += 1024;
-
- work_space_start =
- (unsigned char *)&RAM_END - rtems_configuration_get_work_space_size();
-
- if ( work_space_start <= (unsigned char *)&end ) {
- printk( "bspstart: Not enough RAM!!!\n" );
- bsp_cleanup();
- }
-
- Configuration.work_space_start = work_space_start;
- #if (BSP_DIRTY_MEMORY == 1)
- {
- memset(&end, 0xCF, (unsigned char *)&RAM_END - (unsigned char *)&end );
- }
- #endif
-
/*
* Initialize the interrupt related settings
* SPRG1 = software managed IRQ stack
@@ -196,5 +159,4 @@ void bsp_start( void )
_write_MSR(_read_MSR() | MSR_DR | MSR_IR);
asm volatile("sync; isync");
-
}
diff --git a/c/src/lib/libbsp/sparc/leon3/ChangeLog b/c/src/lib/libbsp/sparc/leon3/ChangeLog
index afdeda8d10..7eb52c2a07 100644
--- a/c/src/lib/libbsp/sparc/leon3/ChangeLog
+++ b/c/src/lib/libbsp/sparc/leon3/ChangeLog
@@ -1,3 +1,18 @@
+2008-05-15 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * Makefile.am, configure.ac, startup/bspstart.c: Add capability for
+ bootcard.c BSP Initialization Framework to ask the BSP where it has
+ memory for the RTEMS Workspace and C Program Heap. These collectively
+ are referred to as work area. If the BSP supports this, then it does
+ not have to include code to split the available memory between the
+ two areas. This reduces the amount of code in the BSP specific
+ bspstart.c file. Additionally, the shared framework can initialize
+ the C Library, call rtems_debug_enable(), and dirty the work area
+ memory. Until most/all BSPs support this new capability, if the BSP
+ supports this, it should call
+ RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION from its configure.ac. When
+ the transition is complete, this autoconf macro can be removed.
+
2008-05-12 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/bspstart.c: Refactored and renamed initialization routines to
diff --git a/c/src/lib/libbsp/sparc/leon3/Makefile.am b/c/src/lib/libbsp/sparc/leon3/Makefile.am
index a006684dff..3e74513d45 100644
--- a/c/src/lib/libbsp/sparc/leon3/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon3/Makefile.am
@@ -33,83 +33,54 @@ project_lib_DATA = start.$(OBJEXT)
dist_project_lib_DATA += startup/linkcmds
-noinst_PROGRAMS += startup.rel
-startup_rel_SOURCES = ../../sparc/shared/bspclean.c ../../shared/bsplibc.c \
+startup_SOURCES = ../../sparc/shared/bspclean.c ../../shared/bsplibc.c \
../../shared/bsppost.c startup/bspstart.c \
../../shared/bootcard.c ../../shared/sbrk.c startup/setvec.c \
startup/spurious.c startup/ithread.S
-startup_rel_CPPFLAGS = $(AM_CPPFLAGS)
-startup_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-noinst_PROGRAMS += gnatsupp.rel
-gnatsupp_rel_SOURCES = gnatsupp/gnatsupp.c ../../sparc/shared/gnatcommon.c
-gnatsupp_rel_CPPFLAGS = $(AM_CPPFLAGS)
-gnatsupp_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+gnatsupp_SOURCES = gnatsupp/gnatsupp.c ../../sparc/shared/gnatcommon.c
include_HEADERS += include/amba.h
include_HEADERS += ../../sparc/shared/include/ambapp.h
-noinst_PROGRAMS += amba.rel
-amba_rel_SOURCES = amba/amba.c ../../sparc/shared/amba/ambapp.c
-amba_rel_CPPFLAGS = $(AM_CPPFLAGS)
-amba_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
-noinst_PROGRAMS += console.rel
-console_rel_SOURCES = console/console.c
-console_rel_CPPFLAGS = $(AM_CPPFLAGS)
-console_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
-noinst_PROGRAMS += debugio.rel
-debugio_rel_SOURCES = console/debugputs.c
-debugio_rel_CPPFLAGS = $(AM_CPPFLAGS)
-debugio_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
-noinst_PROGRAMS += clock.rel
-clock_rel_SOURCES = clock/ckinit.c
-clock_rel_CPPFLAGS = $(AM_CPPFLAGS)
-clock_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+amba_SOURCES = amba/amba.c ../../sparc/shared/amba/ambapp.c
+console_SOURCES = console/console.c
+debugio_SOURCES = console/debugputs.c
+clock_SOURCES = clock/ckinit.c
# PCI
include_HEADERS += ../../sparc/shared/include/pci.h
-noinst_PROGRAMS += pci.rel
-pci_rel_SOURCES = pci/pci.c ../../sparc/shared/pci/pcifinddevice.c
-pci_rel_CPPFLAGS = $(AM_CPPFLAGS)
-pci_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+pci_SOURCES = pci/pci.c ../../sparc/shared/pci/pcifinddevice.c
# B1553BRM
-include_HEADERS += ../../sparc/shared/include/b1553brm.h ../../sparc/shared/include/b1553brm_pci.h
-noinst_PROGRAMS += brm.rel
-brm_rel_SOURCES = ../../sparc/shared/1553/b1553brm.c ../../sparc/shared/1553/b1553brm_pci.c
-brm_rel_CPPFLAGS = $(AM_CPPFLAGS)
-brm_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+include_HEADERS += ../../sparc/shared/include/b1553brm.h \
+ ../../sparc/shared/include/b1553brm_pci.h
+brm_SOURCES = ../../sparc/shared/1553/b1553brm.c \
+ ../../sparc/shared/1553/b1553brm_pci.c
# CAN
-include_HEADERS += ../../sparc/shared/include/occan.h ../../sparc/shared/include/occan_pci.h ../../sparc/shared/include/grcan.h
-noinst_PROGRAMS += can.rel
-can_rel_SOURCES = ../../sparc/shared/can/occan.c ../../sparc/shared/can/occan_pci.c ../../sparc/shared/can/grcan.c
-can_rel_CPPFLAGS = $(AM_CPPFLAGS)
-can_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+include_HEADERS += ../../sparc/shared/include/occan.h \
+ ../../sparc/shared/include/occan_pci.h ../../sparc/shared/include/grcan.h
+can_SOURCES = ../../sparc/shared/can/occan.c \
+ ../../sparc/shared/can/occan_pci.c ../../sparc/shared/can/grcan.c
# SpaceWire
-include_HEADERS += ../../sparc/shared/include/grspw.h ../../sparc/shared/include/grspw_pci.h
-noinst_PROGRAMS += spw.rel
-spw_rel_SOURCES = ../../sparc/shared/spw/grspw.c ../../sparc/shared/spw/grspw_pci.c
-spw_rel_CPPFLAGS = $(AM_CPPFLAGS)
-spw_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+include_HEADERS += ../../sparc/shared/include/grspw.h \
+ ../../sparc/shared/include/grspw_pci.h
+spw_SOURCES = ../../sparc/shared/spw/grspw.c \
+ ../../sparc/shared/spw/grspw_pci.c
# UART
-include_HEADERS += ../../sparc/shared/include/apbuart.h ../../sparc/shared/include/apbuart_pci.h
-noinst_PROGRAMS += uart.rel
-uart_rel_SOURCES = ../../sparc/shared/uart/apbuart.c ../../sparc/shared/uart/apbuart_pci.c
-uart_rel_CPPFLAGS = $(AM_CPPFLAGS)
-uart_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+include_HEADERS += ../../sparc/shared/include/apbuart.h \
+ ../../sparc/shared/include/apbuart_pci.h
+uart_SOURCES = ../../sparc/shared/uart/apbuart.c \
+ ../../sparc/shared/uart/apbuart_pci.c
# I2CMST
include_HEADERS += ../../sparc/shared/include/i2cmst.h
-noinst_PROGRAMS += i2cmst.rel
-i2cmst_rel_SOURCES = ../../sparc/shared/i2c/i2cmst.c
-i2cmst_rel_CPPFLAGS = $(AM_CPPFLAGS)
-i2cmst_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+i2cmst_SOURCES = ../../sparc/shared/i2c/i2cmst.c
+
+timer_SOURCES = timer/timer.c
if HAS_NETWORKING
noinst_PROGRAMS += leon_smc91111.rel
@@ -119,11 +90,6 @@ leon_smc91111_rel_CPPFLAGS += -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
leon_smc91111_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif
-noinst_PROGRAMS += timer.rel
-timer_rel_SOURCES = timer/timer.c
-timer_rel_CPPFLAGS = $(AM_CPPFLAGS)
-timer_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
-
if HAS_NETWORKING
noinst_PROGRAMS += leon_open_eth.rel
leon_open_eth_rel_SOURCES = leon_open_eth/leon_open_eth.c
@@ -140,33 +106,26 @@ leon_greth_rel_CPPFLAGS += -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
leon_greth_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif
-noinst_LIBRARIES = libbsp.a
-libbsp_a_SOURCES =
-libbsp_a_LIBADD = startup.rel amba.rel console.rel clock.rel debugio.rel \
- timer.rel gnatsupp.rel brm.rel can.rel spw.rel uart.rel pci.rel i2cmst.rel
-
-if HAS_NETWORKING
-libbsp_a_LIBADD += leon_open_eth.rel
-libbsp_a_LIBADD += leon_greth.rel
-libbsp_a_LIBADD += leon_smc91111.rel
-endif
-
if HAS_MP
EXTRA_DIST += shmsupp/README
-
-noinst_PROGRAMS += shmsupp.rel
-shmsupp_rel_SOURCES = shmsupp/addrconv.c shmsupp/getcfg.c shmsupp/lock.c \
+shmsupp_SOURCES = shmsupp/addrconv.c shmsupp/getcfg.c shmsupp/lock.c \
shmsupp/mpisr.c
-shmsupp_rel_CPPFLAGS = $(AM_CPPFLAGS)
-shmsupp_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif
-libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/cache.rel \
+noinst_LIBRARIES = libbsp.a
+libbsp_a_SOURCES = $(startup_SOURCES) $(gnatsupp_SOURCES) $(amba_SOURCES) \
+ $(console_SOURCES) $(debugio_SOURCES) $(clock_SOURCES) $(pci_SOURCES) \
+ $(brm_SOURCES) $(can_SOURCES) $(spw_SOURCES) $(uart_SOURCES) \
+ $(i2cmst_SOURCES) $(timer_SOURCES) $(shmsupp_SOURCES)
+
+libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/cache.rel \
../../../libcpu/@RTEMS_CPU@/reg_win.rel \
../../../libcpu/@RTEMS_CPU@/syscall.rel
-if HAS_MP
-libbsp_a_LIBADD += shmsupp.rel
+if HAS_NETWORKING
+libbsp_a_LIBADD += leon_open_eth.rel
+libbsp_a_LIBADD += leon_greth.rel
+libbsp_a_LIBADD += leon_smc91111.rel
endif
EXTRA_DIST += times
diff --git a/c/src/lib/libbsp/sparc/leon3/configure.ac b/c/src/lib/libbsp/sparc/leon3/configure.ac
index a65de6a0c9..4c94124548 100644
--- a/c/src/lib/libbsp/sparc/leon3/configure.ac
+++ b/c/src/lib/libbsp/sparc/leon3/configure.ac
@@ -37,6 +37,8 @@ RTEMS_BSPOPTS_HELP([SIMSPARC_FAST_IDLE],
time spent in the idle task is minimized. This significantly reduces
the wall time required to execute the RTEMS test suites.])
+RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
+
# Explicitly list all Makefiles here
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c b/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c
index 92ec5affc4..c411c9b3c7 100644
--- a/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c
+++ b/c/src/lib/libbsp/sparc/leon3/startup/bspstart.c
@@ -36,9 +36,6 @@ extern uint32_t rdb_start;
*/
int CPU_SPARC_HAS_SNOOPING;
-void bsp_libc_init( void *, uint32_t, int );
-extern void bsp_spurious_initialize();
-
/*
* set_snooping
*
@@ -50,62 +47,55 @@ extern void bsp_spurious_initialize();
static inline int set_snooping(void)
{
- int tmp;
- asm(" lda [%1] 2, %0 "
- : "=r"(tmp)
- : "r"(0xC)
- );
- return (tmp >> 27) & 1;
+ int tmp;
+ asm(" lda [%1] 2, %0 "
+ : "=r"(tmp)
+ : "r"(0xC)
+ );
+ return (tmp >> 27) & 1;
}
/*
* bsp_pretasking_hook
*
* BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
+ * Used to setup libc and install any BSP extensions .
*/
void bsp_pretasking_hook(void)
{
- extern int end;
- uint32_t heap_start;
- uint32_t heap_size;
-
- heap_start = (uint32_t) &end;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- heap_size = Configuration.work_space_start - (void *)&end - STACK_SIZE;
- heap_size &= 0xfffffff0; /* keep it as a multiple of 16 bytes */
-
- bsp_libc_init((void *) heap_start, heap_size, 0);
-
-#ifdef RTEMS_DEBUG
- rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
-#endif
+ extern void bsp_spurious_initialize();
bsp_spurious_initialize();
}
/*
+ * This method returns the base address and size of the area which
+ * is to be allocated between the RTEMS Workspace and the C Program
+ * Heap.
+ */
+void bsp_get_workarea(
+ void **workarea_base,
+ size_t *workarea_size,
+ size_t *requested_heap_size
+)
+{
+ /* Tells us where to put the workspace in case remote debugger is present. */
+ extern uint32_t rdb_start;
+ /* must be identical to STACK_SIZE in start.S */
+ #define STACK_SIZE (16 * 1024)
+
+ *workarea_base = &end;
+ *workarea_size = (void *)rdb_start - (void *)&end - STACK_SIZE;
+ *requested_heap_size = 0;
+}
+
+/*
* bsp_start
*
* This routine does the bulk of the system initialization.
*/
-
void bsp_start( void )
{
- unsigned char *work_space_start;
-
- work_space_start =
- (unsigned char *)rdb_start - rtems_configuration_get_work_space_size();
-
- if ( work_space_start <= (unsigned char *)&end ) {
- printk( "bspstart: Not enough RAM!!!\n" );
- BSP_fatal_return();
- }
-
- Configuration.work_space_start = work_space_start;
-
CPU_SPARC_HAS_SNOOPING = set_snooping();
}