2001-05-10 Ralf Corsepius <corsepiu@faw.uni-ulm.de>

* configure.in: Use RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]), adapt
        bspopts.h handling to other sh-BSPs.
        * include/.cvsignore: Add stamp-h*, bspopts.h*.
        * include/Makefile.am: Use include_HEADERS instead of H_FILES.
        * startup/bspstart.c: Reworked, based on the amos BSP.
This commit is contained in:
Joel Sherrill
2001-05-11 16:51:25 +00:00
parent 5dbd4fed5a
commit f86582c814
5 changed files with 81 additions and 68 deletions

View File

@@ -1,3 +1,11 @@
2001-05-10 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.in: Use RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]), adapt
bspopts.h handling to other sh-BSPs.
* include/.cvsignore: Add stamp-h*, bspopts.h*.
* include/Makefile.am: Use include_HEADERS instead of H_FILES.
* startup/bspstart.c: Reworked, based on the amos BSP.
2001-05-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* scitab/.cvsignore: Add.

View File

@@ -11,7 +11,7 @@ RTEMS_CANONICAL_TARGET_CPU
AM_INIT_AUTOMAKE(rtems-c-src-lib-libbsp-sh-shsim,$RTEMS_VERSION,no)
AM_MAINTAINER_MODE
RTEMS_PROG_CC_FOR_TARGET
RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm])
RTEMS_CANONICALIZE_TOOLS
RTEMS_ENV_RTEMSBSP
@@ -60,17 +60,18 @@ AC_DEFINE_UNQUOTED(
[whether support for functional IOMEM in shsim/gdb shall be enabled])
fi
## setup environment variable
## bsp-specific options
CPU_CLOCK_RATE_HZ=${CPU_CLOCK_RATE_HZ-20000000}
AC_SUBST(CPU_CLOCK_RATE_HZ)
## Propagate option to config header
AC_DEFINE_UNQUOTED(
[CPU_CLOCK_RATE_HZ],
[$CPU_CLOCK_RATE_HZ],
[cpu clock rate in HZ])
AM_CONFIG_HEADER(include/bspopts.h)
## Used in scitab/Makefile.am
AC_SUBST(CPU_CLOCK_RATE_HZ)
AM_CONFIG_HEADER(include/bspopts.h)
RTEMS_PROJECT_ROOT
# Explicitly list all Makefiles here

View File

@@ -4,29 +4,22 @@
AUTOMAKE_OPTIONS = foreign 1.4
H_FILES = bsp.h gdbsci.h ../../../shared/include/coverhd.h
include_HEADERS = bsp.h gdbsci.h coverhd.h bspopts.h
coverhd.h: $(top_srcdir)/../../shared/include/coverhd.h
cp $< $@
CLEANFILES += coverhd.h
$(PROJECT_INCLUDE):
$(mkinstalldirs) $@
$(PROJECT_INCLUDE)/bsp.h: bsp.h
$(PROJECT_INCLUDE)/%.h: %.h
$(INSTALL_DATA) $< $@
$(PROJECT_INCLUDE)/bspopts.h: bspopts.h
$(INSTALL_DATA) $< $@
$(PROJECT_INCLUDE)/sh/gdbsci.h: gdbsci.h
$(INSTALL_DATA) $< $@
$(PROJECT_INCLUDE)/coverhd.h: ../../../shared/include/coverhd.h
$(INSTALL_DATA) $< $@
TMPINSTALL_FILES += $(PROJECT_INCLUDE) $(PROJECT_INCLUDE)/bsp.h \
$(PROJECT_INCLUDE)/coverhd.h $(PROJECT_INCLUDE)/sh/gdbsci.h \
$(PROJECT_INCLUDE)/bspopts.h
PREINSTALL_FILES += $(PROJECT_INCLUDE) \
$(include_HEADERS:%=$(PROJECT_INCLUDE)/%)
all-local: $(TMPINSTALL_FILES)
EXTRA_DIST = bsp.h
include $(top_srcdir)/../../../../../../automake/local.am

