]> rtime.felk.cvut.cz Git - arc.git/blob - include/arm/Cpu.h
Merge with 3bd2b84a75d8d5d7708e0818fe64cc6cee360049
[arc.git] / include / arm / Cpu.h
1 /* -------------------------------- Arctic Core ------------------------------
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com
3  *
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>
5  *
6  * This source code is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License version 2 as published by the
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13  * for more details.
14  * -------------------------------- Arctic Core ------------------------------*/
15
16 #ifndef CPU_H_
17 #define CPU_H_
18
19 #include <stdint.h>
20
21 #if defined(CFG_ARM_CM3)
22 #include "stm32f10x.h"
23 #elif defined(CFG_ARM_CR4)
24 #include "core_cr4.h"
25 #endif
26
27 #include "Std_Types.h"
28 typedef uint32_t imask_t;
29
30 /* Call architecture specific code */
31 #define Irq_Disable()           __disable_irq()
32 #define Irq_Enable()            __enable_irq()
33
34 #define Irq_Save(_flags)                _flags = _Irq_Save();
35 #define Irq_Restore(_flags)                     _Irq_Restore(_flags);
36
37 #define Irq_SuspendAll()        Irq_Disable()
38 #define Irq_ResumeAll()         Irq_Enable()
39
40 #define Irq_SuspendOs()         Irq_Disable()
41 #define Irq_ResumeOs()          Irq_Enable()
42
43
44 #define CallService(index,param)
45
46 #define ilog2(x) __builtin_ffs(x)
47
48 #endif /* CPU_H_ */