diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-08-28 14:59:16 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-08-28 15:22:27 +0200 |
commit | 807ea677b298ed13796d27c493c726c0bfe6e036 (patch) | |
tree | 8763ba36454360a2640943f59739f849398208ec /cpukit | |
parent | record: Add variants for critical sections (diff) | |
download | rtems-807ea677b298ed13796d27c493c726c0bfe6e036.tar.bz2 |
score: Add RTEMS_RETURN_ADDRESS()
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/include/rtems/score/basedefs.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cpukit/include/rtems/score/basedefs.h b/cpukit/include/rtems/score/basedefs.h index 7a36c74e65..782958920c 100644 --- a/cpukit/include/rtems/score/basedefs.h +++ b/cpukit/include/rtems/score/basedefs.h @@ -10,7 +10,7 @@ * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * - * Copyright (c) 2010, 2018 embedded brains GmbH. + * Copyright (C) 2010, 2019 embedded brains GmbH * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -371,6 +371,17 @@ #define RTEMS_PREDICT_FALSE( _exp ) ( _exp ) #endif +/** + * @brief Returns the return address of the current function. + * + * @return The return address. + */ +#if defined(__GNUC__) + #define RTEMS_RETURN_ADDRESS() __builtin_return_address( 0 ) +#else + #define RTEMS_RETURN_ADDRESS() NULL +#endif + #if __cplusplus >= 201103L #define RTEMS_STATIC_ASSERT(cond, msg) \ static_assert(cond, # msg) |