Rudolf Marek | 7f0e930 | 2011-09-02 23:23:41 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2011 Rudolf Marek <r.marek@assembler.cz> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 20 | #ifndef __TRACE_H |
| 21 | #define __TRACE_H |
| 22 | |
| 23 | |
| 24 | #ifdef __PRE_RAM__ |
| 25 | |
| 26 | #define DISABLE_TRACE |
| 27 | #define ENABLE_TRACE |
| 28 | #define DISABLE_TRACE_ON_FUNCTION |
| 29 | |
| 30 | #else /* !__PRE_RAM__ */ |
| 31 | |
| 32 | #if CONFIG_TRACE |
| 33 | |
| 34 | void __cyg_profile_func_enter( void *, void * ) |
| 35 | __attribute__ ((no_instrument_function)); |
| 36 | |
| 37 | void __cyg_profile_func_exit( void *, void * ) |
| 38 | __attribute__ ((no_instrument_function)); |
| 39 | |
| 40 | extern volatile int trace_dis; |
| 41 | |
| 42 | #define DISABLE_TRACE do { trace_dis = 1; } while (0); |
| 43 | #define ENABLE_TRACE do { trace_dis = 0; } while (0); |
| 44 | #define DISABLE_TRACE_ON_FUNCTION __attribute__ ((no_instrument_function)); |
| 45 | |
| 46 | #else /* !CONFIG_TRACE */ |
| 47 | |
| 48 | #define DISABLE_TRACE |
| 49 | #define ENABLE_TRACE |
| 50 | #define DISABLE_TRACE_ON_FUNCTION |
| 51 | |
| 52 | #endif |
| 53 | #endif |
| 54 | #endif |