URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
[/] [or1k/] [trunk/] [rtems-20020807/] [c/] [src/] [lib/] [libbsp/] [sh/] [gensh2/] [start/] [start.S] - Rev 1765
Compare with Previous | Blame | View Log
/** 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).** 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.** start.S,v 1.3 2001/10/12 21:05:26 joel Exp*/#include "asm.h"BEGIN_CODEPUBLIC(start)SYM (start):! install the stack pointermov.l stack_k,r15#ifdef START_HW_INIT /* from $RTEMS_BSP.cfg */! Initialize minimal hardwaremov.l hw_init_k, r0jsr @r0nop !dead slot#endif /* START_HW_INIT */! zero out bssmov.l edata_k,r0mov.l end_k,r1mov #0,r20:mov.l r2,@r0add #4,r0cmp/ge r0,r1bt 0b! copy the vector table from rom to rammov.l vects_k,r0 ! vectabmov #0,r1 ! address of boot vector tablemov #0,r2 ! number of bytes copiedmov.w vects_size,r3 ! size of entries in vectab1:mov.l @r1+,r4mov.l r4,@r0add #4,r0add #1,r2cmp/hi r3,r2bf 1b#ifndef STANDALONE_EVB! overlay monitor vectors onto RTEMS table template! code adapted from Hitachi EDK7045F User Manual: "Copyvect.s"mova vects_k,r0mov.l @r0, r1 ! Shadow vect tbl addrstc vbr, r2 ! Original vect tbl addrand #0, r0mov r0, r4 ! 0 in r4 and r0!trapa #32or #0x80, r0mov.l @(r0,r2), r3mov.l r3, @(r0, r1)mov r4, r0!cpu addr error #0x24, r0mov.l @(r0, r2), r3mov.l r3, @(r0, r1)mov r4, r0!ill slotor #0x18, r0mov.l @(r0, r2), r3mov.l r3, @(r0, r1)mov r4, r0!ill instor #0x10, r0mov.l @(r0, r2), r3mov.l r3, @(r0, r1)mov r4, r0!nmior #0x2c, r0mov.l @(r0, r2), r3mov.l r3, @(r0, r1)mov r4, r0!User brkor #0x30, r0mov.l @(r0, r2), r3mov.l r3, @(r0, r1)mov r4, r0!sci0 error #0x80, r0rotl r0rotl r0mov.l @(r0, r2), r3mov.l r3, @(r0, r1)mov r4, r0!sci rxor #0x81, r0rotl r0rotl r0mov.l @(r0, r2), r3mov.l r3, @(r0, r1)stc vbr,r3 ! capture copy of monitor vbrmov.l vbrtemp_k,r0mov.l r3, @r0mov.l vects_k,r0 ! point vbr to vectabldc r0,vbr#endif ! STANDALONE_EVB! call the mainlinemov #0,r4 ! argcmov.l main_k,r0jsr @r0mov #0,r5 ! argv - can place in dead slot! call exitmov r0,r4mov.l exit_k,r0jsr @r0or r0,r0mov.l vbrtemp_k,r0 ! restore original vbrmov.l @r0,r3ldc r3, vbrtrapa #13 ! UBR capture by monitornop !debug dead-slot targetEND_CODE.align 2stack_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#endifSYM(stack):.long 0xdeaddead#ifdef __ELF__.section .bss,"aw"#else.section .bss#endifSYM(vbrtemp):.long 0x0
