forked from Imagelibrary/rtems
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:
@@ -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>
|
2001-05-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||||
|
|
||||||
* scitab/.cvsignore: Add.
|
* scitab/.cvsignore: Add.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ RTEMS_CANONICAL_TARGET_CPU
|
|||||||
AM_INIT_AUTOMAKE(rtems-c-src-lib-libbsp-sh-shsim,$RTEMS_VERSION,no)
|
AM_INIT_AUTOMAKE(rtems-c-src-lib-libbsp-sh-shsim,$RTEMS_VERSION,no)
|
||||||
AM_MAINTAINER_MODE
|
AM_MAINTAINER_MODE
|
||||||
|
|
||||||
RTEMS_PROG_CC_FOR_TARGET
|
RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm])
|
||||||
RTEMS_CANONICALIZE_TOOLS
|
RTEMS_CANONICALIZE_TOOLS
|
||||||
|
|
||||||
RTEMS_ENV_RTEMSBSP
|
RTEMS_ENV_RTEMSBSP
|
||||||
@@ -60,17 +60,18 @@ AC_DEFINE_UNQUOTED(
|
|||||||
[whether support for functional IOMEM in shsim/gdb shall be enabled])
|
[whether support for functional IOMEM in shsim/gdb shall be enabled])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## setup environment variable
|
## bsp-specific options
|
||||||
CPU_CLOCK_RATE_HZ=${CPU_CLOCK_RATE_HZ-20000000}
|
CPU_CLOCK_RATE_HZ=${CPU_CLOCK_RATE_HZ-20000000}
|
||||||
AC_SUBST(CPU_CLOCK_RATE_HZ)
|
AC_SUBST(CPU_CLOCK_RATE_HZ)
|
||||||
## Propagate option to config header
|
|
||||||
AC_DEFINE_UNQUOTED(
|
AC_DEFINE_UNQUOTED(
|
||||||
[CPU_CLOCK_RATE_HZ],
|
[CPU_CLOCK_RATE_HZ],
|
||||||
[$CPU_CLOCK_RATE_HZ],
|
[$CPU_CLOCK_RATE_HZ],
|
||||||
[cpu clock rate in 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
|
RTEMS_PROJECT_ROOT
|
||||||
|
|
||||||
# Explicitly list all Makefiles here
|
# Explicitly list all Makefiles here
|
||||||
|
|||||||
@@ -4,29 +4,22 @@
|
|||||||
|
|
||||||
AUTOMAKE_OPTIONS = foreign 1.4
|
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):
|
$(PROJECT_INCLUDE):
|
||||||
$(mkinstalldirs) $@
|
$(mkinstalldirs) $@
|
||||||
|
|
||||||
$(PROJECT_INCLUDE)/bsp.h: bsp.h
|
$(PROJECT_INCLUDE)/%.h: %.h
|
||||||
$(INSTALL_DATA) $< $@
|
$(INSTALL_DATA) $< $@
|
||||||
|
|
||||||
$(PROJECT_INCLUDE)/bspopts.h: bspopts.h
|
PREINSTALL_FILES += $(PROJECT_INCLUDE) \
|
||||||
$(INSTALL_DATA) $< $@
|
$(include_HEADERS:%=$(PROJECT_INCLUDE)/%)
|
||||||
|
|
||||||
$(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
|
|
||||||
|
|
||||||
all-local: $(TMPINSTALL_FILES)
|
all-local: $(TMPINSTALL_FILES)
|
||||||
|
|
||||||
EXTRA_DIST = bsp.h
|
|
||||||
|
|
||||||
include $(top_srcdir)/../../../../../../automake/local.am
|
include $(top_srcdir)/../../../../../../automake/local.am
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
|
|
||||||
AUTOMAKE_OPTIONS = foreign 1.4
|
AUTOMAKE_OPTIONS = foreign 1.4
|
||||||
|
|
||||||
VPATH = @srcdir@:@srcdir@/../../../shared
|
VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
|
||||||
|
|
||||||
PGM = $(ARCH)/startup.rel
|
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
|
gnatinstallhandler.c
|
||||||
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
|
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
|
||||||
|
|
||||||
@@ -35,6 +35,6 @@ all-local: $(ARCH) $(OBJS) $(PGM) $(TMPINSTALL_FILES)
|
|||||||
|
|
||||||
.PRECIOUS: $(PGM)
|
.PRECIOUS: $(PGM)
|
||||||
|
|
||||||
EXTRA_DIST = bspclean.c bspstart.c exit.c linkcmds setvec.c
|
EXTRA_DIST = bspstart.c linkcmds
|
||||||
|
|
||||||
include $(top_srcdir)/../../../../../../automake/local.am
|
include $(top_srcdir)/../../../../../../automake/local.am
|
||||||
|
|||||||
@@ -4,7 +4,14 @@
|
|||||||
* The generic CPU dependent initialization has been performed
|
* The generic CPU dependent initialization has been performed
|
||||||
* before this routine is invoked.
|
* 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).
|
* On-Line Applications Research Corporation (OAR).
|
||||||
*
|
*
|
||||||
* The license and distribution terms for this file may be
|
* 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
|
* Function: bsp_pretasking_hook
|
||||||
* Created: 95/03/10
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* BSP pretasking hook. Called just before drivers are initialized.
|
* BSP pretasking hook. Called just before drivers are initialized.
|
||||||
@@ -56,20 +62,13 @@ void bsp_libc_init( void *, unsigned32, int );
|
|||||||
|
|
||||||
void bsp_pretasking_hook(void)
|
void bsp_pretasking_hook(void)
|
||||||
{
|
{
|
||||||
extern int HeapBase;
|
bsp_libc_init(&HeapStart, sizeof(unsigned32) * (&HeapEnd - &HeapStart), 0);
|
||||||
extern int HeapSize;
|
|
||||||
void *heapStart = &HeapBase;
|
|
||||||
unsigned long heapSize = (unsigned long)&HeapSize;
|
|
||||||
unsigned long ramSpace;
|
|
||||||
|
|
||||||
bsp_libc_init(heapStart, (unsigned32) heapSize, 0);
|
|
||||||
|
|
||||||
#ifdef RTEMS_DEBUG
|
#ifdef RTEMS_DEBUG
|
||||||
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
|
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* bsp_start
|
* bsp_start
|
||||||
*
|
*
|
||||||
@@ -78,40 +77,52 @@ void bsp_pretasking_hook(void)
|
|||||||
|
|
||||||
void bsp_start( void )
|
void bsp_start( void )
|
||||||
{
|
{
|
||||||
extern int _end;
|
/*
|
||||||
extern int WorkspaceBase;
|
For real boards you need to setup the hardware
|
||||||
/* Configure Number of Register Caches */
|
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.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
|
||||||
Cpu_table.postdriver_hook = bsp_postdriver_hook;
|
Cpu_table.postdriver_hook = bsp_postdriver_hook;
|
||||||
Cpu_table.interrupt_stack_size = 4096;
|
|
||||||
|
#if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE )
|
||||||
if ( BSP_Configuration.work_space_size >(512*1024) )
|
Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY;
|
||||||
_sys_exit( 1 );
|
#endif
|
||||||
|
Cpu_table.clicks_per_second = CPU_CLOCK_RATE_HZ ;
|
||||||
BSP_Configuration.work_space_start = (void *) &WorkspaceBase;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 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 */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user