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
16
22
23#include <stdint.h>
24#include <stdio.h>
25#include "cpu_conf.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31/* MARK: - Basics */
40#define CPU_HAS_UNALIGNED_ACCESS
41
45__attribute__((always_inline)) static inline uintptr_t cpu_get_caller_pc(void)
46{
47 /* __builtin_return_address will return the address the calling function
48 * will return to - since cpu_get_caller_pc is forced inline,
49 * it is the return address of the user of this function */
50 return (uintptr_t)__builtin_return_address(0);
51}
52
53
54#ifdef __cplusplus
55}
56#endif
57
static uinttxtptr_t cpu_get_caller_pc(void)
Get the last instruction's address.
Definition cpu.h:137
Native CPU configuration.