mbed library sources

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Tue Apr 07 06:45:07 2015 +0100
Revision:
501:36015dec7d16
Parent:
270:e2babe29baf8
Synchronized with git revision 40d3a79298f37284b863f90e33e261986340964e

Full URL: https://github.com/mbedmicro/mbed/commit/40d3a79298f37284b863f90e33e261986340964e/

fixes #984: updating to v7.1 of the Nordic SDK.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 501:36015dec7d16 1 /* Copyright (c) 2013, Nordic Semiconductor ASA
mbed_official 501:36015dec7d16 2 * All rights reserved.
mbed_official 501:36015dec7d16 3 *
mbed_official 501:36015dec7d16 4 * Redistribution and use in source and binary forms, with or without
mbed_official 501:36015dec7d16 5 * modification, are permitted provided that the following conditions are met:
mbed_official 501:36015dec7d16 6 *
mbed_official 501:36015dec7d16 7 * * Redistributions of source code must retain the above copyright notice, this
mbed_official 501:36015dec7d16 8 * list of conditions and the following disclaimer.
mbed_official 501:36015dec7d16 9 *
mbed_official 501:36015dec7d16 10 * * Redistributions in binary form must reproduce the above copyright notice,
mbed_official 501:36015dec7d16 11 * this list of conditions and the following disclaimer in the documentation
mbed_official 501:36015dec7d16 12 * and/or other materials provided with the distribution.
mbed_official 85:e1a8e879a6a9 13 *
mbed_official 501:36015dec7d16 14 * * Neither the name of Nordic Semiconductor ASA nor the names of its
mbed_official 501:36015dec7d16 15 * contributors may be used to endorse or promote products derived from
mbed_official 501:36015dec7d16 16 * this software without specific prior written permission.
mbed_official 85:e1a8e879a6a9 17 *
mbed_official 501:36015dec7d16 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 501:36015dec7d16 19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 501:36015dec7d16 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 501:36015dec7d16 21 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 501:36015dec7d16 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 501:36015dec7d16 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 501:36015dec7d16 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 501:36015dec7d16 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 501:36015dec7d16 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 501:36015dec7d16 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 85:e1a8e879a6a9 28 *
mbed_official 85:e1a8e879a6a9 29 */
mbed_official 85:e1a8e879a6a9 30 #ifndef _COMPILER_ABSTRACTION_H
mbed_official 85:e1a8e879a6a9 31 #define _COMPILER_ABSTRACTION_H
mbed_official 85:e1a8e879a6a9 32
mbed_official 85:e1a8e879a6a9 33 /*lint ++flb "Enter library region" */
mbed_official 85:e1a8e879a6a9 34
mbed_official 85:e1a8e879a6a9 35 #if defined ( __CC_ARM )
mbed_official 501:36015dec7d16 36
mbed_official 501:36015dec7d16 37 #ifndef __ASM
mbed_official 501:36015dec7d16 38 #define __ASM __asm /*!< asm keyword for ARM Compiler */
mbed_official 501:36015dec7d16 39 #endif
mbed_official 501:36015dec7d16 40
mbed_official 501:36015dec7d16 41 #ifndef __INLINE
mbed_official 501:36015dec7d16 42 #define __INLINE __inline /*!< inline keyword for ARM Compiler */
mbed_official 501:36015dec7d16 43 #endif
mbed_official 501:36015dec7d16 44
mbed_official 501:36015dec7d16 45 #ifndef __WEAK
mbed_official 501:36015dec7d16 46 #define __WEAK __weak /*!< weak keyword for ARM Compiler */
mbed_official 501:36015dec7d16 47 #endif
mbed_official 501:36015dec7d16 48
mbed_official 501:36015dec7d16 49 #define GET_SP() __current_sp() /*!> read current SP function for ARM Compiler */
mbed_official 85:e1a8e879a6a9 50
mbed_official 501:36015dec7d16 51 #elif defined ( __ICCARM__ )
mbed_official 501:36015dec7d16 52
mbed_official 501:36015dec7d16 53 #ifndef __ASM
mbed_official 501:36015dec7d16 54 #define __ASM __asm /*!< asm keyword for IAR Compiler */
mbed_official 501:36015dec7d16 55 #endif
mbed_official 501:36015dec7d16 56
mbed_official 501:36015dec7d16 57 #ifndef __INLINE
mbed_official 501:36015dec7d16 58 #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */
mbed_official 501:36015dec7d16 59 #endif
mbed_official 501:36015dec7d16 60
mbed_official 501:36015dec7d16 61 #ifndef __WEAK
mbed_official 501:36015dec7d16 62 #define __WEAK __weak /*!> define weak function for IAR Compiler */
mbed_official 501:36015dec7d16 63 #endif
mbed_official 501:36015dec7d16 64
mbed_official 501:36015dec7d16 65 #define GET_SP() __get_SP() /*!> read current SP function for IAR Compiler */
mbed_official 501:36015dec7d16 66
mbed_official 501:36015dec7d16 67 #elif defined ( __GNUC__ )
mbed_official 501:36015dec7d16 68
mbed_official 501:36015dec7d16 69 #ifndef __ASM
mbed_official 501:36015dec7d16 70 #define __ASM __asm /*!< asm keyword for GNU Compiler */
mbed_official 501:36015dec7d16 71 #endif
mbed_official 501:36015dec7d16 72
mbed_official 501:36015dec7d16 73 #ifndef __INLINE
mbed_official 501:36015dec7d16 74 #define __INLINE inline /*!< inline keyword for GNU Compiler */
mbed_official 501:36015dec7d16 75 #endif
mbed_official 501:36015dec7d16 76
mbed_official 501:36015dec7d16 77 #ifndef __WEAK
mbed_official 501:36015dec7d16 78 #define __WEAK __attribute__((weak)) /*!< weak keyword for GNU Compiler */
mbed_official 501:36015dec7d16 79 #endif
mbed_official 501:36015dec7d16 80
mbed_official 501:36015dec7d16 81 #define GET_SP() gcc_current_sp() /*!> read current SP function for GNU Compiler */
mbed_official 85:e1a8e879a6a9 82
mbed_official 501:36015dec7d16 83 static inline unsigned int gcc_current_sp(void)
mbed_official 501:36015dec7d16 84 {
mbed_official 501:36015dec7d16 85 register unsigned sp asm("sp");
mbed_official 501:36015dec7d16 86 return sp;
mbed_official 501:36015dec7d16 87 }
mbed_official 501:36015dec7d16 88
mbed_official 501:36015dec7d16 89 #elif defined ( __TASKING__ )
mbed_official 501:36015dec7d16 90
mbed_official 501:36015dec7d16 91 #ifndef __ASM
mbed_official 501:36015dec7d16 92 #define __ASM __asm /*!< asm keyword for TASKING Compiler */
mbed_official 501:36015dec7d16 93 #endif
mbed_official 501:36015dec7d16 94
mbed_official 501:36015dec7d16 95 #ifndef __INLINE
mbed_official 501:36015dec7d16 96 #define __INLINE inline /*!< inline keyword for TASKING Compiler */
mbed_official 501:36015dec7d16 97 #endif
mbed_official 501:36015dec7d16 98
mbed_official 501:36015dec7d16 99 #ifndef __WEAK
mbed_official 501:36015dec7d16 100 #define __WEAK __attribute__((weak)) /*!< weak keyword for TASKING Compiler */
mbed_official 501:36015dec7d16 101 #endif
mbed_official 501:36015dec7d16 102
mbed_official 501:36015dec7d16 103 #define GET_SP() __get_MSP() /*!> read current SP function for TASKING Compiler */
mbed_official 501:36015dec7d16 104
mbed_official 85:e1a8e879a6a9 105 #endif
mbed_official 85:e1a8e879a6a9 106
mbed_official 85:e1a8e879a6a9 107 /*lint --flb "Leave library region" */
mbed_official 85:e1a8e879a6a9 108
mbed_official 85:e1a8e879a6a9 109 #endif