View File

@@ -4,11 +4,11 @@
AUTOMAKE_OPTIONS = foreign 1.4
VPATH = @srcdir@:@srcdir@/../../../shared
VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
PGM = $(ARCH)/startup.rel
C_FILES = bspclean.c bsplibc.c bsppost.c bspstart.c bootcard.c main.c sbrk.c \
C_FILES = bsplibc.c bsppost.c bspstart.c bspclean.c sbrk.c bootcard.c main.c \
gnatinstallhandler.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
@@ -35,6 +35,6 @@ all-local: $(ARCH) $(OBJS) $(PGM) $(TMPINSTALL_FILES)
.PRECIOUS: $(PGM)
EXTRA_DIST = bspclean.c bspstart.c exit.c linkcmds setvec.c
EXTRA_DIST = bspstart.c linkcmds
include $(top_srcdir)/../../../../../../automake/local.am

View File

@@ -4,7 +4,14 @@
* The generic CPU dependent initialization has been performed
* before this routine is invoked.
*
* COPYRIGHT (c) 1989-2000.
* COPYRIGHT (c) 2001.
* Ralf Corsepius (corsepiu@faw.uni-ulm.de).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* COPYRIGHT (c) 2001.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -42,7 +49,6 @@ 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.
@@ -56,18 +62,11 @@ void bsp_libc_init( void *, unsigned32, int );
void bsp_pretasking_hook(void)
{
extern int HeapBase;
extern int HeapSize;
void *heapStart = &HeapBase;
unsigned long heapSize = (unsigned long)&HeapSize;
unsigned long ramSpace;
bsp_libc_init(heapStart, (unsigned32) heapSize, 0);
bsp_libc_init(&HeapStart, sizeof(unsigned32) * (&HeapEnd - &HeapStart), 0);
#ifdef RTEMS_DEBUG
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
#endif
}
/*
@@ -78,40 +77,52 @@ void bsp_pretasking_hook(void)
void bsp_start( void )
{
extern int _end;
extern int WorkspaceBase;
/* Configure Number of Register Caches */
/*
For real boards you need to setup the hardware
and need to copy the vector table from rom to ram.
Depending on the board this can either be done from inside the rom
startup code, rtems startup code or here.
*/
/*
* 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.
*/
/*
* Need to "allocate" the memory for the RTEMS Workspace and
* tell the RTEMS configuration where it is. This memory is
* not malloc'ed. It is just "pulled from the air".
*/
BSP_Configuration.work_space_start = (void *) &WorkSpaceStart ;
BSP_Configuration.work_space_size =
(unsigned32) &WorkSpaceEnd -
(unsigned32) &WorkSpaceStart ;
/*
* initialize the CPU table for this BSP
*/
#if ( CPU_ALLOCATE_INTERRUPT_STACK == FALSE )
_CPU_Interrupt_stack_low = &CPU_Interrupt_stack_low ;
_CPU_Interrupt_stack_high = &CPU_Interrupt_stack_high ;
Cpu_table.interrupt_stack_size =
(unsigned32) (&CPU_Interrupt_stack_high) -
(unsigned32) (&CPU_Interrupt_stack_low) ;
#endif
Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
Cpu_table.postdriver_hook = bsp_postdriver_hook;
Cpu_table.interrupt_stack_size = 4096;
if ( BSP_Configuration.work_space_size >(512*1024) )
_sys_exit( 1 );
BSP_Configuration.work_space_start = (void *) &WorkspaceBase;
#if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE )
Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY;
#endif
Cpu_table.clicks_per_second = CPU_CLOCK_RATE_HZ ;
}
/* XXX */
void clear_cache( void *address, size_t n )
{
}
/* Structure filled in by get_mem_info. Only the size field is
actually used (to clear bss), so the others aren't even filled in. */
struct s_mem
{
unsigned int size;
unsigned int icsize;
unsigned int dcsize;
};
void
get_mem_info (mem)
struct s_mem *mem;
{
mem->size = 0x1000000; /* XXX figure out something here */
}