cpu.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2013-2016 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
25 #include <stdint.h>
26 #include <stdio.h>
27 #include "cpu_conf.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 /* MARK: - Basics */
42 #define CPU_HAS_UNALIGNED_ACCESS
43 
47 __attribute__((always_inline)) static inline uintptr_t cpu_get_caller_pc(void)
48 {
49  /* __builtin_return_address will return the address the calling function
50  * will return to - since cpu_get_caller_pc is forced inline,
51  * it is the return address of the user of this function */
52  return (uintptr_t)__builtin_return_address(0);
53 }
56 #ifdef __cplusplus
57 }
58 #endif
59 
static uintptr_t cpu_get_caller_pc(void)
Gets the address the callee will return to.
Definition: cpu.h:47
Implementation specific CPU configuration options.