OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/trunk/rtos/rtems/c/src/lib/libbsp/sh
    from Rev 30 to Rev 173
    Reverse comparison

Rev 30 → Rev 173

/gensh1/bsp_specs
0,0 → 1,22
%rename cpp old_cpp
%rename lib old_lib
%rename endfile old_endfile
%rename startfile old_startfile
%rename link old_link
 
*cpp:
%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
 
*lib:
%{!qrtems: %(old_lib)} \
%{qrtems: --start-group %{!qrtems_debug: -lrtemsall } %{qrtems_debug: -lrtemsall_g} \
-lc -lgcc --end-group \
%{!qnolinkcmds: -T linkcmds%s}}
 
*startfile:
%{!qrtems: %(old_startfile)} \
%{qrtems: %{qrtems_debug: start_g.o%s} %{!qrtems_debug: start.o%s}}
 
*link:
%(old_link) %{qrtems: -dc -dp -N -e _start}
 
/gensh1/times
0,0 → 1,195
#
# Timing Test Suite Results for the generic sh1
#
# NOTE: Due to memory shortage the timing test suite could not yet be run.
#
# Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
#
# $Id: times,v 1.2 2001-09-27 12:01:10 chris Exp $
#
 
Board: Diesner OktagonSH/AMOS-2.1
CPU: Hitachi SH 7032
Clock Speed: 20MHz
Memory Configuration: 8k on-chip ram, 256k external RAM in Area 4
Wait States:
 
Times Reported in: cycles, microseconds, etc
Timer Source: Count Down Timer, on-CPU cycle counter, etc
 
Column A:
Column B:
 
# DESCRIPTION A B
== ================================================================= ==== ====
1 rtems_semaphore_create X
rtems_semaphore_delete X
rtems_semaphore_obtain: available X
rtems_semaphore_obtain: not available -- NO_WAIT X
rtems_semaphore_release: no waiting tasks X
 
2 rtems_semaphore_obtain: not available -- caller blocks X
 
3 rtems_semaphore_release: task readied -- preempts caller X
 
4 rtems_task_restart: blocked task -- preempts caller X
rtems_task_restart: ready task -- preempts caller X
rtems_semaphore_release: task readied -- returns to caller X
rtems_task_create X
rtems_task_start X
rtems_task_restart: suspended task -- returns to caller X
rtems_task_delete: suspended task X
rtems_task_restart: ready task -- returns to caller X
rtems_task_restart: blocked task -- returns to caller X
rtems_task_delete: blocked task X
 
5 rtems_task_suspend: calling task X
rtems_task_resume: task readied -- preempts caller X
 
6 rtems_task_restart: calling task X
rtems_task_suspend: returns to caller X
rtems_task_resume: task readied -- returns to caller X
rtems_task_delete: ready task X
 
7 rtems_task_restart: suspended task -- preempts caller X
 
8 rtems_task_set_priority: obtain current priority X
rtems_task_set_priority: returns to caller X
rtems_task_mode: obtain current mode X
rtems_task_mode: no reschedule X
rtems_task_mode: reschedule -- returns to caller X
rtems_task_mode: reschedule -- preempts caller X
rtems_task_set_note X
rtems_task_get_note X
rtems_clock_set X
rtems_clock_get X
 
9 rtems_message_queue_create X
rtems_message_queue_send: no waiting tasks X
rtems_message_queue_urgent: no waiting tasks X
rtems_message_queue_receive: available X
rtems_message_queue_flush: no messages flushed X
rtems_message_queue_flush: messages flushed X
rtems_message_queue_delete X
 
10 rtems_message_queue_receive: not available -- NO_WAIT X
rtems_message_queue_receive: not available -- caller blocks X
 
11 rtems_message_queue_send: task readied -- preempts caller X
 
12 rtems_message_queue_send: task readied -- returns to caller X
 
13 rtems_message_queue_urgent: task readied -- preempts caller X
 
14 rtems_message_queue_urgent: task readied -- returns to caller X
 
15 rtems_event_receive: obtain current events X
rtems_event_receive: not available -- NO_WAIT X
rtems_event_receive: not available -- caller blocks X
rtems_event_send: no task readied X
rtems_event_receive: available X
rtems_event_send: task readied -- returns to caller X
 
16 rtems_event_send: task readied -- preempts caller X
 
17 rtems_task_set_priority: preempts caller X
 
18 rtems_task_delete: calling task X
 
19 rtems_signal_catch X
rtems_signal_send: returns to caller X
rtems_signal_send: signal to self X
exit ASR overhead: returns to calling task X
exit ASR overhead: returns to preempting task X
 
20 rtems_partition_create X
rtems_region_create X
rtems_partition_get_buffer: available X
rtems_partition_get_buffer: not available X
rtems_partition_return_buffer X
rtems_partition_delete X
rtems_region_get_segment: available X
rtems_region_get_segment: not available -- NO_WAIT X
rtems_region_return_segment: no waiting tasks X
rtems_region_get_segment: not available -- caller blocks X
rtems_region_return_segment: task readied -- preempts caller X
rtems_region_return_segment: task readied -- returns to caller X
rtems_region_delete X
rtems_io_initialize X
rtems_io_open X
rtems_io_close X
rtems_io_read X
rtems_io_write X
rtems_io_control X
 
21 rtems_task_ident X
rtems_message_queue_ident X
rtems_semaphore_ident X
rtems_partition_ident X
rtems_region_ident X
rtems_port_ident X
rtems_timer_ident X
rtems_rate_monotonic_ident X
 
22 rtems_message_queue_broadcast: task readied -- returns to caller X
rtems_message_queue_broadcast: no waiting tasks X
rtems_message_queue_broadcast: task readied -- preempts caller X
 
23 rtems_timer_create X
rtems_timer_fire_after: inactive X
rtems_timer_fire_after: active X
rtems_timer_cancel: active X
rtems_timer_cancel: inactive X
rtems_timer_reset: inactive X
rtems_timer_reset: active X
rtems_timer_fire_when: inactive X
rtems_timer_fire_when: active X
rtems_timer_delete: active X
rtems_timer_delete: inactive X
rtems_task_wake_when X
 
24 rtems_task_wake_after: yield -- returns to caller X
rtems_task_wake_after: yields -- preempts caller X
 
25 rtems_clock_tick X
 
26 _ISR_Disable X
_ISR_Flash X
_ISR_Enable X
_Thread_Disable_dispatch X
_Thread_Enable_dispatch X
_Thread_Set_state X
_Thread_Disptach (NO FP) X
context switch: no floating point contexts X
context switch: self X
context switch: to another task X
context switch: restore 1st FP task X
fp context switch: save idle, restore idle X
fp context switch: save idle, restore initialized X
fp context switch: save initialized, restore initialized X
_Thread_Resume X
_Thread_Unblock X
_Thread_Ready X
_Thread_Get X
_Semaphore_Get X
_Thread_Get: invalid id X
 
27 interrupt entry overhead: returns to interrupted task X
interrupt exit overhead: returns to interrupted task X
interrupt entry overhead: returns to nested interrupt X
interrupt exit overhead: returns to nested interrupt X
interrupt entry overhead: returns to preempting task X
interrupt exit overhead: returns to preempting task X
 
28 rtems_port_create X
rtems_port_external_to_internal X
rtems_port_internal_to_external X
rtems_port_delete X
 
29 rtems_rate_monotonic_create X
rtems_rate_monotonic_period: initiate period -- returns to caller X
rtems_rate_monotonic_period: obtain status X
rtems_rate_monotonic_cancel X
rtems_rate_monotonic_delete: inactive X
rtems_rate_monotonic_delete: active X
rtems_rate_monotonic_period: conclude periods -- caller blocks X
/gensh1/console/Makefile.am
0,0 → 1,33
##
## $Id: Makefile.am,v 1.2 2001-09-27 12:01:10 chris Exp $
##
 
AUTOMAKE_OPTIONS = foreign 1.4
 
VPATH = @srcdir@:@srcdir@/../../shared
 
PGM = $(ARCH)/console.rel
 
C_FILES = console.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
 
OBJS = $(C_O_FILES)
 
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../../../../../../automake/lib.am
 
#
# (OPTIONAL) Add local stuff here using +=
#
 
$(PGM): $(OBJS)
$(make-rel)
 
# the .rel file built here will be put into libbsp.a by
# ../wrapup/Makefile
 
all-local: $(ARCH) $(OBJS) $(PGM)
 
.PRECIOUS: $(PGM)
 
include $(top_srcdir)/../../../../../../automake/local.am
/gensh1/startup/bspstart.c
0,0 → 1,133
/*
* This routine starts the application. It includes application,
* board, and monitor specific initialization and configuration.
* The generic CPU dependent initialization has been performed
* before this routine is invoked.
*
* Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
* Bernd Becker (becker@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
*
* 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) 1998.
* On-Line Applications Research Corporation (OAR).
* Copyright assigned to U.S. Government, 1994.
*
* 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: bspstart.c,v 1.2 2001-09-27 12:01:11 chris Exp $
*/
 
#include <bsp.h>
#include <rtems/libio.h>
#include <libcsupport.h>
#include <string.h>
/*
* The original table from the application and our copy of it with
* some changes.
*/
 
extern rtems_configuration_table Configuration;
 
rtems_configuration_table BSP_Configuration;
 
rtems_cpu_table Cpu_table;
 
char *rtems_progname;
 
/*
* Use the shared implementations of the following routines
*/
void bsp_postdriver_hook(void);
void bsp_libc_init( void *, unsigned32, int );
 
/*
* Function: bsp_pretasking_hook
*
* 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)
{
bsp_libc_init(&HeapStart, sizeof(unsigned32) * (&HeapEnd - &HeapStart), 0);
#ifdef RTEMS_DEBUG
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
#endif
}
 
/*
* bsp_start
*
* This routine does the bulk of the system initialization.
*/
 
