-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arm: support Thumb-1 with CONFIG_SYS_THUMB_BUILD
When building a Thumb-1-only target with CONFIG_SYS_THUMB_BUILD, some files fail to build, most of the time because they include mcr instructions, which only exist for Thumb-2. This patch introduces a Kconfig option CONFIG_THUMB2 and uses it to select between Thumb-2 and ARM mode for the aforementioned files. Signed-off-by: Albert ARIBAUD <[email protected]>
- Loading branch information
1 parent
bf104ff
commit 62e9207
Showing
12 changed files
with
154 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Thumb-1 drop-in for the linux/include/asm-arm/proc-armv/system.h | ||
* | ||
* (C) Copyright 2015 | ||
* Albert ARIBAUD <[email protected]> | ||
* | ||
* The original file does not build in Thumb mode. However, in U-Boot | ||
* we don't use interrupt context, so we can redefine these as empty | ||
* memory barriers, which makes Thumb-1 compiler happy. | ||
* | ||
* SPDX-License-Identifier: GPL-2.0+ | ||
*/ | ||
|
||
/* | ||
* Use the same macro name as linux/include/asm-arm/proc-armv/system.h | ||
* here, so that if the original ever gets included after us, it won't | ||
* try to re-redefine anything. | ||
*/ | ||
|
||
#ifndef __ASM_PROC_SYSTEM_H | ||
#define __ASM_PROC_SYSTEM_H | ||
|
||
/* | ||
* Redefine all original macros with static inline functions containing | ||
* a simple memory barrier, so that they produce the same instruction | ||
* ordering constraints as their original counterparts. | ||
* We use static inline functions rather than macros so that we can tell | ||
* the compiler to not complain about unused arguments. | ||
*/ | ||
|
||
static inline void local_irq_save( | ||
unsigned long flags __attribute__((unused))) | ||
{ | ||
__asm__ __volatile__ ("" : : : "memory"); | ||
} | ||
|
||
static inline void local_irq_enable(void) | ||
{ | ||
__asm__ __volatile__ ("" : : : "memory"); | ||
} | ||
|
||
static inline void local_irq_disable(void) | ||
{ | ||
__asm__ __volatile__ ("" : : : "memory"); | ||
} | ||
|
||
static inline void __stf(void) | ||
{ | ||
__asm__ __volatile__ ("" : : : "memory"); | ||
} | ||
|
||
static inline void __clf(void) | ||
{ | ||
__asm__ __volatile__ ("" : : : "memory"); | ||
} | ||
|
||
static inline void local_save_flags( | ||
unsigned long flags __attribute__((unused))) | ||
{ | ||
__asm__ __volatile__ ("" : : : "memory"); | ||
} | ||
|
||
static inline void local_irq_restore( | ||
unsigned long flags __attribute__((unused))) | ||
{ | ||
__asm__ __volatile__ ("" : : : "memory"); | ||
} | ||
|
||
#endif /* __ASM_PROC_SYSTEM_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters