Loading...
Searching...
No Matches
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
18
24
25#include <stdint.h>
26#include <stdio.h>
27#include "cpu_conf.h"
28
29#ifdef __cplusplus
30extern "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}
54
55
56#ifdef __cplusplus
57}
58#endif
59
static uinttxtptr_t cpu_get_caller_pc(void)
Get the last instruction's address.
Definition cpu.h:137
Native CPU configuration.