void bsp_start(void)
{
/*
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;
#if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE )
Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY;
#endif
Cpu_table.clicks_per_second = HZ ;
}
/gensh1/startup/linkcmds
0,0 → 1,203
/*
* This is an adapted linker script from egcs-1.0.1
*
* Memory layout for an SH 7032 with main memory in area 2
* This memory layout it very similar to that used for Hitachi's
* EVB with CMON in rom
*
* NOTE: The ram start address may vary, all other start addresses are fixed
* Not suiteable for gdb's simulator
*
* Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
* Bernd Becker (becker@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
*
* 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) 1998.
* On-Line Applications Research Corporation (OAR).
* Copyright assigned to U.S. Government, 1994.
*
* 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: linkcmds,v 1.2 2001-09-27 12:01:11 chris Exp $
*/
 
OUTPUT_FORMAT("coff-sh")
OUTPUT_ARCH(sh)
ENTRY(_start)
 
MEMORY
{
rom : o = 0x00000000, l = 128k
onchip_peri : o = 0x05000000, l = 512
ram : o = 0x0A040000, l = 256k
 
onchip_ram : o = 0x0f000000, l = 8k
}
 
SECTIONS
{
/* boot vector table */
.monvects 0x00000000 (NOLOAD): {
_monvects = . ;
} > rom
 
/* monitor play area */
.monram 0x0A040000 (NOLOAD) :
{
_ramstart = .;
} > ram
 
/* monitor vector table */
.vects 0x0A042000 (NOLOAD) : {
_vectab = . ;
*(.vects);
}
 
/* Read-only sections, merged into text segment: */
 
. = 0x0a044000 ;
.interp : { *(.interp) }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
.gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r : { *(.gnu.version_r) }
.rel.text :
{ *(.rel.text) *(.rel.gnu.linkonce.t*) }
.rela.text :
{ *(.rela.text) *(.rela.gnu.linkonce.t*) }
.rel.data :
{ *(.rel.data) *(.rel.gnu.linkonce.d*) }
.rela.data :
{ *(.rela.data) *(.rela.gnu.linkonce.d*) }
.rel.rodata :
{ *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
.rela.rodata :
{ *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
.rel.got : { *(.rel.got) }
.rela.got : { *(.rela.got) }
.rel.ctors : { *(.rel.ctors) }
.rela.ctors : { *(.rela.ctors) }
.rel.dtors : { *(.rel.dtors) }
.rela.dtors : { *(.rela.dtors) }
.rel.init : { *(.rel.init) }
.rela.init : { *(.rela.init) }
.rel.fini : { *(.rel.fini) }
.rela.fini : { *(.rela.fini) }
.rel.bss : { *(.rel.bss) }
.rela.bss : { *(.rela.bss) }
.rel.plt : { *(.rel.plt) }
.rela.plt : { *(.rela.plt) }
.init : { *(.init) } =0
.plt : { *(.plt) }
.text . :
{
*(.text)
*(.stub)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.gnu.linkonce.t*)
} > ram
_etext = .;
PROVIDE (etext = .);
.fini . : { *(.fini) } =0
.rodata . : { *(.rodata) *(.gnu.linkonce.r*) }
.rodata1 . : { *(.rodata1) }
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */
. = ALIGN(128) + (. & (128 - 1));
.data . :
{
*(.data)
*(.gnu.linkonce.d*)
CONSTRUCTORS
} > ram
.data1 . : { *(.data1) }
.ctors . :
{
___ctors = .;
*(.ctors)
___ctors_end = .;
}
.dtors . :
{
___dtors = .;
*(.dtors)
___dtors_end = .;
}
.got . : { *(.got.plt) *(.got) }
.dynamic . : { *(.dynamic) }
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */
.sdata . : { *(.sdata) }
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.sbss . : { *(.sbss) *(.scommon) }
.bss . :
{
*(.dynbss)
*(.bss)
*(COMMON)
} > ram
_end = . ;
PROVIDE (end = .);
 
_HeapStart = . ;
. = . + 1024 * 20 ;
PROVIDE( _HeapEnd = . );
 
_WorkSpaceStart = . ;
. = 0x0a080000 ;
PROVIDE(_WorkSpaceEnd = .);
 
_CPU_Interrupt_stack_low = 0x0f000000 ;
_CPU_Interrupt_stack_high = _CPU_Interrupt_stack_low + 4096 ;
 
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
 
.stack 0x0f001ff0 : { _stack = .; *(.stack) } > onchip_ram
/* These must appear regardless of . */
}
/gensh1/startup/bspclean.c
0,0 → 1,41
/* bsp_cleanup()
*
* This routine normally is part of start.s and usually returns
* control to a monitor.
*
* INPUT: NONE
*
* OUTPUT: NONE
*
* Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
* Bernd Becker (becker@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; If not, write to the Free Software Foundation,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*
*
* COPYRIGHT (c) 1998.
* On-Line Applications Research Corporation (OAR).
* Copyright assigned to U.S. Government, 1994.
*
* 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: bspclean.c,v 1.2 2001-09-27 12:01:11 chris Exp $
*/
 
#include <rtems.h>
#include <bsp.h>
 
void bsp_cleanup( void )
{
rtems_fatal_error_occurred(0);
}
/gensh1/startup/Makefile.am
0,0 → 1,40
##
## $Id: Makefile.am,v 1.2 2001-09-27 12:01:11 chris Exp $
##
 
AUTOMAKE_OPTIONS = foreign 1.4
 
VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
 
PGM = $(ARCH)/startup.rel
 
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)
 
OBJS = $(C_O_FILES)
 
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../../../../../../automake/lib.am
 
#
# (OPTIONAL) Add local stuff here using +=
#
 
AM_CPPFLAGS += -DHZ=$(HZ)
 
$(PGM): $(OBJS)
$(make-rel)
 
$(PROJECT_RELEASE)/lib/linkcmds: linkcmds
$(INSTALL_DATA) $< $@
 
TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/linkcmds
 
all-local: $(ARCH) $(OBJS) $(PGM) $(TMPINSTALL_FILES)
 
.PRECIOUS: $(PGM)
 
EXTRA_DIST = bspclean.c bspstart.c linkcmds
 
include $(top_srcdir)/../../../../../../automake/local.am
/gensh1/include/coverhd.h
0,0 → 1,130
/* coverhd.h
*
* This include file has defines to represent the overhead associated
* with calling a particular directive from C. These are used in the
* Timing Test Suite to ignore the overhead required to pass arguments
* to directives. On some CPUs and/or target boards, this overhead
* is significant and makes it difficult to distinguish internal
* RTEMS execution time from that used to call the directive.
* This file should be updated after running the C overhead timing
* test. Once this update has been performed, the RTEMS Time Test
* Suite should be rebuilt to account for these overhead times in the
* timing results.
*
* NOTE: If these are all zero, then the times reported include all
* all calling overhead including passing of arguments.
*
*
* These are the figures tmoverhd.exe reported with egcs-980205 -O3
* on a Diesner OktagonSH/Amos-2.1 board with SH7032/20MHz
*
* These results are assumed to be applicable to most SH7032/20MHz boards
*
* Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
*
* 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) 1998.
* On-Line Applications Research Corporation (OAR).
* Copyright assigned to U.S. Government, 1994.
*
* 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: coverhd.h,v 1.2 2001-09-27 12:01:11 chris Exp $
*/
 
#ifndef __COVERHD_h
#define __COVERHD_h
 
#ifdef __cplusplus
extern "C" {
#endif
 
#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 4
#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 4
#define CALLING_OVERHEAD_TASK_CREATE 9
#define CALLING_OVERHEAD_TASK_IDENT 6
#define CALLING_OVERHEAD_TASK_START 5
#define CALLING_OVERHEAD_TASK_RESTART 5
#define CALLING_OVERHEAD_TASK_DELETE 4
#define CALLING_OVERHEAD_TASK_SUSPEND 4
#define CALLING_OVERHEAD_TASK_RESUME 4
#define CALLING_OVERHEAD_TASK_SET_PRIORITY 5
#define CALLING_OVERHEAD_TASK_MODE 5
#define CALLING_OVERHEAD_TASK_GET_NOTE 5
#define CALLING_OVERHEAD_TASK_SET_NOTE 5
#define CALLING_OVERHEAD_TASK_WAKE_WHEN 14
#define CALLING_OVERHEAD_TASK_WAKE_AFTER 4
#define CALLING_OVERHEAD_INTERRUPT_CATCH 5
#define CALLING_OVERHEAD_CLOCK_GET 16
#define CALLING_OVERHEAD_CLOCK_SET 14
#define CALLING_OVERHEAD_CLOCK_TICK 3
 
#define CALLING_OVERHEAD_TIMER_CREATE 4
#define CALLING_OVERHEAD_TIMER_IDENT 4
#define CALLING_OVERHEAD_TIMER_DELETE 4
#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 6
#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 20
#define CALLING_OVERHEAD_TIMER_RESET 4
#define CALLING_OVERHEAD_TIMER_CANCEL 4
#define CALLING_OVERHEAD_SEMAPHORE_CREATE 7
#define CALLING_OVERHEAD_SEMAPHORE_IDENT 5
#define CALLING_OVERHEAD_SEMAPHORE_DELETE 4
#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 5
#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 4
#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 5
#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 5
#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 4
#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 5
#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 5
#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 5
#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 6
#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 5
 
#define CALLING_OVERHEAD_EVENT_SEND 6
#define CALLING_OVERHEAD_EVENT_RECEIVE 5
#define CALLING_OVERHEAD_SIGNAL_CATCH 4
#define CALLING_OVERHEAD_SIGNAL_SEND 4
#define CALLING_OVERHEAD_PARTITION_CREATE 9
#define CALLING_OVERHEAD_PARTITION_IDENT 5
#define CALLING_OVERHEAD_PARTITION_DELETE 4
#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 6
#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 6
#define CALLING_OVERHEAD_REGION_CREATE 9
#define CALLING_OVERHEAD_REGION_IDENT 5
#define CALLING_OVERHEAD_REGION_DELETE 4
#define CALLING_OVERHEAD_REGION_GET_SEGMENT 9
#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 5
#define CALLING_OVERHEAD_PORT_CREATE 9
#define CALLING_OVERHEAD_PORT_IDENT 4
#define CALLING_OVERHEAD_PORT_DELETE 4
#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 7
#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 8
 
#define CALLING_OVERHEAD_IO_INITIALIZE 5
#define CALLING_OVERHEAD_IO_OPEN 5
#define CALLING_OVERHEAD_IO_CLOSE 5
#define CALLING_OVERHEAD_IO_READ 5
#define CALLING_OVERHEAD_IO_WRITE 5
#define CALLING_OVERHEAD_IO_CONTROL 5
#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 4
#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 4
#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 4
#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 4
#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 4
#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 4
#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 3
 
#ifdef __cplusplus
}
#endif
 
#endif
/* end of include file */
/gensh1/include/Makefile.am
0,0 → 1,21
##
## $Id: Makefile.am,v 1.2 2001-09-27 12:01:11 chris Exp $
##
 
AUTOMAKE_OPTIONS = foreign 1.4
 
H_FILES = bsp.h coverhd.h
 
$(PROJECT_INCLUDE):
$(mkinstalldirs) $@
 
$(PROJECT_INCLUDE)/%.h: %.h
$(INSTALL_DATA) $< $@
 
PREINSTALL_FILES += $(PROJECT_INCLUDE) $(H_FILES:%.h=$(PROJECT_INCLUDE)/%.h)
 
all-local: $(PREINSTALL_FILES)
 
EXTRA_DIST = bsp.h coverhd.h
 
include $(top_srcdir)/../../../../../../automake/local.am
/gensh1/include/bsp.h
0,0 → 1,138
/*
* This include file contains all board IO definitions.
*
* generic sh1
*
* Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
*
* 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) 1998.
* On-Line Applications Research Corporation (OAR).
* Copyright assigned to U.S. Government, 1994.
*
* 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: bsp.h,v 1.2 2001-09-27 12:01:11 chris Exp $
*/
 
#ifndef __gensh1_h
#define __gensh1_h
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include <rtems.h>
#include <clockdrv.h>
#include <console.h>
 
/*
* confdefs.h overrides for this BSP:
* - number of termios serial ports (defaults to 1)
* - Interrupt stack space is not minimum if defined.
*/
 
/* #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2 */
#define CONFIGURE_INTERRUPT_STACK_MEMORY (4 * 1024)
 
/* EDIT: To activate the sci driver, change the define below */
#if 1
#include <sh/null.h>
#define BSP_CONSOLE_DEVNAME "/dev/null"
#define BSP_CONSOLE_DRIVER_TABLE_ENTRY DEVNULL_DRIVER_TABLE_ENTRY
#else
#include <sh/sci.h>
#define BSP_CONSOLE_DEVNAME "/dev/sci0"
#define BSP_CONSOLE_DRIVER_TABLE_ENTRY DEVSCI_DRIVER_TABLE_ENTRY
#endif
 
 
/*
* Define the time limits for RTEMS Test Suite test durations.
* Long test and short test duration limits are provided. These
* values are in seconds and need to be converted to ticks for the
* application.
*
*/
 
#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
 
/*
* Stuff for Time Test 27
*/
 
#define MUST_WAIT_FOR_INTERRUPT 0
 
#define Install_tm27_vector( handler ) \
{ \
rtems_isr_entry ignored ; \
rtems_interrupt_catch( (handler), 0, &ignored ) ; \
}
 
#define Cause_tm27_intr()
 
#define Clear_tm27_intr()
 
#define Lower_tm27_intr()
 
/* Constants */
 
/*
* Simple spin delay in microsecond units for device drivers.
* This is very dependent on the clock speed of the target.
*/
 
#define delay( microseconds ) CPU_delay(microseconds)
#define sh_delay( microseconds ) CPU_delay(microseconds)
 
/*
* Defined in the linker script 'linkcmds'
*/
 
extern unsigned32 HeapStart ;
extern unsigned32 HeapEnd ;
extern unsigned32 WorkSpaceStart ;
extern unsigned32 WorkSpaceEnd ;
 
extern void *CPU_Interrupt_stack_low ;
extern void *CPU_Interrupt_stack_high ;
 
/* miscellaneous stuff assumed to exist */
 
extern rtems_configuration_table BSP_Configuration;
 
extern void bsp_cleanup( void );
 
/*
* Device Driver Table Entries
*/
 
/*
* We redefine CONSOLE_DRIVER_TABLE_ENTRY to redirect /dev/console
*/
#undef CONSOLE_DRIVER_TABLE_ENTRY
#define CONSOLE_DRIVER_TABLE_ENTRY \
BSP_CONSOLE_DRIVER_TABLE_ENTRY, \
{ console_initialize, console_open, console_close, \
console_read, console_write, console_control }
/*
* NOTE: Use the standard Clock driver entry
*/
 
#ifdef __cplusplus
}
#endif
 
