source: rtems/c/src/lib/libbsp/arm/gba/startup/cpu_asm.S @ 3c7ed6b

4.104.114.84.9
Last change on this file since 3c7ed6b was 3c7ed6b, checked in by Joel Sherrill <joel.sherrill@…>, on Jul 6, 2005 at 6:46:04 PM

2005-07-06 Markku Puro <markku.puro@…>

  • .cvsignore, ChangeLog?, Makefile.am, README, bsp_specs, configure.ac, clock/clockdrv.c, console/conio.c, console/console.c, console/defaultfont.c, include/arm_mode_bits.h, include/asm_macros.h, include/bsp.h, include/bspopts.h.in, include/conio.h, include/gba.h, include/gba_registers.h, include/tm27.h, irq/bsp_irq_asm.S, irq/bsp_irq_init.c, irq/irq.c, irq/irq.h, irq/irq_asm.S, irq/irq_init.c, start/logo.S, start/start.S, startup/bspstart.c, startup/cpu.c, startup/cpu_asm.S, startup/exit.c, startup/linkcmds, timer/timer.c: New files.
  • Property mode set to 100644
File size: 2.2 KB
Line 
1/**
2 *  @file cpu_asm.S
3 *
4 *  This file contains the implementation of exception handlers.
5 */
6/*
7 *  RTEMS GBA BSP
8 *
9 *  Copyright (c) 2002 by Advent Networks, Inc.
10 *      Jay Monkman <jmonkman@adventnetworks.com>
11 *
12 *  COPYRIGHT (c) 2000 Canon Research Centre France SA.
13 *      Emmanuel Raguet, mailto:raguet@crf.canon.fr
14 *
15 *  Copyright (c) 2004
16 *      Markku Puro <markku.puro@kopteri.net>
17 *
18 *  The license and distribution terms for this file may be
19 *  found in found in the file LICENSE in this distribution or at
20 *  http://www.rtems.com/license/LICENSE.
21 *
22 *  $Id$
23 */
24
25#define __asm__
26#include <rtems/asm.h>
27#include <rtems/score/cpu_asm.h>
28#include <asm_macros.h>
29/* @cond  INCLUDE_ASM */
30
31/**
32 *  This routine performs a normal non-FP context.
33 *  function void _CPU_Context_switch( run_context, heir_context )
34 *  R0 = run_context    R1 = heir_context
35 *
36 *  This function copies the current registers to where r0 points, then
37 *  restores the ones from where r1 points.
38 *
39 *  Using the ldm/stm opcodes save 2-3 us on 100 MHz ARM9TDMI with
40 *  a 16 bit data bus.
41 *
42 */
43    .align
44/* .section  .iwram   */
45PUBLIC_ARM_FUNCTION(_CPU_Context_switch)
46/* Start saving context */
47        mrs     r2, cpsr
48        stmia   r0,  {r2, r4, r5, r6, r7, r8, r9, r10, r11, r13, r14}
49/* Start restoring context */
50_restore:
51        ldmia   r1,  {r2, r4, r5, r6, r7, r8, r9, r10, r11, r13, r14}
52        msr     cpsr, r2
53        mov     pc, lr
54LABEL_END(_CPU_Context_switch)
55
56/**
57 * This function copies the restores the registers from where r0 points.
58 * function void _CPU_Context_restore( new_context )
59 * It must match _CPU_Context_switch()
60 *
61 */
62PUBLIC_ARM_FUNCTION(_CPU_Context_restore)
63        mov     r1, r0
64        b       _restore
65LABEL_END(_CPU_Context_restore)
66
67/**
68 * function _Exception_Handler_Undef_Swi
69 * Can't use exception vectors in GBA
70 * @todo  _Exception_Handler_Undef_Swi: Unused handler needed by ../score/cpu_asm.S
71 *
72 */
73        .global _Exception_Handler_Undef_Swi
74_Exception_Handler_Undef_Swi:
75        mov     pc, lr
76
77/**
78 * function _Exception_Handler_Abort
79 * Can't use exception vectors in GBA
80 * @todo  _Exception_Handler_Abort: Unused handler needed by ../score/cpu_asm.S
81 *
82 */
83        .global _Exception_Handler_Abort
84_Exception_Handler_Abort:
85        mov     pc, lr
86/* @endcond     */
Note: See TracBrowser for help on using the repository browser.