1 |
786 |
skrzyp |
// #========================================================================
|
2 |
|
|
// #
|
3 |
|
|
// # mcfxxxx_asm.S
|
4 |
|
|
// #
|
5 |
|
|
// # Miscellaneous assembler support functions for an mcfxxxx
|
6 |
|
|
// #
|
7 |
|
|
// #========================================================================
|
8 |
|
|
//=============================================================================
|
9 |
|
|
// ####ECOSGPLCOPYRIGHTBEGIN####
|
10 |
|
|
// -------------------------------------------
|
11 |
|
|
// This file is part of eCos, the Embedded Configurable Operating System.
|
12 |
|
|
// Copyright (C) 2008 Free Software Foundation, Inc.
|
13 |
|
|
//
|
14 |
|
|
// eCos is free software; you can redistribute it and/or modify it under
|
15 |
|
|
// the terms of the GNU General Public License as published by the Free
|
16 |
|
|
// Software Foundation; either version 2 or (at your option) any later
|
17 |
|
|
// version.
|
18 |
|
|
//
|
19 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT
|
20 |
|
|
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
21 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
22 |
|
|
// for more details.
|
23 |
|
|
//
|
24 |
|
|
// You should have received a copy of the GNU General Public License
|
25 |
|
|
// along with eCos; if not, write to the Free Software Foundation, Inc.,
|
26 |
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
27 |
|
|
//
|
28 |
|
|
// As a special exception, if other files instantiate templates or use
|
29 |
|
|
// macros or inline functions from this file, or you compile this file
|
30 |
|
|
// and link it with other works to produce a work based on this file,
|
31 |
|
|
// this file does not by itself cause the resulting work to be covered by
|
32 |
|
|
// the GNU General Public License. However the source code for this file
|
33 |
|
|
// must still be made available in accordance with section (3) of the GNU
|
34 |
|
|
// General Public License v2.
|
35 |
|
|
//
|
36 |
|
|
// This exception does not invalidate any other reasons why a work based
|
37 |
|
|
// on this file might be covered by the GNU General Public License.
|
38 |
|
|
// -------------------------------------------
|
39 |
|
|
// ####ECOSGPLCOPYRIGHTEND####
|
40 |
|
|
//============================================================================
|
41 |
|
|
//###DESCRIPTIONBEGIN####
|
42 |
|
|
//
|
43 |
|
|
// Author(s): bartv
|
44 |
|
|
// Date: 2008-01-14
|
45 |
|
|
//
|
46 |
|
|
//###DESCRIPTIONEND####
|
47 |
|
|
//========================================================================
|
48 |
|
|
|
49 |
|
|
#include
|
50 |
|
|
#include
|
51 |
|
|
#include
|
52 |
|
|
|
53 |
|
|
.file "mcfxxxx_asm.S"
|
54 |
|
|
|
55 |
|
|
#ifdef CYGINT_HAL_M68K_MCFxxxx_SOFTWARE_PROFILE_TIMER
|
56 |
|
|
// See also hal_enable_profile_timer() in mcfxxxx.c
|
57 |
|
|
|
58 |
|
|
// This VSR should call __profile_hit() with a single argument,
|
59 |
|
|
// the interrupted PC. The VSR has been installed as a
|
60 |
|
|
// high-priority interrupt source, so there is no need to worry
|
61 |
|
|
// about nested interrupts or an interrupt stack.
|
62 |
|
|
.extern __profile_hit
|
63 |
|
|
|
64 |
|
|
FUNC_START(hal_mcfxxxx_profile_vsr)
|
65 |
|
|
// On entry sp[0] holds sr and sp[1] holds the pc.
|
66 |
|
|
// Save the caller-save integer registers. There are no floating
|
67 |
|
|
// point registers to worry about. Make space for the argument
|
68 |
|
|
// to __profile_hit() while we are at it.
|
69 |
|
|
sub.l #20, %sp
|
70 |
|
|
movem.l %d0-%d1/%a0-%a1, 4(%sp)
|
71 |
|
|
|
72 |
|
|
// Now pick up the interrupted PC from its new offset and push it
|
73 |
|
|
// on the stack for __profile_hit().
|
74 |
|
|
move.l 24(%sp),(%sp)
|
75 |
|
|
jbsr __profile_hit
|
76 |
|
|
|
77 |
|
|
// The timer runs in restart mode, but the interrupt bit has to be reset.
|
78 |
|
|
move.l # (HAL_MCFxxxx_PITx_PCSR_PRE_64 + HAL_MCFxxxx_PITx_PCSR_OVW + \
|
79 |
|
|
HAL_MCFxxxx_PITx_PCSR_PIE + HAL_MCFxxxx_PITx_PCSR_PIF + \
|
80 |
|
|
HAL_MCFxxxx_PITx_PCSR_RLD + HAL_MCFxxxx_PITx_PCSR_EN), %d0
|
81 |
|
|
move.w %d0, HAL_MCFxxxx_PROFILE_TIMER_BASE + HAL_MCFxxxx_PITx_PCSR
|
82 |
|
|
|
83 |
|
|
movem.l 4(%sp), %d0-%d1/%a0-%a1
|
84 |
|
|
add.l #20, %sp
|
85 |
|
|
rte
|
86 |
|
|
#endif
|
87 |
|
|
|
88 |
|
|
.end
|