#endif
/* end of include file */
/gensh1/scitab/Makefile.am
0,0 → 1,35
##
## $Id: Makefile.am,v 1.2 2001-09-27 12:01:11 chris Exp $
##
 
AUTOMAKE_OPTIONS = foreign 1.4
 
PGM = $(ARCH)/scitab.rel
 
C_FILES = scitab.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
 
OBJS = $(C_O_FILES)
 
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../../../../../../automake/lib.am
 
SHGEN = $(PROJECT_ROOT)/tools/cpu/sh/shgen
 
#
# (OPTIONAL) Add local stuff here using +=
#
 
CLEANFILES = scitab.c
 
$(PGM): $(OBJS)
$(make-rel)
 
scitab.c: $(SHGEN)
$(SHGEN) -H $(HZ) sci > $@
 
all-local: $(ARCH) $(OBJS) $(PGM)
 
.PRECIOUS: $(PGM)
 
include $(top_srcdir)/../../../../../../automake/local.am
/gensh1/configure.in
0,0 → 1,32
dnl Process this file with autoconf to produce a configure script.
dnl
dnl $Id: configure.in,v 1.2 2001-09-27 12:01:10 chris Exp $
 
AC_PREREQ(2.13)
AC_INIT(bsp_specs)
RTEMS_TOP(../../../../../..)
AC_CONFIG_AUX_DIR(../../../../../..)
 
RTEMS_CANONICAL_TARGET_CPU
AM_INIT_AUTOMAKE(rtems-c-src-lib-libbsp-sh-gensh1,$RTEMS_VERSION,no)
AM_MAINTAINER_MODE
 
RTEMS_PROG_CC_FOR_TARGET
RTEMS_CANONICALIZE_TOOLS
 
RTEMS_ENV_RTEMSBSP
RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
RTEMS_CHECK_BSP_CACHE(RTEMS_BSP)
RTEMS_CANONICAL_HOST
 
RTEMS_PROJECT_ROOT
 
# Explicitly list all Makefiles here
AC_OUTPUT(
Makefile
console/Makefile
include/Makefile
scitab/Makefile
start/Makefile
startup/Makefile
wrapup/Makefile)
/gensh1/Makefile.am
0,0 → 1,17
##
## $Id: Makefile.am,v 1.2 2001-09-27 12:01:10 chris Exp $
##
 
AUTOMAKE_OPTIONS = foreign 1.4
ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
 
# wrapup is the one that actually builds and installs the library
# from the individual .rel files built in other directories
SUBDIRS = include start startup scitab console wrapup
 
include $(top_srcdir)/../../bsp.am
 
EXTRA_DIST = bsp_specs times
 
include $(top_srcdir)/../../../../../../automake/subdirs.am
include $(top_srcdir)/../../../../../../automake/local.am
/gensh1/README
0,0 → 1,54
#
# $Id: README,v 1.2 2001-09-27 12:01:10 chris Exp $
#
# Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
#
 
BSP NAME: generic SH1 (gensh1)
BOARD: n/a
BUS: n/a
CPU FAMILY: Hitachi SH
CPU: SH 7032
COPROCESSORS: none
MODE: n/a
 
DEBUG MONITOR: gdb
 
PERIPHERALS
===========
TIMERS: on-chip
RESOLUTION: cf. Hitachi SH 703X Hardware Manual (Phi/4)
SERIAL PORTS: on-chip (with 2 ports)
REAL-TIME CLOCK: none
DMA: not used
VIDEO: none
SCSI: none
NETWORKING: none
 
DRIVER INFORMATION
==================
CLOCK DRIVER: on-chip timer
IOSUPP DRIVER: default
SHMSUPP: default
TIMER DRIVER: on-chip timer
TTY DRIVER: /dev/null (stub)
 
STDIO
=====
PORT: /dev/null (stub)
ELECTRICAL: n/a
BAUD: n/a
BITS PER CHARACTER: n/a
PARITY: n/a
STOP BITS: n/a
 
NOTES
=====
 
(1) The stub console driver (null) is enabled by default.
 
(2) The driver for the on-chip serial devices (sci) is still in its infancy
and not fully tested. It may even be non-functional and therefore is
disabled by default. Please let us know any problems you encounter with
it.
To activate it edit libbsp/sh/gensh1/include/bsp.h
/gensh1/start/Makefile.am
0,0 → 1,32
##
## $Id: Makefile.am,v 1.2 2001-09-27 12:01:11 chris Exp $
##
 
AUTOMAKE_OPTIONS = foreign 1.4
 
PGM = $(ARCH)/start.o
 
S_FILES = start.S
S_O_FILES = $(S_FILES:%.S=$(ARCH)/%.o)
 
OBJS = $(S_O_FILES)
 
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../../../../../../automake/lib.am
 
#
# (OPTIONAL) Add local stuff here using +=
#
 
