Loading...
Searching...
No Matches
cpu.h
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
20#ifndef CPU_H
21#define CPU_H
22
23#include <stdint.h>
24#include <stdio.h>
25#include "cpu_conf.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
35#define CPU_HAS_UNALIGNED_ACCESS
36
40__attribute__((always_inline)) static inline uintptr_t cpu_get_caller_pc(void)
41{
42 /* __builtin_return_address will return the address the calling function
43 * will return to - since cpu_get_caller_pc is forced inline,
44 * it is the return address of the user of this function */
45 return (uintptr_t)__builtin_return_address(0);
46}
47
48#ifdef __cplusplus
49}
50#endif
51
53#endif /* CPU_H */
static uinttxtptr_t cpu_get_caller_pc(void)
Get the last instruction's address.
Definition cpu.h:141
stdio wrapper to extend the C libs stdio
Implementation specific CPU configuration options.