forked from Imagelibrary/rtems
2002-03-28 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* tbr/Makefile.am: New file. * tbr/.cvsignore: New file. * tbr/tbr.c: New file. * tbr/tbr.h: New file. * configure.ac: Add tbr subdir. * Makefile.am: Add tbr subdir.
This commit is contained in:
@@ -1,3 +1,12 @@
|
|||||||
|
2002-03-28 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||||
|
|
||||||
|
* tbr/Makefile.am: New file.
|
||||||
|
* tbr/.cvsignore: New file.
|
||||||
|
* tbr/tbr.c: New file.
|
||||||
|
* tbr/tbr.h: New file.
|
||||||
|
* configure.ac: Add tbr subdir.
|
||||||
|
* Makefile.am: Add tbr subdir.
|
||||||
|
|
||||||
2002-03-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
2002-03-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||||
|
|
||||||
* configure.ac:
|
* configure.ac:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I ../../../../../aclocal
|
ACLOCAL_AMFLAGS = -I ../../../../../aclocal
|
||||||
|
|
||||||
SUBDIRS = include cache reg_win syscall
|
SUBDIRS = include cache reg_win syscall tbr
|
||||||
|
|
||||||
include $(top_srcdir)/../../../../../automake/subdirs.am
|
include $(top_srcdir)/../../../../../automake/subdirs.am
|
||||||
include $(top_srcdir)/../../../../../automake/local.am
|
include $(top_srcdir)/../../../../../automake/local.am
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ AC_CONFIG_FILES([Makefile
|
|||||||
cache/Makefile
|
cache/Makefile
|
||||||
include/Makefile
|
include/Makefile
|
||||||
reg_win/Makefile
|
reg_win/Makefile
|
||||||
syscall/Makefile])
|
syscall/Makefile
|
||||||
|
tbr/Makefile])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
|
|||||||
2
c/src/lib/libcpu/sparc/tbr/.cvsignore
Normal file
2
c/src/lib/libcpu/sparc/tbr/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
31
c/src/lib/libcpu/sparc/tbr/Makefile.am
Normal file
31
c/src/lib/libcpu/sparc/tbr/Makefile.am
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
##
|
||||||
|
## $Id$
|
||||||
|
##
|
||||||
|
|
||||||
|
C_FILES = tbr.c
|
||||||
|
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
|
||||||
|
|
||||||
|
include_libcpudir = $(includedir)/libcpu
|
||||||
|
|
||||||
|
include_libcpu_HEADERS = tbr.h
|
||||||
|
|
||||||
|
OBJS = $(C_O_FILES)
|
||||||
|
|
||||||
|
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
|
||||||
|
include $(top_srcdir)/../../../../../automake/compile.am
|
||||||
|
include $(top_srcdir)/../../../../../automake/lib.am
|
||||||
|
|
||||||
|
$(PROJECT_INCLUDE)/libcpu:
|
||||||
|
$(mkinstalldirs) $@
|
||||||
|
|
||||||
|
$(PROJECT_INCLUDE)/libcpu/%.h: %.h
|
||||||
|
$(INSTALL_DATA) $< $@
|
||||||
|
|
||||||
|
PREINSTALL_FILES = $(PROJECT_INCLUDE)/libcpu \
|
||||||
|
$(include_libcpu_HEADERS:%=$(PROJECT_INCLUDE)/libcpu/%)
|
||||||
|
|
||||||
|
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS)
|
||||||
|
|
||||||
|
EXTRA_DIST = tbr.c
|
||||||
|
|
||||||
|
include $(top_srcdir)/../../../../../automake/local.am
|
||||||
50
c/src/lib/libcpu/sparc/tbr/tbr.c
Normal file
50
c/src/lib/libcpu/sparc/tbr/tbr.c
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
* SPARC Dependent Source
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1999.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <libcpu/tbr.h>
|
||||||
|
|
||||||
|
void
|
||||||
|
sparc_init_tbr ()
|
||||||
|
{
|
||||||
|
#ifndef NO_TABLE_MOVE
|
||||||
|
unsigned32 trap_table_start;
|
||||||
|
unsigned32 tbr_value;
|
||||||
|
CPU_Trap_table_entry *old_tbr;
|
||||||
|
CPU_Trap_table_entry *trap_table;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Install the executive's trap table. All entries from the original
|
||||||
|
* trap table are copied into the executive's trap table. This is essential
|
||||||
|
* since this preserves critical trap handlers such as the window underflow
|
||||||
|
* and overflow handlers. It is the responsibility of the BSP to provide
|
||||||
|
* install these in the initial trap table.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
trap_table_start = (unsigned32) & _CPU_Trap_Table_area;
|
||||||
|
if (trap_table_start & (SPARC_TRAP_TABLE_ALIGNMENT - 1))
|
||||||
|
trap_table_start = (trap_table_start + SPARC_TRAP_TABLE_ALIGNMENT) &
|
||||||
|
~(SPARC_TRAP_TABLE_ALIGNMENT - 1);
|
||||||
|
|
||||||
|
trap_table = (CPU_Trap_table_entry *) trap_table_start;
|
||||||
|
|
||||||
|
sparc_get_tbr (tbr_value);
|
||||||
|
|
||||||
|
old_tbr = (CPU_Trap_table_entry *) (tbr_value & 0xfffff000);
|
||||||
|
|
||||||
|
memcpy (trap_table, (void *) old_tbr, 256 * sizeof (CPU_Trap_table_entry));
|
||||||
|
|
||||||
|
sparc_set_tbr (trap_table_start);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
40
c/src/lib/libcpu/sparc/tbr/tbr.h
Normal file
40
c/src/lib/libcpu/sparc/tbr/tbr.h
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* SPARC Dependent Source
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1999.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This is the executive's trap table which is installed into the TBR
|
||||||
|
* register.
|
||||||
|
*
|
||||||
|
* NOTE: Unfortunately, this must be aligned on a 4096 byte boundary.
|
||||||
|
* The GNU tools as of binutils 2.5.2 and gcc 2.7.0 would not
|
||||||
|
* align an entity to anything greater than a 512 byte boundary.
|
||||||
|
*
|
||||||
|
* Because of this, we pull a little bit of a trick. We allocate
|
||||||
|
* enough memory so we can grab an address on a 4096 byte boundary
|
||||||
|
* from this area.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _libcpu_tbr_h
|
||||||
|
#define _libcpu_tbr_h
|
||||||
|
|
||||||
|
#include <bsp.h>
|
||||||
|
|
||||||
|
#ifndef NO_TABLE_MOVE
|
||||||
|
|
||||||
|
#define SPARC_TRAP_TABLE_ALIGNMENT 4096
|
||||||
|
|
||||||
|
SCORE_EXTERN unsigned8 _CPU_Trap_Table_area[8192]
|
||||||
|
__attribute__ ((aligned (SPARC_TRAP_TABLE_ALIGNMENT)));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user