$(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o: $(PGM)
$(INSTALL_DATA) $< $@
 
TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o
 
all-local: $(ARCH) $(OBJS) $(PGM) $(TMPINSTALL_FILES)
 
.PRECIOUS: $(PGM)
 
EXTRA_DIST = start.S
 
include $(top_srcdir)/../../../../../../automake/local.am
/gensh1/start/start.S
0,0 → 1,94
/*
* Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
* Bernd Becker (becker@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
*
* 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) 1998.
* On-Line Applications Research Corporation (OAR).
* Copyright assigned to U.S. Government, 1994.
*
* 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: start.S,v 1.2 2001-09-27 12:01:11 chris Exp $
*/
 
#include "asm.h"
 
BEGIN_CODE
PUBLIC(start)
SYM (start):
! install the stack pointer
mov.l stack_k,r15
 
! zero out bss
mov.l edata_k,r0
mov.l end_k,r1
mov #0,r2
0:
mov.l r2,@r0
add #4,r0
cmp/ge r0,r1
bt 0b
 
! copy the vector table from rom to ram
mov.l vects_k,r0 ! vectab
mov #0,r1 ! address of boot vector table
mov #0,r2 ! number of bytes copied
mov.w vects_size,r3 ! size of entries in vectab
1:
mov.l @r1+,r4
mov.l r4,@r0
add #4,r0
add #1,r2
cmp/hi r3,r2
bf 1b
 
mov.l vects_k,r0 ! update vbr to point to vectab
ldc r0,vbr
 
! call the mainline
mov #0,r4 ! argc
mov.l main_k,r0
jsr @r0
mov #0,r5 ! argv
 
! call exit
mov r0,r4
mov.l exit_k,r0
jsr @r0
or r0,r0
 
END_CODE
 
.align 2
stack_k:
.long SYM(stack)
edata_k:
.long SYM(edata)
end_k:
.long SYM(end)
main_k:
.long SYM(boot_card)
exit_k:
.long SYM(exit)
 
vects_k:
.long SYM(vectab)
vects_size:
.word 255
 
#ifdef __ELF__
.section .stack,"aw"
#else
.section .stack
#endif
SYM(stack):
.long 0xdeaddead
/gensh1/wrapup/Makefile.am
0,0 → 1,39
##
## $Id: Makefile.am,v 1.2 2001-09-27 12:01:11 chris Exp $
##
## build and install libbsp
##
 
AUTOMAKE_OPTIONS = foreign 1.4
 
BSP_PIECES = startup scitab console
 
# pieces to pick up out of libcpu/sh/sh7032
CPU_PIECES = null clock timer sci delay
 
# bummer; have to use $foreach since % pattern subst rules only replace 1x
OBJS = $(foreach piece, $(BSP_PIECES), $(wildcard ../$(piece)/$(ARCH)/*.o)) \
$(foreach piece, $(CPU_PIECES), ../../../../libcpu/$(RTEMS_CPU)/sh7032/$(piece)/$(ARCH)/$(piece).rel)
 
LIB = $(ARCH)/libbsp.a
 
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../../../../../../automake/lib.am
 
#
# (OPTIONAL) Add local stuff here using =
#
 
$(LIB): $(OBJS)
$(make-library)
 
$(PROJECT_RELEASE)/lib/libbsp$(LIB_VARIANT).a: $(LIB)
$(INSTALL_DATA) $< $@
 
TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/libbsp$(LIB_VARIANT).a
 
all-local: $(ARCH) $(OBJS) $(LIB) $(TMPINSTALL_FILES)
 
.PRECIOUS: $(LIB)
 
include $(top_srcdir)/../../../../../../automake/local.am
/configure.in
0,0 → 1,25
dnl Process this file with autoconf to produce a configure script.
dnl
dnl $Id: configure.in,v 1.2 2001-09-27 12:01:10 chris Exp $
 
AC_PREREQ(2.13)
AC_INIT(gensh1)
RTEMS_TOP(../../../../..)
AC_CONFIG_AUX_DIR(../../../../..)
 
RTEMS_CANONICAL_TARGET_CPU
AM_INIT_AUTOMAKE(rtems-c-src-lib-libbsp-sh,$RTEMS_VERSION,no)
AM_MAINTAINER_MODE
 
RTEMS_ENV_RTEMSBSP
RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
RTEMS_CHECK_BSP_CACHE(RTEMS_BSP)
 
RTEMS_PROJECT_ROOT
RTEMS_BSP_ALIAS(${RTEMS_BSP},bspdir)
AC_CONFIG_SUBDIRS($bspdir)
 
# Explicitly list all Makefiles here
AC_OUTPUT(
Makefile
shared/Makefile)
/gensh2/bsp_specs
0,0 → 1,22
%rename cpp old_cpp
%rename lib old_lib
%rename endfile old_endfile
%rename startfile old_startfile
%rename link old_link
 
*cpp:
%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)
 
*lib:
%{!qrtems: %(old_lib)} \
%{qrtems: --start-group %{!qrtems_debug: -lrtemsall } %{qrtems_debug: -lrtemsall_g} \
-lc -lgcc --end-group \
%{!qnolinkcmds: -T linkcmds%s}}
 
*startfile:
%{!qrtems: %(old_startfile)} \
%{qrtems: %{qrtems_debug: start_g.o%s} %{!qrtems_debug: start.o%s}}
 
*link:
%(old_link) %{qrtems: -dc -dp -N -e _start}
 
/gensh2/console/Makefile.am
0,0 → 1,33
##
## $Id: Makefile.am,v 1.2 2001-09-27 12:01:11 chris Exp $
##
 
AUTOMAKE_OPTIONS = foreign 1.4
 
VPATH = @srcdir@:@srcdir@/../../shared
 
PGM = $(ARCH)/console.rel
 
C_FILES = console.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
 
OBJS = $(C_O_FILES)
 
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../../../../../../automake/lib.am
 
#
# (OPTIONAL) Add local stuff here using +=
#
 
$(PGM): $(OBJS)
$(make-rel)
 
# the .rel file built here will be put into libbsp.a by
# ../wrapup/Makefile
 
all-local: $(ARCH) $(OBJS) $(PGM)
 
.PRECIOUS: $(PGM)
 
include $(top_srcdir)/../../../../../../automake/local.am
/gensh2/startup/linkcmds.rom
0,0 → 1,217
/*
* This is an adapted linker script from egcs-1.0.1
*
* Memory layout for an SH7045F with main memory in area 2
* This memory layout it very similar to that used for Hitachi's
* EVB with CMON in FLASH
*
* NOTE: The ram start address may vary, all other start addresses are fixed
* Not suiteable for gdb's simulator
*
* Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
* Bernd Becker (becker@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
*
* 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) 1998.
* On-Line Applications Research Corporation (OAR).
* Copyright assigned to U.S. Government, 1994.
*
* 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.
*
* Modified to reflect SH7045F processor and EVB:
* John M. Mills (jmills@tga.com)
* TGA Technologies, Inc.
* 100 Pinnacle Way, Suite 140
* Norcross, GA 30071 U.S.A.
*
* This modified file may be copied and distributed in accordance
* the above-referenced license. It is provided for critique and
* developmental purposes without any warranty nor representation
* by the authors or by TGA Technologies.
*
* $Id: linkcmds.rom,v 1.2 2001-09-27 12:01:12 chris Exp $
*/
 
OUTPUT_FORMAT("coff-sh")
OUTPUT_ARCH(sh)
ENTRY(_start)
 
/* These asignments represent actual SH7045F EVB architecture */
 
MEMORY
{
rom : o = 0x00000000, l = 0x00040000
ram : o = 0x00400000, l = 0x00080000
onchip_peri : o = 0xFFFF8000, l = 0x00000800
onchip_ram : o = 0xFFFFF000, l = 0x00001000
}
 
 
/* Sections are defined for RAM loading and monitor debugging */
SECTIONS
{
/* boot vector table */
.monvects 0x00000000 (NOLOAD): {
_monvects = . ;
} > rom
 
/* monitor play area */
.monram 0x00400000 (NOLOAD) :
{
_ramstart = .;
} > ram
 
/* monitor vector table */
.vects 0x00402000 (NOLOAD) : {
_vectab = . ;
*(.vects);
}
 
/* Read-only sections, merged into text segment: */
 
. = 0x00404000 ;
.interp : { *(.interp) }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
.gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r : { *(.gnu.version_r) }
.rel.text :
{ *(.rel.text) *(.rel.gnu.linkonce.t*) }
.rela.text :
{ *(.rela.text) *(.rela.gnu.linkonce.t*) }
.rel.data :
{ *(.rel.data) *(.rel.gnu.linkonce.d*) }
.rela.data :
{ *(.rela.data) *(.rela.gnu.linkonce.d*) }
.rel.rodata :
{ *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
.rela.rodata :
{ *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
.rel.got : { *(.rel.got) }
.rela.got : { *(.rela.got) }
.rel.ctors : { *(.rel.ctors) }
.rela.ctors : { *(.rela.ctors) }
.rel.dtors : { *(.rel.dtors) }
.rela.dtors : { *(.rela.dtors) }
.rel.init : { *(.rel.init) }
.rela.init : { *(.rela.init) }
.rel.fini : { *(.rel.fini) }
.rela.fini : { *(.rela.fini) }
.rel.bss : { *(.rel.bss) }
.rela.bss : { *(.rela.bss) }
.rel.plt : { *(.rel.plt) }
.rela.plt : { *(.rela.plt) }
.init : { *(.init) } =0
.plt : { *(.plt) }
.text . :
{
*(.text)
*(.stub)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.gnu.linkonce.t*)
} > ram
_etext = .;
PROVIDE (etext = .);
.fini . : { *(.fini) } =0
.rodata . : { *(.rodata) *(.gnu.linkonce.r*) }
.rodata1 . : { *(.rodata1) }
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */
. = ALIGN(128) + (. & (128 - 1));
.data . :
{
*(.data)
*(.gnu.linkonce.d*)
CONSTRUCTORS
} > ram
.data1 . : { *(.data1) }
.ctors . :
{
___ctors = .;
*(.ctors)
___ctors_end = .;
}
.dtors . :
{
___dtors = .;
*(.dtors)
___dtors_end = .;
}
.got . : { *(.got.plt) *(.got) }
.dynamic . : { *(.dynamic) }
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */
.sdata . : { *(.sdata) }
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.sbss . : { *(.sbss) *(.scommon) }
.bss . :
{
*(.dynbss)
*(.bss)
*(COMMON)
} > ram
_end = . ;
PROVIDE (end = .);
 
_HeapStart = . ;
. = . + 1024 * 20 ;
PROVIDE( _HeapEnd = . );
 
_WorkSpaceStart = . ;
. = 0x00480000 ;
PROVIDE(_WorkSpaceEnd = .);
 
_CPU_Interrupt_stack_low = 0xFFFFF000 ;
_CPU_Interrupt_stack_high = _CPU_Interrupt_stack_low + 4096 ;
 
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
 
.stack 0xFFFFFEC0 : { _stack = .; *(.stack) } > onchip_ram
/* These must appear regardless of . */
}
/gensh2/startup/hw_init.c
0,0 → 1,117
/*
* hw_init.c: set up sh7045F internal subunits
* Pin and memory assignments assume
* target is Hitachi SH7045F EVB ("lcevb")
*
* Provides two initialization routines:
* A. 'void early_hw_init(void)' for 'start.S'
* sets up hw needed for early RTEMS boot, and
* B. 'void bsp_hw_init(void)' for 'bspstart.c'
* sets up hardware used by this BSP.
*
* Author: John M. Mills (jmills@tga.com)
* COPYRIGHT(c) 2000, TGA Technologies, Inc
* Norcross, GA 30071 U.S.A
*
* 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.
*
*
* 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.
*
* Adapted from Hitachi EVB7045F tutorial files by:
* John M. Mills (jmills@tga.com)
* TGA Technologies, Inc.
* 100 Pinnacle Way, Suite 140
* Norcross, GA 30071 U.S.A.
*
*
* This file may be copied and distributed in accordance
* the above-referenced license. It is provided for critique and
* developmental purposes without any warranty nor representation
* by the authors or by TGA Technologies.
*
* $Id: hw_init.c,v 1.2 2001-09-27 12:01:12 chris Exp $
*/
 
#include <bsp.h>
 
#include <stdlib.h>
 
#include <rtems/libio.h>
#include <iosupp.h>
#include <rtems/score/sh_io.h>
#include <rtems/score/iosh7045.h>
 
/* exported entries */
extern void bsp_hw_init (void);
extern void early_hw_init (void);
 
/* called from 'start.S' on "#ifdef START_HW_INIT" */
void early_hw_init (void)
{
#ifdef STANDALONE_EVB
/* STANDALONE_EVB minimally sets up bus and DRAM here */
/* no STANDALONE_EVB accepts defaults from debug monitor */
 
/* FIXME: replace 'magic numbers' with logical names */
 
write16(0x2020, BSC_BCR1); /* Bus width access - 32-bit on CS1 */
write16(0xF3DD, BSC_BCR2); /* Idle cycles CS3-CS0 - 0 idle cycles*/
write16(0xFF3F, BSC_WCR1); /* Waits for CS3-CS0 - 3 waits on CS1 */
write16(0x000F, BSC_WCR2); /* Waits for DRAM/DMA access - default */
write16(0x0000, BSC_DCR); /* DRAM control - default */
write16(0x0000, BSC_RTCSR); /* DRAM refresh - default */
write16(0x0000, BSC_RTCNT); /* DRAM refresh counter - default*/
write16(0x0000, BSC_RTCOR); /* DRAM refresh compare match - default */
#endif
 
/* add early-init functions here */
 
};
 
/* to be called from 'bspstart.c' */
void bsp_hw_init (void)
{
int a;
unsigned8 temp8;
unsigned16 temp16;
 
#ifdef STANDALONE_EVB
/* STANDALONE_EVB: sets up PFC */
/* no STANDALONE_EVB: accepts defaults, adds RESET */
 
/* FIXME: replace 'magic numbers' */
write16(0x5000, PFC_PACRH); /* Pin function controller - WRHH, WRHL */
write16(0x1550, PFC_PACRL1); /* Pin fun. controller - WRH,WRL,RD,CS1 */
write16(0x0000, PFC_PBCR1); /* Pin function controller - default */
write16(0x2005, PFC_PBCR2); /* Pin fcn. controller - A18,A17,A16 */
write16(0xFFFF, PFC_PCCR); /* Pin function controller - A15-A0 */
write16(0x5555, PFC_PDCRH1); /* Pin function controller - D31-D24 */
write16(0x5555, PFC_PDCRH2); /* Pin function controller - D23-D16 */
write16(0xFFFF, PFC_PDCRL); /* Pin function controller - D15-D0 */
write16(0x0000, PFC_IFCR); /* Pin function controller - default */
write16(0x0000, PFC_PACRL2); /* default disconnects all I/O pins;*/
/* [re-connected by DEVICE_open()] */
#endif
 
/* default hardware setup for SH7045F EVB */
 
/* PFC: General I/O except pin 13 (reset): */
temp16 = read16(PFC_PECR1);
temp16 |= 0x0800;
write16(temp16, PFC_PECR1);
 
/* All I/O lines bits 7-0: */
write16(0x00, PFC_PECR2);
 
/* P5 (LED) out, all other pins in: */
temp16 = read16(PFC_PEIOR);
temp16 |= 0x0020;
write16(temp16, PFC_PEIOR);
 
}
/gensh2/startup/linkcmds.ram
0,0 → 1,216
/*
* This is an adapted linker script from egcs-1.0.1
*
* Memory layout for an SH7045F with main memory in area 2
* This memory layout it very similar to that used for Hitachi's
* EVB with CMON in FLASH
*
* NOTE: The ram start address may vary, all other start addresses are fixed
* Not suiteable for gdb's simulator
*
* Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
* Bernd Becker (becker@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
*
* 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) 1998.
* On-Line Applications Research Corporation (OAR).
* Copyright assigned to U.S. Government, 1994.
*
* 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.
*
* Modified to reflect SH7045F processor and EVB:
* John M. Mills (jmills@tga.com)
* TGA Technologies, Inc.
* 100 Pinnacle Way, Suite 140
* Norcross, GA 30071 U.S.A.
*
* This modified file may be copied and distributed in accordance
* the above-referenced license. It is provided for critique and
* developmental purposes without any warranty nor representation
* by the authors or by TGA Technologies.
*
* $Id: linkcmds.ram,v 1.2 2001-09-27 12:01:12 chris Exp $
*/
 
OUTPUT_FORMAT("coff-sh")
OUTPUT_ARCH(sh)
ENTRY(_start)
 
/* These assignments load code into SH7045F EVB SRAM for monitor debugging */
 
MEMORY
{
rom : o = 0x00400000, l = 0x00040000
ram : o = 0x00440000, l = 0x00040000
onchip_peri : o = 0xFFFF8000, l = 0x00000800
onchip_ram : o = 0xFFFFF000, l = 0x00001000
}
 
/* Sections are defined for RAM loading and monitor debugging */
SECTIONS
{
/* boot vector table */
.monvects 0x00400000 (NOLOAD): {
_monvects = . ;
} > rom
 
/* monitor play area */
.monram 0x00440000 (NOLOAD) :
{
_ramstart = .;
} > ram
 
/* monitor vector table */
.vects 0x00442000 (NOLOAD) : {
_vectab = . ;
*(.vects);
}
 
/* Read-only sections, merged into text segment: */
 
. = 0x00444000 ;
.interp : { *(.interp) }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
.gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r : { *(.gnu.version_r) }
.rel.text :
{ *(.rel.text) *(.rel.gnu.linkonce.t*) }
.rela.text :
{ *(.rela.text) *(.rela.gnu.linkonce.t*) }
.rel.data :
{ *(.rel.data) *(.rel.gnu.linkonce.d*) }
.rela.data :
{ *(.rela.data) *(.rela.gnu.linkonce.d*) }
.rel.rodata :
{ *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
.rela.rodata :
{ *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
.rel.got : { *(.rel.got) }
.rela.got : { *(.rela.got) }
.rel.ctors : { *(.rel.ctors) }
.rela.ctors : { *(.rela.ctors) }
.rel.dtors : { *(.rel.dtors) }
.rela.dtors : { *(.rela.dtors) }
.rel.init : { *(.rel.init) }
.rela.init : { *(.rela.init) }
.rel.fini : { *(.rel.fini) }
.rela.fini : { *(.rela.fini) }
.rel.bss : { *(.rel.bss) }
.rela.bss : { *(.rela.bss) }
.rel.plt : { *(.rel.plt) }
.rela.plt : { *(.rela.plt) }
.init : { *(.init) } =0
.plt : { *(.plt) }
.text . :
{
*(.text)
*(.stub)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.gnu.linkonce.t*)
} > ram
_etext = .;
PROVIDE (etext = .);
.fini . : { *(.fini) } =0
.rodata . : { *(.rodata) *(.gnu.linkonce.r*) }
.rodata1 . : { *(.rodata1) }
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */
. = ALIGN(128) + (. & (128 - 1));
.data . :
{
*(.data)
*(.gnu.linkonce.d*)
CONSTRUCTORS
} > ram
.data1 . : { *(.data1) }
.ctors . :
{
___ctors = .;
*(.ctors)
___ctors_end = .;
}
.dtors . :
{
___dtors = .;
*(.dtors)
___dtors_end = .;
}
.got . : { *(.got.plt) *(.got) }
.dynamic . : { *(.dynamic) }
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */
.sdata . : { *(.sdata) }
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.sbss . : { *(.sbss) *(.scommon) }
.bss . :
{
*(.dynbss)
*(.bss)
*(COMMON)
} > ram
_end = . ;
PROVIDE (end = .);
 
_HeapStart = . ;
. = . + 1024 * 20 ;
PROVIDE( _HeapEnd = . );
 
_WorkSpaceStart = . ;
. = 0x00480000 ;
PROVIDE(_WorkSpaceEnd = .);
 
_CPU_Interrupt_stack_low = 0xFFFFF000 ;
_CPU_Interrupt_stack_high = _CPU_Interrupt_stack_low + 4096 ;
 
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
 
.stack 0xFFFFFEC0 : { _stack = .; *(.stack) } > onchip_ram
/* These must appear regardless of . */
}
/gensh2/startup/bspstart.c
0,0 → 1,142
/*
* This routine starts the application. It includes application,
* board, and monitor specific initialization and configuration.
* The generic CPU dependent initialization has been performed
* before this routine is invoked.
*
* Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
* Bernd Becker (becker@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
*
* 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) 1998.
* On-Line Applications Research Corporation (OAR).
* Copyright assigned to U.S. Government, 1994.
*
* 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: bspstart.c,v 1.2 2001-09-27 12:01:12 chris Exp $
*/
 
#include <bsp.h>
#include <rtems/libio.h>
#include <libcsupport.h>
#include <string.h>
/*
* The original table from the application and our copy of it with
* some changes.
*/
 
extern void bsp_hw_init(void);
 
extern rtems_configuration_table Configuration;
 
rtems_configuration_table BSP_Configuration;
 
rtems_cpu_table Cpu_table;
 
char *rtems_progname;
 
/*
* Use the shared implementations of the following routines
*/
void bsp_postdriver_hook(void);
void bsp_libc_init( void *, unsigned32, int );
 
/*
* Function: bsp_pretasking_hook
*
* 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)
{
bsp_libc_init(&HeapStart, sizeof(unsigned32) * (&HeapEnd - &HeapStart), 0);
#ifdef RTEMS_DEBUG
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
#endif
}
 
/*
* bsp_start
*
* This routine does the bulk of the system initialization.
*/
 
void bsp_start(void)
{
/*
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 ether be done from inside the rom
startup code, rtems startup code or here.
*/
 
#ifndef START_HW_INIT
/* board hardware setup here, or from 'start.S' */
bsp_hw_init();
#endif
 
/*
* 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 ;
 
/* This isn't used anywhere */
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;
 
#if ( CPU_ALLOCATE_INTERRUPT_STACK == TRUE )
Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY;
#endif
 
Cpu_table.clicks_per_second = HZ ;
}
/gensh2/startup/linkcmds
0,0 → 1,216
/*
* This is an adapted linker script from egcs-1.0.1
*
* Memory layout for an SH7045F with main memory in area 2
* This memory layout it very similar to that used for Hitachi's
* EVB with CMON in FLASH
*
* NOTE: The ram start address may vary, all other start addresses are fixed
* Not suiteable for gdb's simulator
*
* Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
* Bernd Becker (becker@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
*
* 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) 1998.
* On-Line Applications Research Corporation (OAR).
* Copyright assigned to U.S. Government, 1994.
*
* 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.
*
* Modified to reflect SH7045F processor and EVB:
* John M. Mills (jmills@tga.com)
* TGA Technologies, Inc.
* 100 Pinnacle Way, Suite 140
* Norcross, GA 30071 U.S.A.
*
* This modified file may be copied and distributed in accordance
* the above-referenced license. It is provided for critique and
* developmental purposes without any warranty nor representation
* by the authors or by TGA Technologies.
*
* $Id: linkcmds,v 1.2 2001-09-27 12:01:12 chris Exp $
*/
 
OUTPUT_FORMAT("coff-sh")
OUTPUT_ARCH(sh)
ENTRY(_start)
 
/* These assignments load code into SH7045F EVB SRAM for monitor debugging */
 
MEMORY
{
rom : o = 0x00400000, l = 0x00040000
ram : o = 0x00440000, l = 0x00040000
onchip_peri : o = 0xFFFF8000, l = 0x00000800
onchip_ram : o = 0xFFFFF000, l = 0x00001000
}
 
/* Sections are defined for RAM loading and monitor debugging */
SECTIONS
{
/* boot vector table */
.monvects 0x00400000 (NOLOAD): {
_monvects = . ;
} > rom
 
/* monitor play area */
.monram 0x00440000 (NOLOAD) :
{
_ramstart = .;
} > ram
 
/* monitor vector table */
.vects 0x00442000 (NOLOAD) : {
_vectab = . ;
*(.vects);
}
 
/* Read-only sections, merged into text segment: */
 
. = 0x00444000 ;
.interp : { *(.interp) }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
.gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r : { *(.gnu.version_r) }
.rel.text :
{ *(.rel.text) *(.rel.gnu.linkonce.t*) }
.rela.text :
{ *(.rela.text) *(.rela.gnu.linkonce.t*) }
.rel.data :
{ *(.rel.data) *(.rel.gnu.linkonce.d*) }
.rela.data :
{ *(.rela.data) *(.rela.gnu.linkonce.d*) }
.rel.rodata :
{ *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
.rela.rodata :
{ *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
.rel.got : { *(.rel.got) }
.rela.got : { *(.rela.got) }
.rel.ctors : { *(.rel.ctors) }
.rela.ctors : { *(.rela.ctors) }
.rel.dtors : { *(.rel.dtors) }
.rela.dtors : { *(.rela.dtors) }
.rel.init : { *(.rel.init) }
.rela.init : { *(.rela.init) }
.rel.fini : { *(.rel.fini) }
.rela.fini : { *(.rela.fini) }
.rel.bss : { *(.rel.bss) }
.rela.bss : { *(.rela.bss) }
.rel.plt : { *(.rel.plt) }
.rela.plt : { *(.rela.plt) }
.init : { *(.init) } =0
.plt : { *(.plt) }
.text . :
{
*(.text)
*(.stub)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.gnu.linkonce.t*)
} > ram
_etext = .;
PROVIDE (etext = .);
.fini . : { *(.fini) } =0
.rodata . : { *(.rodata) *(.gnu.linkonce.r*) }
.rodata1 . : { *(.rodata1) }
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */
. = ALIGN(128) + (. & (128 - 1));
.data . :
{
*(.data)
*(.gnu.linkonce.d*)
CONSTRUCTORS
} > ram
.data1 . : { *(.data1) }
.ctors . :
{
___ctors = .;
*(.ctors)
___ctors_end = .;
}
.dtors . :
{
___dtors = .;
*(.dtors)
___dtors_end = .;
}
.got . : { *(.got.plt) *(.got) }
.dynamic . : { *(.dynamic) }
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */
.sdata . : { *(.sdata) }
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
.sbss . : { *(.sbss) *(.scommon) }
.bss . :
{
*(.dynbss)
*(.bss)
*(COMMON)
} > ram
_end = . ;
PROVIDE (end = .);
 
_HeapStart = . ;
. = . + 1024 * 20 ;
PROVIDE( _HeapEnd = . );
 
_WorkSpaceStart = . ;
. = 0x00480000 ;
PROVIDE(_WorkSpaceEnd = .);
 
_CPU_Interrupt_stack_low = 0xFFFFF000 ;
_CPU_Interrupt_stack_high = _CPU_Interrupt_stack_low + 4096 ;
 
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
 
.stack 0xFFFFFEC0 : { _stack = .; *(.stack) } > onchip_ram
/* These must appear regardless of . */
}
/gensh2/startup/bspclean.c
0,0 → 1,43
/* bsp_cleanup()
*
* This routine normally is part of start.s and usually returns
* control to a monitor.
*
* INPUT: NONE
*
* OUTPUT: NONE
*
* Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
* Bernd Becker (becker@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; If not, write to the Free Software Foundation,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*
*
* COPYRIGHT (c) 1998.
* On-Line Applications Research Corporation (OAR).
* Copyright assigned to U.S. Government, 1994.
*
* 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: bspclean.c,v 1.2 2001-09-27 12:01:12 chris Exp $
*/
 
#include <rtems.h>
#include <bsp.h>
 
void bsp_cleanup( void )
{
#if 0
rtems_fatal_error_occurred(0);
#endif
}
/gensh2/startup/Makefile.am
0,0 → 1,41
##
## $Id: Makefile.am,v 1.2 2001-09-27 12:01:12 chris Exp $
##
 
AUTOMAKE_OPTIONS = foreign 1.4
 
VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
 
PGM = $(ARCH)/startup.rel
 
C_FILES = hw_init.c bsplibc.c bsppost.c bspstart.c bspclean.c sbrk.c \
bootcard.c main.c gnatinstallhandler.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
 
OBJS = $(C_O_FILES)
 
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../../../../../../automake/lib.am
 
#
# (OPTIONAL) Add local stuff here using +=
#
 
AM_CPPFLAGS += -DHZ=$(HZ)
 
$(PROJECT_RELEASE)/lib/linkcmds: linkcmds
$(INSTALL_DATA) $< $@
 
$(PGM): $(OBJS)
$(make-rel)
 
PREINSTALL_FILES += $(PROJECT_RELEASE)/lib/linkcmds
 
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(PGM)
 
.PRECIOUS: $(PGM)
 
EXTRA_DIST = bspclean.c bspstart.c hw_init.c linkcmds linkcmds.ram \
linkcmds.rom
 
include $(top_srcdir)/../../../../../../automake/local.am
/gensh2/include/coverhd.h
0,0 → 1,130
/* coverhd.h
*
* This include file has defines to represent the overhead associated
* with calling a particular directive from C. These are used in the
* Timing Test Suite to ignore the overhead required to pass arguments
* to directives. On some CPUs and/or target boards, this overhead
* is significant and makes it difficult to distinguish internal
* RTEMS execution time from that used to call the directive.
* This file should be updated after running the C overhead timing
* test. Once this update has been performed, the RTEMS Time Test
* Suite should be rebuilt to account for these overhead times in the
* timing results.
*
* NOTE: If these are all zero, then the times reported include all
* all calling overhead including passing of arguments.
*
*
* These are the figures tmoverhd.exe reported with gcc-2.95.1 -O4
* on a Hitachi SH7045F Evaluation Board with SH7045F at 29 MHz
*
* These results are assumed to be applicable to most SH7045/29MHz boards
*
* Author: John M.Mills (jmills@tga.com)
*
* COPYRIGHT (c) 1999. TGA Technologies, Inc., Norcross, GA, USA
*
* 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.
*
* 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.
*
* This file may be copied and distributed in accordance
* the above-referenced license. It is provided for critique and
* developmental purposes without any warranty nor representation
* by the authors or by TGA Technologies.
*
* $Id: coverhd.h,v 1.2 2001-09-27 12:01:12 chris Exp $
*/
 
#ifndef __COVERHD_h
#define __COVERHD_h
 
#ifdef __cplusplus
extern "C" {
#endif
 
#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 1
#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 1
#define CALLING_OVERHEAD_TASK_CREATE 2
#define CALLING_OVERHEAD_TASK_IDENT 1
#define CALLING_OVERHEAD_TASK_START 1
#define CALLING_OVERHEAD_TASK_RESTART 1
#define CALLING_OVERHEAD_TASK_DELETE 1
#define CALLING_OVERHEAD_TASK_SUSPEND 1
#define CALLING_OVERHEAD_TASK_RESUME 1
#define CALLING_OVERHEAD_TASK_SET_PRIORITY 1
#define CALLING_OVERHEAD_TASK_MODE 1
#define CALLING_OVERHEAD_TASK_GET_NOTE 1
#define CALLING_OVERHEAD_TASK_SET_NOTE 1
#define CALLING_OVERHEAD_TASK_WAKE_WHEN 2
#define CALLING_OVERHEAD_TASK_WAKE_AFTER 1
#define CALLING_OVERHEAD_INTERRUPT_CATCH 1
#define CALLING_OVERHEAD_CLOCK_GET 3
#define CALLING_OVERHEAD_CLOCK_SET 2
#define CALLING_OVERHEAD_CLOCK_TICK 1
 
#define CALLING_OVERHEAD_TIMER_CREATE 1
#define CALLING_OVERHEAD_TIMER_IDENT 1
#define CALLING_OVERHEAD_TIMER_DELETE 1
#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 1
#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 3
#define CALLING_OVERHEAD_TIMER_RESET 1
#define CALLING_OVERHEAD_TIMER_CANCEL 1
#define CALLING_OVERHEAD_SEMAPHORE_CREATE 1
#define CALLING_OVERHEAD_SEMAPHORE_IDENT 1
#define CALLING_OVERHEAD_SEMAPHORE_DELETE 1
#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 1
#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 1
#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 1
#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 1
#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 1
#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 1
#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 1
#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 1
#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 1
#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 1
 
#define CALLING_OVERHEAD_EVENT_SEND 1
#define CALLING_OVERHEAD_EVENT_RECEIVE 1
#define CALLING_OVERHEAD_SIGNAL_CATCH 1
#define CALLING_OVERHEAD_SIGNAL_SEND 1
#define CALLING_OVERHEAD_PARTITION_CREATE 2
#define CALLING_OVERHEAD_PARTITION_IDENT 1
#define CALLING_OVERHEAD_PARTITION_DELETE 1
#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 1
#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 1
#define CALLING_OVERHEAD_REGION_CREATE 2
#define CALLING_OVERHEAD_REGION_IDENT 1
#define CALLING_OVERHEAD_REGION_DELETE 1
#define CALLING_OVERHEAD_REGION_GET_SEGMENT 2
#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 1
#define CALLING_OVERHEAD_PORT_CREATE 2
#define CALLING_OVERHEAD_PORT_IDENT 1
#define CALLING_OVERHEAD_PORT_DELETE 1
#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 1
#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 1
 
#define CALLING_OVERHEAD_IO_INITIALIZE 1
#define CALLING_OVERHEAD_IO_OPEN 1
#define CALLING_OVERHEAD_IO_CLOSE 1
#define CALLING_OVERHEAD_IO_READ 1
#define CALLING_OVERHEAD_IO_WRITE 1
#define CALLING_OVERHEAD_IO_CONTROL 1
#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 1
#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 1
#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 1
#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 1
#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 1
#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 1
#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 1
 
#ifdef __cplusplus
}
#endif
 
#endif
/* end of include file */
/gensh2/include/Makefile.am
0,0 → 1,18
##
## $Id: Makefile.am,v 1.2 2001-09-27 12:01:11 chris Exp $
##
 
AUTOMAKE_OPTIONS = foreign 1.4
 
H_FILES = bsp.h coverhd.h
 
$(PROJECT_INCLUDE)/%.h: %.h
$(INSTALL_DATA) $< $@
 
PREINSTALL_FILES += $(H_FILES:%.h=$(PROJECT_INCLUDE)/%.h)
 
all-local: $(PREINSTALL_FILES)
 
EXTRA_DIST = bsp.h coverhd.h
 
include $(top_srcdir)/../../../../../../automake/local.am
/gensh2/include/bsp.h
0,0 → 1,148
/*
* This include file contains all board IO definitions.
*
* generic sh2
*
* Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
*
* 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) 1998.
* On-Line Applications Research Corporation (OAR).
* Copyright assigned to U.S. Government, 1994.
*
* 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.
*
* Minor adaptations for sh2 by:
* John M. Mills (jmills@tga.com)
* TGA Technologies, Inc.
* 100 Pinnacle Way, Suite 140
* Norcross, GA 30071 U.S.A.
*
* This modified file may be copied and distributed in accordance
* the above-referenced license. It is provided for critique and
* developmental purposes without any warranty nor representation
* by the authors or by TGA Technologies.
*
* $Id: bsp.h,v 1.2 2001-09-27 12:01:12 chris Exp $
*/
 
#ifndef __gensh2_h
#define __gensh2_h
 
#ifdef __cplusplus
extern "C" {
#endif
 
#include <rtems.h>
#include <clockdrv.h>
#include <console.h>
 
/*
* confdefs.h overrides for this BSP:
* - number of termios serial ports (defaults to 1)
* - Interrupt stack space is not minimum if defined.
*/
 
/* #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2 */
#define CONFIGURE_INTERRUPT_STACK_MEMORY (4 * 1024)
 
#if 0
#include <sh/null.h>
#define BSP_CONSOLE_DEVNAME "/dev/null"
#define BSP_CONSOLE_DRIVER_TABLE_ENTRY DEVNULL_DRIVER_TABLE_ENTRY
#else
#include <sh/sci.h>
#define BSP_CONSOLE_DEVNAME "/dev/sci1"
#define BSP_CONSOLE_DRIVER_TABLE_ENTRY DEVSCI_DRIVER_TABLE_ENTRY
#endif
 
/*
* Define the time limits for RTEMS Test Suite test durations.
* Long test and short test duration limits are provided. These
* values are in seconds and need to be converted to ticks for the
* application.
*
*/
 
#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */
#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */
 
/*
* Stuff for Time Test 27
*/
 
#define MUST_WAIT_FOR_INTERRUPT 0
 
#define Install_tm27_vector( handler ) \
{ \
rtems_isr_entry ignored ; \
rtems_interrupt_catch( (handler), 0, &ignored ) ; \
}
 
#define Cause_tm27_intr()
 
#define Clear_tm27_intr()
 
#define Lower_tm27_intr()
 
/* Constants */
 
/*
* Simple spin delay in microsecond units for device drivers.
* This is very dependent on the clock speed of the target.
*/
 
#define delay( microseconds ) CPU_delay(microseconds)
#define sh_delay( microseconds ) CPU_delay( microseconds )
 
 
/*
* Defined in the linker script 'linkcmds'
*/
 
extern unsigned32 HeapStart ;
extern unsigned32 HeapEnd ;
extern unsigned32 WorkSpaceStart ;
extern unsigned32 WorkSpaceEnd ;
 
extern void *CPU_Interrupt_stack_low ;
extern void *CPU_Interrupt_stack_high ;
 
/* miscellaneous stuff assumed to exist */
 
extern rtems_configuration_table BSP_Configuration;
 
extern void bsp_cleanup( void );
 
/*
* Device Driver Table Entries
*/
 
/*
* We redefine CONSOLE_DRIVER_TABLE_ENTRY to redirect /dev/console
*/
#undef CONSOLE_DRIVER_TABLE_ENTRY
#define CONSOLE_DRIVER_TABLE_ENTRY \
BSP_CONSOLE_DRIVER_TABLE_ENTRY, \
{ console_initialize, console_open, console_close, \
console_read, console_write, console_control }
/*
* NOTE: Use the standard Clock driver entry
*/
 
#ifdef __cplusplus
}
#endif
 
#endif
/* end of include file */
/gensh2/scitab/Makefile.am
0,0 → 1,35
##
## $Id: Makefile.am,v 1.2 2001-09-27 12:01:12 chris Exp $
##
 
AUTOMAKE_OPTIONS = foreign 1.4
 
PGM = $(ARCH)/scitab.rel
 
C_FILES = scitab.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
 
OBJS = $(C_O_FILES)
 
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../../../../../../automake/lib.am
 
SHGEN = $(PROJECT_ROOT)/tools/cpu/sh/shgen
 
#
# (OPTIONAL) Add local stuff here using +=
#
 
$(PGM): $(OBJS)
$(make-rel)
 
scitab.c: $(SHGEN)
$(SHGEN) -H $(HZ) sci > $@
 
# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
 
all-local: $(ARCH) $(OBJS) $(PGM)
 
.PRECIOUS: $(PGM)
 
include $(top_srcdir)/../../../../../../automake/local.am
/gensh2/configure.in
0,0 → 1,32
dnl Process this file with autoconf to produce a configure script.
dnl
dnl $Id: configure.in,v 1.2 2001-09-27 12:01:11 chris Exp $
 
AC_PREREQ(2.13)
AC_INIT(bsp_specs)
RTEMS_TOP(../../../../../..)
AC_CONFIG_AUX_DIR(../../../../../..)
 
RTEMS_CANONICAL_TARGET_CPU
AM_INIT_AUTOMAKE(rtems-c-src-lib-libbsp-sh-gensh2,$RTEMS_VERSION,no)
AM_MAINTAINER_MODE
 
RTEMS_PROG_CC_FOR_TARGET
RTEMS_CANONICALIZE_TOOLS
 
RTEMS_ENV_RTEMSBSP
RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
RTEMS_CHECK_BSP_CACHE(RTEMS_BSP)
RTEMS_CANONICAL_HOST
 
RTEMS_PROJECT_ROOT
 
# Explicitly list all Makefiles here
AC_OUTPUT(
Makefile
console/Makefile
include/Makefile
scitab/Makefile
start/Makefile
startup/Makefile
wrapup/Makefile)
/gensh2/Makefile.am
0,0 → 1,17
##
## $Id: Makefile.am,v 1.2 2001-09-27 12:01:11 chris Exp $
##
 
AUTOMAKE_OPTIONS = foreign 1.4
ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
 
## wrapup is the one that actually builds and installs the library
## from the individual .rel files built in other directories
SUBDIRS = include start startup scitab console wrapup
 
include $(top_srcdir)/../../bsp.am
 
EXTRA_DIST = bsp_specs
 
include $(top_srcdir)/../../../../../../automake/subdirs.am
include $(top_srcdir)/../../../../../../automake/local.am
/gensh2/README
0,0 → 1,60
#
# $Id: README,v 1.2 2001-09-27 12:01:11 chris Exp $
#
# Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
# Adapted by: John Mills (jmills@tga.com)
#
 
BSP NAME: generic SH2 (gensh2)
BOARD: n/a
BUS: n/a
CPU FAMILY: Hitachi SH
CPU: SH 7045F
COPROCESSORS: none
MODE: n/a
 
DEBUG MONITOR: gdb
 
PERIPHERALS
===========
TIMERS: on-chip
RESOLUTION: cf. Hitachi SH 704X Hardware Manual (Phi/4)
SERIAL PORTS: on-chip (with 2 ports)
REAL-TIME CLOCK: none
DMA: not used
VIDEO: none
SCSI: none
NETWORKING: none
 
DRIVER INFORMATION
==================
CLOCK DRIVER: on-chip timer
IOSUPP DRIVER: default
SHMSUPP: default
TIMER DRIVER: on-chip timer
TTY DRIVER: /dev/null (stub)
 
STDIO
=====
PORT: /dev/null (stub)
ELECTRICAL: n/a
BAUD: n/a
BITS PER CHARACTER: n/a
PARITY: n/a
STOP BITS: n/a
 
NOTES
=====
 
(1) Only stub console driver available at the moment.
Driver for the on-chip serial devices (sci) will be available soon.
 
(2) The present 'hw_init.c' file provides 'early_hw_init'(void) which
is normally called from 'start.S' to provide such minimal HW setup
as is conveniently written in 'C' and can make use of global
symbols for 7045F processor elements. It also provides
'void bsp_hw_init (void)' normally called from 'bspstart.c', shortly
before RTEMS itself is started.
 
These are both minimal functions intended to support the RTEMS test
suites.
/gensh2/start/Makefile.am
0,0 → 1,30
##
## $Id: Makefile.am,v 1.2 2001-09-27 12:01:12 chris Exp $
##
 
AUTOMAKE_OPTIONS = foreign 1.4
 
PGMS = $(ARCH)/start.o
 
S_FILES = start.S
S_O_FILES = $(S_FILES:%.S=$(ARCH)/%.o)
 
OBJS = $(S_O_FILES)
 
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../../../../../../automake/lib.am
 
#
# (OPTIONAL) Add local stuff here using +=
#
 
$(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o: $(PGMS)
$(INSTALL_DATA) $< $@
 
TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o
 
all-local: $(ARCH) $(OBJS) $(TMPINSTALL_FILES)
 
EXTRA_DIST = start.S start.ram start.rom
 
include $(top_srcdir)/../../../../../../automake/local.am
/gensh2/start/start.rom
0,0 → 1,94
/*
* Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
* Bernd Becker (becker@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
*
* 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) 1998.
* On-Line Applications Research Corporation (OAR).
* Copyright assigned to U.S. Government, 1994.
*
* 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: start.rom,v 1.2 2001-09-27 12:01:12 chris Exp $
*/
 
#include "asm.h"
 
BEGIN_CODE
PUBLIC(start)
SYM (start):
! install the stack pointer
mov.l stack_k,r15
 
! zero out bss
mov.l edata_k,r0
mov.l end_k,r1
mov #0,r2
0:
mov.l r2,@r0
add #4,r0
cmp/ge r0,r1
bt 0b
 
! copy the vector table from rom to ram
mov.l vects_k,r0 ! vectab
mov #0,r1 ! address of boot vector table
mov #0,r2 | number of bytes copied
mov.w vects_size,r3 ! size of entries in vectab
1:
mov.l @r1+,r4
mov.l r4,@r0
add #4,r0
add #1,r2
cmp/hi r3,r2
bf 1b
 
mov.l vects_k,r0 ! update vbr to point to vectab
ldc r0,vbr
 
! call the mainline
mov #0,r4 ! argc
mov.l main_k,r0
jsr @r0
mov #0,r5 ! argv
 
! call exit
mov r0,r4
mov.l exit_k,r0
jsr @r0
or r0,r0
 
END_CODE
 
.align 2
stack_k:
.long SYM(stack)
edata_k:
.long SYM(edata)
end_k:
.long SYM(end)
main_k:
.long SYM(boot_card)
exit_k:
.long SYM(exit)
 
vects_k:
.long SYM(vectab)
vects_size:
.word 255
 
#ifdef __ELF__
.section .stack,"aw"
#else
.section .stack
#endif
SYM(stack):
.long 0xdeaddead
/gensh2/start/start.ram
0,0 → 1,199
/*
* Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
* Bernd Becker (becker@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
*
* 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) 1998.
* On-Line Applications Research Corporation (OAR).
* Copyright assigned to U.S. Government, 1994.
*
* 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.
*
* Modified to reflect Hitachi EDK SH7045F:
* John M. Mills (jmills@tga.com)
* TGA Technologies, Inc.
* 100 Pinnacle Way, Suite 140
* Norcross, GA 30071 U.S.A.
*
*
* This modified file may be copied and distributed in accordance
* the above-referenced license. It is provided for critique and
* developmental purposes without any warranty nor representation
* by the authors or by TGA Technologies.
*
* $Id: start.ram,v 1.2 2001-09-27 12:01:12 chris Exp $
*/
 
#include "asm.h"
 
BEGIN_CODE
PUBLIC(start)
 
SYM (start):
! install the stack pointer
mov.l stack_k,r15
 
#ifdef START_HW_INIT /* from $RTEMS_BSP.cfg */
! Initialize minimal hardware
mov.l hw_init_k, r0
jsr @r0
nop !debug dead-slot target
#endif /* START_HW_INIT */
 
! zero out bss
mov.l edata_k,r0
mov.l end_k,r1
mov #0,r2
0:
mov.l r2,@r0
add #4,r0
cmp/ge r0,r1
bt 0b
nop !debug dead-slot target
 
! copy the vector table from rom to ram
mov.l vects_k,r0 ! vectab
mov #0,r1 ! address of boot vector table
mov #0,r2 ! number of bytes copied
mov.w vects_size,r3 ! size of entries in vectab
1:
mov.l @r1+,r4
mov.l r4,@r0
add #4,r0
add #1,r2
cmp/hi r3,r2
bf 1b
nop !debug dead-slot target
 
! overlay monitor vectors onto RTEMS table template
! code adapted from Hitachi EDK7045F User Manual: "Copyvect.s"
mova vects_k,r0
mov.l @r0, r1 ! Shadow vect tbl addr
stc vbr, r2 ! Original vect tbl addr
and #0, r0
mov r0, r4 ! 0 in r4 and r0
 
!trapa #32
or #0x80, r0
mov.l @(r0,r2), r3
mov.l r3, @(r0, r1)
mov r4, r0
 
!cpu addr err
or #0x24, r0
mov.l @(r0, r2), r3
mov.l r3, @(r0, r1)
mov r4, r0
 
!ill slot
or #0x18, r0
mov.l @(r0, r2), r3
mov.l r3, @(r0, r1)
mov r4, r0
 
!ill inst
or #0x10, r0
mov.l @(r0, r2), r3
mov.l r3, @(r0, r1)
mov r4, r0
 
!nmi
or #0x2c, r0
mov.l @(r0, r2), r3
mov.l r3, @(r0, r1)
mov r4, r0
 
!User brk
or #0x30, r0
mov.l @(r0, r2), r3
mov.l r3, @(r0, r1)
mov r4, r0
 
!sci0 err
or #0x80, r0
rotl r0
rotl r0
mov.l @(r0, r2), r3
mov.l r3, @(r0, r1)
mov r4, r0
!sci rx
or #0x81, r0
rotl r0
rotl r0
mov.l @(r0, r2), r3
mov.l r3, @(r0, r1)
 
stc vbr,r3 ! capture copy of monitor vbr
mov.l vbrtemp_k,r0
mov.l r3, @r0
mov.l vects_k,r0 ! point vbr to vectab
ldc r0,vbr
 
! call the mainline
mov #0,r4 ! argc
mov #0,r5 ! argv - can place in dead slot
mov.l main_k,r0
jsr @r0
nop !debug dead-slot target
 
! call exit
mov r0,r4
mov.l exit_k,r0
or r0,r0
jsr @r0
nop !debug dead-slot target
 
mov.l vbrtemp_k,r0 ! restore original vbr
mov.l @r0,r3
ldc r3, vbr
trapa #13 ! UBR capture by monitor
nop !debug dead-slot target
 
END_CODE
 
.align 2
stack_k:
.long SYM(stack)
edata_k:
.long SYM(edata)
end_k:
.long SYM(end)
main_k:
.long SYM(boot_card)
exit_k:
.long SYM(exit)
#ifdef START_HW_INIT /* from $RTEMS_BSP.cfg */
hw_init_k:
.long SYM(hw_initialize)
#endif /* START_HW_INIT */
vbrtemp_k:
.long SYM(vbrtemp)
vects_k:
.long SYM(vectab)
vects_size:
.word 255
 
#ifdef __ELF__
.section .stack,"aw"
#else
.section .stack
#endif
SYM(stack):
.long 0xdeaddead
 
#ifdef __ELF__
.section .bss,"aw"
#else
.section .bss
#endif
SYM(vbrtemp):
.long 0x0
 
/gensh2/start/start.S
0,0 → 1,196
/*
* Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
* Bernd Becker (becker@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
*
* 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.
*
* Modified to reflect Hitachi EDK SH7045F:
* John M. Mills (jmills@tga.com)
* TGA Technologies, Inc.
* 100 Pinnacle Way, Suite 140
* Norcross, GA 30071 U.S.A.
*
*
* This modified file may be copied and distributed in accordance
* the above-referenced license. It is provided for critique and
* developmental purposes without any warranty nor representation
* by the authors or by TGA Technologies.
*
* COPYRIGHT (c) 1999.
* On-Line Applications Research Corporation (OAR).
* Copyright assigned to U.S. Government, 1994.
*
* 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: start.S,v 1.2 2001-09-27 12:01:12 chris Exp $
*/
 
#include "asm.h"
 
BEGIN_CODE
PUBLIC(start)
 
SYM (start):
! install the stack pointer
mov.l stack_k,r15
 
#ifdef START_HW_INIT /* from $RTEMS_BSP.cfg */
! Initialize minimal hardware
mov.l hw_init_k, r0
jsr @r0
nop !dead slot
#endif /* START_HW_INIT */
 
! zero out bss
mov.l edata_k,r0
mov.l end_k,r1
mov #0,r2
0:
mov.l r2,@r0
add #4,r0
cmp/ge r0,r1
bt 0b
 
! copy the vector table from rom to ram
mov.l vects_k,r0 ! vectab
mov #0,r1 ! address of boot vector table
mov #0,r2 ! number of bytes copied
mov.w vects_size,r3 ! size of entries in vectab
1:
mov.l @r1+,r4
mov.l r4,@r0
add #4,r0
add #1,r2
cmp/hi r3,r2
bf 1b
 
#ifndef STANDALONE_EVB
! overlay monitor vectors onto RTEMS table template
! code adapted from Hitachi EDK7045F User Manual: "Copyvect.s"
mova vects_k,r0
mov.l @r0, r1 ! Shadow vect tbl addr
stc vbr, r2 ! Original vect tbl addr
and #0, r0
mov r0, r4 ! 0 in r4 and r0
 
!trapa #32
or #0x80, r0
mov.l @(r0,r2), r3
mov.l r3, @(r0, r1)
mov r4, r0
 
!cpu addr err
or #0x24, r0
mov.l @(r0, r2), r3
mov.l r3, @(r0, r1)
mov r4, r0
 
!ill slot
or #0x18, r0
mov.l @(r0, r2), r3
mov.l r3, @(r0, r1)
mov r4, r0
 
!ill inst
or #0x10, r0
mov.l @(r0, r2), r3
mov.l r3, @(r0, r1)
mov r4, r0
 
!nmi
or #0x2c, r0
mov.l @(r0, r2), r3
mov.l r3, @(r0, r1)
mov r4, r0
 
!User brk
or #0x30, r0
mov.l @(r0, r2), r3
mov.l r3, @(r0, r1)
mov r4, r0
 
!sci0 err
or #0x80, r0
rotl r0
rotl r0
mov.l @(r0, r2), r3
mov.l r3, @(r0, r1)
mov r4, r0
!sci rx
or #0x81, r0
rotl r0
rotl r0
mov.l @(r0, r2), r3
mov.l r3, @(r0, r1)
 
stc vbr,r3 ! capture copy of monitor vbr
mov.l vbrtemp_k,r0
mov.l r3, @r0
mov.l vects_k,r0 ! point vbr to vectab
ldc r0,vbr
#endif ! STANDALONE_EVB
 
! call the mainline
mov #0,r4 ! argc
mov.l main_k,r0
jsr @r0
mov #0,r5 ! argv - can place in dead slot
 
! call exit
mov r0,r4
mov.l exit_k,r0
jsr @r0
or r0,r0
 
mov.l vbrtemp_k,r0 ! restore original vbr
mov.l @r0,r3
ldc r3, vbr
trapa #13 ! UBR capture by monitor
nop !debug dead-slot target
 
END_CODE
 
.align 2
stack_k:
.long SYM(stack)
edata_k:
.long SYM(edata)
end_k:
.long SYM(end)
main_k:
.long SYM(boot_card)
exit_k:
.long SYM(exit)
#ifdef START_HW_INIT /* from $RTEMS_BSP.cfg */
hw_init_k:
.long SYM(early_hw_init)
#endif /* START_HW_INIT */
vbrtemp_k:
.long SYM(vbrtemp)
vects_k:
.long SYM(vectab)
vects_size:
.word 255
 
#ifdef __ELF__
.section .stack,"aw"
#else
.section .stack
#endif
SYM(stack):
.long 0xdeaddead
 
#ifdef __ELF__
.section .bss,"aw"
#else
.section .bss
#endif
SYM(vbrtemp):
.long 0x0
 
/gensh2/wrapup/Makefile.am
0,0 → 1,39
##
## $Id: Makefile.am,v 1.2 2001-09-27 12:01:12 chris Exp $
##
## build and install libbsp
##
 
AUTOMAKE_OPTIONS = foreign 1.4
 
BSP_PIECES = startup scitab console
 
# pieces to pick up out of libcpu/sh
CPU_PIECES = null clock timer sci
 
# bummer; have to use $foreach since % pattern subst rules only replace 1x
OBJS = $(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \
$(foreach piece, $(CPU_PIECES), ../../../../libcpu/$(RTEMS_CPU)/sh7045/$(piece)/$(ARCH)/$(piece).rel)
 
LIB = $(ARCH)/libbsp.a
 
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(top_srcdir)/../../../../../../automake/lib.am
 
#
# (OPTIONAL) Add local stuff here using +=
#
 
$(LIB): $(OBJS)
$(make-library)
 
$(PROJECT_RELEASE)/lib/libbsp$(LIB_VARIANT).a: $(LIB)
$(INSTALL_DATA) $< $@
 
TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/libbsp$(LIB_VARIANT).a
 
all-local: $(ARCH) $(OBJS) $(LIB) $(TMPINSTALL_FILES)
 
.PRECIOUS: $(LIB)
 
include $(top_srcdir)/../../../../../../automake/local.am
/shared/console.c
0,0 → 1,153
/*
* /dev/console for Hitachi SH 703X
*
* The SH doesn't have a designated console device. Therefore we "alias"
* another device as /dev/console and revector all calls to /dev/console
* to this device.
*
* This approach is similar to installing a sym-link from one device to
* another device. If rtems once will support sym-links for devices files,
* this implementation could be dropped.
*
* Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
*
* 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) 1998.
* On-Line Applications Research Corporation (OAR).
* Copyright assigned to U.S. Government, 1994.
*
* 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: console.c,v 1.2 2001-09-27 12:01:12 chris Exp $
*/
 
#include <bsp.h>
#include <rtems.h>
#include <rtems/libio.h>
#include <iosupp.h>
 
#ifndef BSP_CONSOLE_DEVNAME
#error Missing BSP_CONSOLE_DEVNAME
#endif
 
static rtems_driver_name_t *low_level_device_info = NULL ;
 
/* console_initialize
*
* This routine initializes the console IO driver.
*
* Input parameters: NONE
*
* Output parameters: NONE
*
* Return values:
*/
 
rtems_device_driver console_initialize(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *arg
)
{
rtems_device_driver status ;
status = rtems_io_register_name(
"/dev/console",
major,
(rtems_device_minor_number) 0
);
 
if (status != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred(status);
 
status = rtems_io_lookup_name( BSP_CONSOLE_DEVNAME,
&low_level_device_info );
if (status != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred(status);
 
return RTEMS_SUCCESSFUL;
}
 
 
/*
* Open entry point
*/
 
rtems_device_driver console_open(
rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
)
{
return rtems_io_open( low_level_device_info->major,
low_level_device_info->minor,
arg );
}
/*
* Close entry point
*/
 
rtems_device_driver console_close(
rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
)
{
return rtems_io_close( low_level_device_info->major,
low_level_device_info->minor,
arg );
}
 
/*
* read bytes from the serial port. We only have stdin.
*/
 
rtems_device_driver console_read(
rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
)
{
return rtems_io_read( low_level_device_info->major,
low_level_device_info->minor,
arg );
}
 
/*
* write bytes to the serial port. Stdout and stderr are the same.
*/
 
rtems_device_driver console_write(
rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
)
{
return rtems_io_write( low_level_device_info->major,
low_level_device_info->minor,
arg );
}
 
/*
* IO Control entry point
*/
 
rtems_device_driver console_control(
rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
)
{
return rtems_io_control( low_level_device_info->major,
low_level_device_info->minor,
arg );
}
/shared/Makefile.am
0,0 → 1,11
##
## $Id: Makefile.am,v 1.2 2001-09-27 12:01:12 chris Exp $
##
 
AUTOMAKE_OPTIONS = foreign 1.4
 
C_FILES = console.c setvec.c
 
EXTRA_DIST = console.c setvec.c
 
include $(top_srcdir)/../../../../../automake/local.am
/shared/setvec.c
0,0 → 1,58
/* set_vector
*
* NOTE: This function is considered OBSOLETE and may vanish soon.
* Calls to set_vector should be replaced by calls to
* rtems_interrupt_catch or _CPU_ISR_install_raw_handler.
*
* This routine installs an interrupt vector on the target Board/CPU.
* This routine is allowed to be as board dependent as necessary.
*
* INPUT:
* handler - interrupt handler entry point
* vector - vector number
* type - 0 indicates raw hardware connect
* 1 indicates RTEMS interrupt connect
*
* RETURNS:
* address of previous interrupt handler
*
* Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
* Bernd Becker (becker@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
*
* 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) 1998.
* On-Line Applications Research Corporation (OAR).
* Copyright assigned to U.S. Government, 1994.
*
* 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: setvec.c,v 1.2 2001-09-27 12:01:12 chris Exp $
*/
 
#include <rtems.h>
#include <bsp.h>
 
sh_isr_entry set_vector( /* returns old vector */
rtems_isr_entry handler, /* isr routine */
rtems_vector_number vector, /* vector number */
int type /* RTEMS or RAW intr */
)
{
sh_isr_entry previous_isr;
 
if ( type )
rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
else {
_CPU_ISR_install_raw_handler( vector, handler, (proc_ptr*) &previous_isr );
}
 
return previous_isr;
}
/Makefile.am
0,0 → 1,12
##
## $Id: Makefile.am,v 1.2 2001-09-27 12:01:09 chris Exp $
##
 
AUTOMAKE_OPTIONS = foreign 1.4
ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal
 
# Descend into the $(RTEMS_BSP_FAMILY) directory
SUBDIRS = shared $(RTEMS_BSP_FAMILY)
 
include $(top_srcdir)/../../../../../automake/subdirs.am
include $(top_srcdir)/../../../../../automake/local.am

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.