<commit_before>/**
 * \file
 * \brief Header with definitions for bit-banding for ARMv7-M
 *
 * \author Copyright (C) 2015 <NAME> http://www.distortec.com http://www.freddiechopin.info
 *
 * \par License
 * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
 * distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#ifndef SOURCE_ARCHITECTURE_ARM_ARMV6_M_ARMV7_M_INCLUDE_DISTORTOS_ARCHITECTURE_ARMV7_M_BIT_BANDING_H_
#define SOURCE_ARCHITECTURE_ARM_ARMV6_M_ARMV7_M_INCLUDE_DISTORTOS_ARCHITECTURE_ARMV7_M_BIT_BANDING_H_

#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)

/*---------------------------------------------------------------------------------------------------------------------+
| global defines
+---------------------------------------------------------------------------------------------------------------------*/

/** beginning of SRAM region which is aliased in bit-band region */
enum { BITBAND_SRAM_BEGIN = 0x20000000 };

/** end of SRAM region which is aliased in bit-band region */
enum { BITBAND_SRAM_END = 0x200fffff };

/** start of bit-band alias region of SRAM */
enum { BITBAND_SRAM_BASE = 0x22000000 };

/** beginning of peripheral region which is aliased in bit-band region */
enum { BITBAND_PERIPHERAL_BEGIN = 0x40000000 };

/** end of peripheral region which is aliased in bit-band region */
enum { BITBAND_PERIPHERAL_END = 0x400fffff };

/** start of bit-band alias region of peripherals */
enum { BITBAND_PERIPHERAL_BASE = 0x42000000 };

/** address of bit-band alias for SRAM region */
#define BITBAND_SRAM_ADDRESS(address, bit) \
	(BITBAND_SRAM_BASE + (((unsigned long)address) - BITBAND_SRAM_BEGIN) * 32 + (bit) * 4)

/** address of bit-band alias for peripheral region */
#define BITBAND_PERIPHERAL_ADDRESS(address, bit) \
	(BITBAND_PERIPHERAL_BASE + (((unsigned long)address) - BITBAND_PERIPHERAL_BEGIN) * 32 + (bit) * 4)

/** address of bit-band alias for any region */
#define BITBAND_ADDRESS(address, bit)		( \
	(((unsigned long)address) >= BITBAND_SRAM_BEGIN) && (((unsigned long)address) <= BITBAND_SRAM_END) ? \
		BITBAND_SRAM_ADDRESS(address, bit) : \
	(((unsigned long)address) >= BITBAND_PERIPHERAL_BEGIN) && (((unsigned long)address) <= BITBAND_PERIPHERAL_END) ? \<commit_msg>Use camelCase for enum values in ARMv7-M-bit-banding.h<commit_after>/**
 * \file
 * \brief Header with definitions for bit-banding for ARMv7-M
 *
 * \author Copyright (C) 2015-2017 <NAME> http://www.distortec.com http://www.freddiechopin.info
 *
 * \par License
 * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
 * distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#ifndef SOURCE_ARCHITECTURE_ARM_ARMV6_M_ARMV7_M_INCLUDE_DISTORTOS_ARCHITECTURE_ARMV7_M_BIT_BANDING_H_
#define SOURCE_ARCHITECTURE_ARM_ARMV6_M_ARMV7_M_INCLUDE_DISTORTOS_ARCHITECTURE_ARMV7_M_BIT_BANDING_H_

#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)

/*---------------------------------------------------------------------------------------------------------------------+
| global defines
+---------------------------------------------------------------------------------------------------------------------*/

/** beginning of SRAM region which is aliased in bit-band region */
enum { bitbandSramBegin = 0x20000000 };

/** end of SRAM region which is aliased in bit-band region */
enum { bitbandSramEnd = 0x200fffff };

/** start of bit-band alias region of SRAM */
enum { bitbandSramBase = 0x22000000 };

/** beginning of peripheral region which is aliased in bit-band region */
enum { bitbandPeripheralBegin = 0x40000000 };

/** end of peripheral region which is aliased in bit-band region */
enum { bitbandPeripheralEnd = 0x400fffff };

/** start of bit-band alias region of peripherals */
enum { bitbandPeripheralBase = 0x42000000 };

/** address of bit-band alias for SRAM region */
#define BITBAND_SRAM_ADDRESS(address, bit) \
	(bitbandSramBase + (((unsigned long)address) - bitbandSramBegin) * 32 + (bit) * 4)

/** address of bit-band alias for peripheral region */
#define BITBAND_PERIPHERAL_ADDRESS(address, bit) \
	(bitbandPeripheralBase + (((unsigned long)address) - bitbandPeripheralBegin) * 32 + (bit) * 4)

/** address of bit-band alias for any region */
#define BITBAND_ADDRESS(address, bit)		( \
	(((unsigned long)address) >= bitbandSramBegin) && (((unsigned long)address) <= bitbandSramEnd) ? \
		BITBAND_SRAM_ADDRESS(address, bit) : \
	(((unsigned long)address) >= bitbandPeripheralBegin) && (((unsigned long)address) <= bitbandPeripheralEnd) ? \
{'fraction_non_alphanumeric': 0.2019271948608137, 'fraction_numerical': 0.029764453961456102, 'mean_word_length': 2.9055183946488294, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3145795', 'n_tokens_mistral': 1578, 'n_tokens_neox': 1441, 'n_words': 390}