source: rtems/cpukit/score/cpu/arm/cpu_asm.S @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on May 3, 2012 at 3:09:24 PM

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup ScoreCPU
5 *
6 * @brief ARM architecture support implementation.
7 */
8
9/*
10 *  This file contains all assembly code for the ARM implementation
11 *  of RTEMS.
12 *
13 *  Copyright (c) 2007 by Ray Xu, <Rayx.cn@gmail.com>
14 *          Thumb support added.
15 *
16 *  Copyright (c) 2002 by Advent Networks, Inc.
17 *          Jay Monkman <jmonkman@adventnetworks.com>
18 *
19 *  COPYRIGHT (c) 2000 Canon Research Centre France SA.
20 *  Emmanuel Raguet, mailto:raguet@crf.canon.fr
21 *
22 *  The license and distribution terms for this file may be
23 *  found in the file LICENSE in this distribution or at
24 *  http://www.rtems.com/license/LICENSE.
25 *
26 */
27
28#ifdef HAVE_CONFIG_H
29#include "config.h"
30#endif
31
32#include <rtems/asm.h>
33#include <rtems/score/cpu_asm.h>
34
35#ifdef ARM_MULTILIB_ARCH_V4
36
37        .text
38
39/*
40 *  void _CPU_Context_switch( run_context, heir_context )
41 *  void _CPU_Context_restore( run_context, heir_context )
42 *
43 *  This routine performs a normal non-FP context.
44 *
45 *  R0 = run_context    R1 = heir_context
46 *
47 *  This function copies the current registers to where r0 points, then
48 *  restores the ones from where r1 points.
49 *
50 *  Using the ldm/stm opcodes save 2-3 us on 100 MHz ARM9TDMI with
51 *  a 16 bit data bus.
52 *
53 */
54
55DEFINE_FUNCTION_ARM(_CPU_Context_switch)
56/* Start saving context */
57        mrs     r2, cpsr
58        stmia   r0,  {r2, r4, r5, r6, r7, r8, r9, r10, r11, r13, r14}
59
60
61/* Start restoring context */
62_restore:
63        ldmia   r1,  {r2, r4, r5, r6, r7, r8, r9, r10, r11, r13, r14}
64        msr     cpsr, r2
65#ifdef __thumb__
66        bx      lr
67        nop
68#else
69        mov     pc, lr
70#endif
71/*
72 *  void _CPU_Context_restore( new_context )
73 *
74 *  This function copies the restores the registers from where r0 points.
75 *  It must match _CPU_Context_switch()
76 *
77 */
78DEFINE_FUNCTION_ARM(_CPU_Context_restore)
79        mov     r1, r0
80        b       _restore
81
82#endif /* ARM_MULTILIB_ARCH_V4 */
Note: See TracBrowser for help on using the repository browser.