1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/arm7_common/include/arm_cpu.h
Benjamin Valentin 464dc63f08 cpu/arm7_common: add __ARM_FEATURE_CLZ feature test
The feature test macro should work on all ARM CPUs supported by gcc.
2020-07-21 16:03:59 +02:00

54 lines
1.0 KiB
C

/*
* Copyright (C) 2014 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
#ifndef ARM_CPU_H
#define ARM_CPU_H
#include <stdint.h>
#include "VIC.h"
#include "arm7_common.h"
#ifdef __cplusplus
extern "C" {
#endif
#define NEW_TASK_CPSR 0x1F
#define WORDSIZE 32
uint32_t get_system_speed(void);
void cpu_clock_scale(uint32_t source, uint32_t target, uint32_t *prescale);
void arm_reset(void);
/**
* @brief Interrupt stack canary value
*
* @note 0xeafffffe is the ARM machine code equivalent of asm("b #0") or
* 'while (1);', i.e. an infinite loop.
* @internal
*/
#define STACK_CANARY_WORD (0xEAFFFFFEu)
/**
* @brief Select fastest bitarithm_lsb implementation
* @{
*/
#ifdef __ARM_FEATURE_CLZ
#define BITARITHM_LSB_BUILTIN
#define BITARITHM_HAS_CLZ
#else
#define BITARITHM_LSB_LOOKUP
#endif
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* ARM_CPU_H */