This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit b07d3872ed2371f7f4cdb270fa9fe96d76596454 Author: hujun5 <[email protected]> AuthorDate: Wed Dec 17 09:36:58 2025 +0800 arm: merge arm.h to arm_a_r merge arm.h to arm_a_r Signed-off-by: hujun5 <[email protected]> --- arch/arm/src/arm/arm.h | 82 ----------------- arch/arm/src/{armv8-r => arm_a_r}/arm.h | 9 +- arch/arm/src/armv7-a/arm.h | 136 ---------------------------- arch/arm/src/armv7-r/arm.h | 155 -------------------------------- 4 files changed, 5 insertions(+), 377 deletions(-) diff --git a/arch/arm/src/arm/arm.h b/arch/arm/src/arm/arm.h deleted file mode 100644 index a15cae1ba6a..00000000000 --- a/arch/arm/src/arm/arm.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** - * arch/arm/src/arm/arm.h - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __ARCH_ARM_SRC_ARM_ARM_H -#define __ARCH_ARM_SRC_ARM_ARM_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* ARM9EJS ******************************************************************/ - -/* PSR bits */ - -#define PSR_MODE_MASK 0x0000001f /* Bits 0-4: Mode bits */ -#define PSR_MODE_USR26 0x00000000 /* 26-bit User mode */ -#define PSR_MODE_FIQ26 0x00000001 /* 26-bit FIQ mode */ -#define PSR_MODE_IRQ26 0x00000002 /* 26-bit IRQ mode */ -#define PSR_MODE_SVC26 0x00000003 /* 26-bit Supervisor mode */ -#define PSR_MODE_MODE32 0x00000010 /* Bit 4: 32-bit mode */ -#define PSR_MODE_USR 0x00000010 /* 32-bit User mode */ -#define PSR_MODE_FIQ 0x00000011 /* 32-bit FIQ mode */ -#define PSR_MODE_IRQ 0x00000012 /* 32-bit IRQ mode */ -#define PSR_MODE_SVC 0x00000013 /* 32-bit Supervisor mode */ -#define PSR_MODE_ABT 0x00000017 /* 32-bit Abort mode */ -#define PSR_MODE_UND 0x0000001b /* 32-bit Undefined mode */ -#define PSR_MODE_SYS 0x0000001f /* 32-bit System mode */ -#define PSR_T_BIT 0x00000020 /* Bit 5: Thumb state */ -#define PSR_F_BIT 0x00000040 /* Bit 6: FIQ disable */ -#define PSR_I_BIT 0x00000080 /* Bit 7: IRQ disable */ - /* Bits 8-23: Reserved */ -#define PSR_J_BIT 0x01000000 /* Bit 24: Jazelle state bit */ - /* Bits 25-26: Reserved */ -#define PSR_Q_BIT 0x08000000 /* Bit 27: Sticky overflow */ -#define PSR_V_BIT 0x10000000 /* Bit 28: Overflow */ -#define PSR_C_BIT 0x20000000 /* Bit 29: Carry/Borrow/Extend */ -#define PSR_Z_BIT 0x40000000 /* Bit 30: Zero */ -#define PSR_N_BIT 0x80000000 /* Bit 31: Negative/Less than */ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -#ifndef __ASSEMBLY__ -#ifdef __cplusplus -extern "C" -{ -#endif - -#ifdef __cplusplus -} -#endif -#endif /* __ASSEMBLY__ */ - -#endif /* __ARCH_ARM_SRC_ARM_ARM_H */ diff --git a/arch/arm/src/armv8-r/arm.h b/arch/arm/src/arm_a_r/arm.h similarity index 96% rename from arch/arm/src/armv8-r/arm.h rename to arch/arm/src/arm_a_r/arm.h index 56bca3651f2..ec335f827d0 100644 --- a/arch/arm/src/armv8-r/arm.h +++ b/arch/arm/src/arm_a_r/arm.h @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/arm/src/armv8-r/arm.h + * arch/arm/src/arm_a_r/arm.h * * SPDX-License-Identifier: Apache-2.0 * @@ -27,8 +27,8 @@ * All rights reserved. ARM DDI 0406C.c (ID051414) */ -#ifndef __ARCH_ARM_SRC_ARMV8_R_ARM_H -#define __ARCH_ARM_SRC_ARMV8_R_ARM_H +#ifndef __ARCH_ARM_SRC_ARM_A_R_ARM_H +#define __ARCH_ARM_SRC_ARM_A_R_ARM_H /**************************************************************************** * Included Files @@ -61,6 +61,7 @@ # define PSR_MODE_FIQ (17 << PSR_MODE_SHIFT) /* FIQ mode */ # define PSR_MODE_IRQ (18 << PSR_MODE_SHIFT) /* IRQ mode */ # define PSR_MODE_SVC (19 << PSR_MODE_SHIFT) /* Supervisor mode */ +# define PSR_MODE_MON (22 << PSR_MODE_SHIFT) /* Monitor mode */ # define PSR_MODE_ABT (23 << PSR_MODE_SHIFT) /* Abort mode */ # define PSR_MODE_HYP (26 << PSR_MODE_SHIFT) /* Hypervisor mode */ # define PSR_MODE_UND (27 << PSR_MODE_SHIFT) /* Undefined mode */ @@ -146,4 +147,4 @@ void arm_data_initialize(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __ARCH_ARM_SRC_ARMV8_R_ARM_H */ +#endif /* __ARCH_ARM_SRC_ARM_A_R_ARM_H */ diff --git a/arch/arm/src/armv7-a/arm.h b/arch/arm/src/armv7-a/arm.h deleted file mode 100644 index c00b3139558..00000000000 --- a/arch/arm/src/armv7-a/arm.h +++ /dev/null @@ -1,136 +0,0 @@ -/**************************************************************************** - * arch/arm/src/armv7-a/arm.h - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/* References: - * "Cortex-A5™ MPCore, Technical Reference Manual", Revision: r0p1, - * Copyright © 2010 ARM. All rights reserved. ARM DDI 0434B (ID101810) - * "ARM® Architecture Reference Manual, ARMv7-A and ARMv7-R edition", - * Copyright © 1996-1998, 2000, 2004-2012 ARM. All rights reserved. - * ARM DDI 0406C.b (ID072512) - */ - -#ifndef __ARCH_ARM_SRC_ARMV7_A_ARM_H -#define __ARCH_ARM_SRC_ARMV7_A_ARM_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#ifndef __ASSEMBLY__ -# include <stdbool.h> -# include <stdint.h> -#endif /* __ASSEMBLY__ */ - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* ARMv7-A ******************************************************************/ - -/* PSR bits */ - -#define PSR_MODE_SHIFT (0) /* Bits 0-4: Mode fields */ -#define PSR_MODE_MASK (31 << PSR_MODE_SHIFT) -# define PSR_MODE_USR (16 << PSR_MODE_SHIFT) /* User mode */ -# define PSR_MODE_FIQ (17 << PSR_MODE_SHIFT) /* FIQ mode */ -# define PSR_MODE_IRQ (18 << PSR_MODE_SHIFT) /* IRQ mode */ -# define PSR_MODE_SVC (19 << PSR_MODE_SHIFT) /* Supervisor mode */ -# define PSR_MODE_MON (22 << PSR_MODE_SHIFT) /* Monitor mode */ -# define PSR_MODE_ABT (23 << PSR_MODE_SHIFT) /* Abort mode */ -# define PSR_MODE_HYP (26 << PSR_MODE_SHIFT) /* Hyp mode */ -# define PSR_MODE_UND (27 << PSR_MODE_SHIFT) /* Undefined mode */ -# define PSR_MODE_SYS (31 << PSR_MODE_SHIFT) /* System mode */ - -#define PSR_T_BIT (1 << 5) /* Bit 5: Thumb execution state bit */ -#define PSR_MASK_SHIFT (6) /* Bits 6-8: Mask Bits */ -#define PSR_MASK_MASK (7 << PSR_GE_SHIFT) -# define PSR_F_BIT (1 << 6) /* Bit 6: FIQ mask bit */ -# define PSR_I_BIT (1 << 7) /* Bit 7: IRQ mask bit */ -# define PSR_A_BIT (1 << 8) /* Bit 8: Asynchronous abort mask */ -#define PSR_E_BIT (1 << 9) /* Bit 9: Endianness execution state bit */ -#define PSR_GE_SHIFT (16) /* Bits 16-19: Greater than or Equal flags */ -#define PSR_GE_MASK (15 << PSR_GE_SHIFT) - /* Bits 20-23: Reserved. RAZ/SBZP */ -#define PSR_J_BIT (1 << 24) /* Bit 24: Jazelle state bit */ -#define PSR_IT01_SHIFT (25) /* Bits 25-26: If-Then execution state bits IT[0:1] */ -#define PSR_IT01_MASK (3 << PSR_IT01_SHIFT) -#define PSR_Q_BIT (1 << 27) /* Bit 27: Cumulative saturation bit */ -#define PSR_V_BIT (1 << 28) /* Bit 28: Overflow condition flag */ -#define PSR_C_BIT (1 << 29) /* Bit 29: Carry condition flag */ -#define PSR_Z_BIT (1 << 30) /* Bit 30: Zero condition flag */ -#define PSR_N_BIT (1 << 31) /* Bit 31: Negative condition flag */ - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -#ifndef __ASSEMBLY__ - -#endif /* __ASSEMBLY__ */ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -#ifndef __ASSEMBLY__ -#ifdef __cplusplus -extern "C" -{ -#endif - -/**************************************************************************** - * Name: arm_data_initialize - * - * Description: - * Clear all of .bss to zero; set .data to the correct initial values - * - * Input Parameters: - * None - * - * Returned Value: - * None - * - ****************************************************************************/ - -void arm_data_initialize(void); - -/**************************************************************************** - * Name: arm_fault_kill - * - * Description: - * End the task of a fault of user code with SIGSEGV. Return false if - * the fault is fatal. See arm_userfault.c. - * - ****************************************************************************/ - -bool arm_fault_kill(uint32_t *regs); - -#ifdef __cplusplus -} -#endif -#endif /* __ASSEMBLY__ */ - -#endif /* __ARCH_ARM_SRC_ARMV7_A_ARM_H */ diff --git a/arch/arm/src/armv7-r/arm.h b/arch/arm/src/armv7-r/arm.h deleted file mode 100644 index c726f48deb5..00000000000 --- a/arch/arm/src/armv7-r/arm.h +++ /dev/null @@ -1,155 +0,0 @@ -/**************************************************************************** - * arch/arm/src/armv7-r/arm.h - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/* References: - * - * "ARM Architecture Reference Manual, ARMv7-A and ARMv7-R edition", - * Copyright 1996-1998, 2000, 2004-2012 ARM. - * All rights reserved. ARM DDI 0406C.c (ID051414) - */ - -#ifndef __ARCH_ARM_SRC_ARMV7_R_ARM_H -#define __ARCH_ARM_SRC_ARMV7_R_ARM_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#ifndef __ASSEMBLY__ -# include <nuttx/compiler.h> -#endif /* __ASSEMBLY__ */ - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* ARMv7-R ******************************************************************/ - -/* PSR bits */ - -#define PSR_MODE_SHIFT (0) /* Bits 0-4: Mode fields */ -#define PSR_MODE_MASK (31 << PSR_MODE_SHIFT) -# define PSR_MODE_USR (16 << PSR_MODE_SHIFT) /* User mode */ -# define PSR_MODE_FIQ (17 << PSR_MODE_SHIFT) /* FIQ mode */ -# define PSR_MODE_IRQ (18 << PSR_MODE_SHIFT) /* IRQ mode */ -# define PSR_MODE_SVC (19 << PSR_MODE_SHIFT) /* Supervisor mode */ -# define PSR_MODE_ABT (23 << PSR_MODE_SHIFT) /* Abort mode */ -# define PSR_MODE_UND (27 << PSR_MODE_SHIFT) /* Undefined mode */ -# define PSR_MODE_SYS (31 << PSR_MODE_SHIFT) /* System mode */ - -#define PSR_T_BIT (1 << 5) /* Bit 5: Thumb execution state bit */ -#define PSR_MASK_SHIFT (6) /* Bits 6-8: Mask Bits */ -#define PSR_MASK_MASK (7 << PSR_GE_SHIFT) -# define PSR_F_BIT (1 << 6) /* Bit 6: FIQ mask bit */ -# define PSR_I_BIT (1 << 7) /* Bit 7: IRQ mask bit */ -# define PSR_A_BIT (1 << 8) /* Bit 8: Asynchronous abort mask */ -#define PSR_E_BIT (1 << 9) /* Bit 9: Endianness execution state bit */ -#define PSR_IT27_SHIFT (10) /* Bits 10-15: If-Then execution state bits IT[2:7] */ -#define PSR_IT27_MASK (0x3f << PSR_IT27_SHIFT) -#define PSR_GE_SHIFT (16) /* Bits 16-19: Greater than or Equal flags */ -#define PSR_GE_MASK (15 << PSR_GE_SHIFT) - /* Bits 20-23: Reserved. RAZ/SBZP */ -#define PSR_J_BIT (1 << 24) /* Bit 24: Jazelle state bit */ -#define PSR_IT01_SHIFT (25) /* Bits 25-26: If-Then execution state bits IT[0:1] */ -#define PSR_IT01_MASK (3 << PSR_IT01_SHIFT) -#define PSR_Q_BIT (1 << 27) /* Bit 27: Cumulative saturation bit */ -#define PSR_V_BIT (1 << 28) /* Bit 28: Overflow condition flag */ -#define PSR_C_BIT (1 << 29) /* Bit 29: Carry condition flag */ -#define PSR_Z_BIT (1 << 30) /* Bit 30: Zero condition flag */ -#define PSR_N_BIT (1 << 31) /* Bit 31: Negative condition flag */ - -/**************************************************************************** - * Inline Functions - ****************************************************************************/ - -#ifndef __ASSEMBLY__ - -#endif /* __ASSEMBLY__ */ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -#ifndef __ASSEMBLY__ -#ifdef __cplusplus -extern "C" -{ -#endif - -/**************************************************************************** - * Name: arm_boot - * - * Description: - * Complete boot operations started in arm_head.S - * - * Boot Sequence - * - * 1. The __start entry point in armv7-r/arm_head.S is invoked upon power- - * on reset. - * 2. __start prepares CPU for code execution. - * 3a. If CONFIG_ARMV7R_MEMINIT is not defined, then __start will prepare - * memory resources by calling arm_data_initialize() and will then - * branch to this function. - * 3b. Otherwise, this function will be called without having initialized - * memory resources! We need to be very careful in this case. This - * function will perform MCU- and board-specific initialization which, - * among other things, must initialize memories. After initializatino - * of the memories, this function will call arm_data_initialize() to - * initialize the memory resources - * 4. This function will then branch to nx_start() to start the operating - * system. - * - ****************************************************************************/ - -void arm_boot(void); - -/**************************************************************************** - * Name: arm_data_initialize - * - * Description: - * Clear all of .bss to zero; set .data to the correct initial values. - * This function is called automatically from ARMv7-R boot code *UNLESS* - * executing with data in some memory that requires platform-specific - * initialization (such as SDRAM). That latter case is indicated with - * CONFIG_ARMV7R_MEMINIT=y. In that case, early platform-specific logic - * must first initialize then memory then call this function. - * - * Input Parameters: - * None - * - * Returned Value: - * None - * - ****************************************************************************/ - -void arm_data_initialize(void); - -#ifdef __cplusplus -} -#endif -#endif /* __ASSEMBLY__ */ - -#endif /* __ARCH_ARM_SRC_ARMV7_R_ARM_H */
