cpu.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 - 2016 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
25 #ifndef CPU_H
26 #define CPU_H
27 
28 #include <stdint.h>
29 #include <stdio.h>
30 #include "cpu_conf.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /* MARK: - Basics */
45 #define CPU_HAS_UNALIGNED_ACCESS
46 
50 __attribute__((always_inline)) static inline uintptr_t cpu_get_caller_pc(void)
51 {
52  /* __builtin_return_address will return the address the calling function
53  * will return to - since cpu_get_caller_pc is forced inline,
54  * it is the return address of the user of this function */
55  return (uintptr_t)__builtin_return_address(0);
56 }
59 #ifdef __cplusplus
60 }
61 #endif
62 
63 #endif /* CPU_H */
static uintptr_t cpu_get_caller_pc(void)
Gets the address the callee will return to.
Definition: cpu.h:50
stdio wrapper to extend the C libs stdio
Implementation specific CPU configuration options.