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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [m68k/] [mcf52xx/] [mcf5272/] [proc/] [current/] [src/] [mcf5272_profile.S] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
// #========================================================================
2
// #
3
// #    mcf5272_profile.S
4
// #
5
// #    Support for gprof-style profiling on an mcf5272
6
// #
7
// #========================================================================
8
//=============================================================================
9
// ####ECOSGPLCOPYRIGHTBEGIN####
10
// -------------------------------------------
11
// This file is part of eCos, the Embedded Configurable Operating System.
12
// Copyright (C) 2003, 2006, 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:          2003-09-01
45
//
46
//###DESCRIPTIONEND####
47
//========================================================================
48
 
49
#include 
50
#include 
51
 
52
        .file   "mcf5272_profile.S"
53
 
54
        // This VSR should call __profile_hit() with a single argument,
55
        // the interrupted PC. The VSR has been installed as a
56
        // high-priority interrupt source, so there is no need to worry
57
        // about nested interrupts or an interrupt stack.
58
        .extern __profile_hit
59
 
60
        FUNC_START(hal_mcf5272_profile_vsr)
61
        // On entry sp[0] holds sr and sp[1] holds the pc.
62
        // Save the caller-save integer registers. There are no floating
63
        // point registers to worry about. Make space for the argument
64
        // to __profile_hit() while we are at it.
65
        sub.l   #20, %sp
66
        movem.l %d0-%d1/%a0-%a1, 4(%sp)
67
 
68
        // Now pick up the interrupted PC from its new offset and push it
69
        // on the stack for __profile_hit().
70
        move.l  24(%sp),(%sp)
71
        jbsr    __profile_hit
72
 
73
        // The timer runs in restart mode, but the interrupt bit has to be reset.
74
        moveq.l # HAL_MCF5272_TIMER_TER_REF, %d0
75
        move.w  %d0, HAL_MCFxxxx_MBAR + HAL_MCF5272_TIMER2_BASE + HAL_MCF5272_TIMER_TER
76
 
77
        movem.l 4(%sp), %d0-%d1/%a0-%a1
78
        add.l   #20, %sp
79
        rte
80
 
81
        .end

powered by: WebSVN 2.1.0

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