1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/native/include/cpu.h

52 lines
1.3 KiB
C
Raw Normal View History

/*
* Copyright (C) 2013 - 2016 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
2013-03-06 10:29:49 +01:00
*
2014-08-23 15:43:13 +02:00
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
2018-06-01 12:17:51 +02:00
* @ingroup cpu
* @defgroup cpu_native Native
* @brief Native CPU specific code
* @details The native CPU uses system calls to simulate hardware access.
* @ingroup cpu
* @brief CPU abstraction for the native port
2013-03-06 10:29:49 +01:00
* @{
* @author Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
2013-03-06 10:29:49 +01:00
*/
#ifndef CPU_H
#define CPU_H
2013-03-06 01:08:15 +01:00
#include <stdio.h>
2014-10-13 10:53:20 +02:00
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The CPU supports unaligned memory access.
* Even if the underlying architecture does not support it, the kernel will take care of it.
*/
#define CPU_HAS_UNALIGNED_ACCESS
/**
* @brief Prints the address the callee will return to
*/
__attribute__((always_inline)) static inline void cpu_print_last_instruction(void)
{
/* __builtin_return_address will return the address the calling function
* will return to - since cpu_print_last_instruction is forced inline,
* it is the return address of the user of this function */
printf("%p\n", __builtin_return_address(0));
}
2014-10-13 10:53:20 +02:00
#ifdef __cplusplus
}
#endif
/** @} */
#endif /* CPU_H */