Loading...
Searching...
No Matches
arm_cpu.h
1/*
2 * SPDX-FileCopyrightText: 2014 Freie Universität Berlin
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
8#include <stdint.h>
9#include "VIC.h"
10#include "arm7_common.h"
11
12#ifdef __cplusplus
13 extern "C" {
14#endif
15
16#define NEW_TASK_CPSR 0x1F
17#define WORDSIZE 32
18
19uint32_t get_system_speed(void);
20void cpu_clock_scale(uint32_t source, uint32_t target, uint32_t *prescale);
21
22void arm_reset(void);
23
27static inline uintptr_t cpu_get_caller_pc(void)
28{
29 register uintptr_t lr_ptr;
30
31 __asm__ __volatile__ ("mov %0, lr" : "=r" (lr_ptr));
32 return lr_ptr;
33}
34
42#define STACK_CANARY_WORD (0xEAFFFFFEu)
43
48#ifdef __ARM_FEATURE_CLZ
49#define BITARITHM_LSB_BUILTIN
50#define BITARITHM_HAS_CLZ
51#else
52#define BITARITHM_LSB_LOOKUP
53#endif
55
56#ifdef __cplusplus
57}
58#endif
ARM7 CPU common declarations.