diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-06 00:38:45 +0200 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-06 02:21:43 +0200 |
commit | abbfd661b2de4c6aedd815b9f653cbe43621b73a (patch) | |
tree | ae95844092ef6d853a4a0795ea0a9b3f4bd4097e | |
parent | d2c1cda9f75c7e0244cc3a41f45965f28d3bb9ba (diff) | |
download | sparse-abbfd661b2de4c6aedd815b9f653cbe43621b73a.tar.gz |
arch: add minimal support for microblaze
The Kernel Test Robot reports a problem on microblaze.
The cause is that __MICROBLAZEEL__ is not defined. However, the real
problem is that sparse has no support at all for this architecture.
So, add the minimal support for microblaze.
Link: https://lore.kernel.org/lkml/202007060542.hNfoTcsC%25lkp@intel.com
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | machine.h | 1 | ||||
-rw-r--r-- | target-microblaze.c | 25 | ||||
-rw-r--r-- | target.c | 2 | ||||
-rw-r--r-- | target.h | 1 |
5 files changed, 30 insertions, 0 deletions
@@ -74,6 +74,7 @@ LIB_OBJS += target-arm64.o LIB_OBJS += target-bfin.o LIB_OBJS += target-default.o LIB_OBJS += target-m68k.o +LIB_OBJS += target-microblaze.o LIB_OBJS += target-mips.o LIB_OBJS += target-nios2.o LIB_OBJS += target-ppc.o @@ -35,6 +35,7 @@ enum machine { MACH_ALPHA, MACH_BFIN, MACH_M68K, + MACH_MICROBLAZE, MACH_NIOS2, MACH_UNKNOWN }; diff --git a/target-microblaze.c b/target-microblaze.c new file mode 100644 index 00000000..1fbeef3c --- /dev/null +++ b/target-microblaze.c @@ -0,0 +1,25 @@ +#include "symbol.h" +#include "target.h" +#include "machine.h" + + +static void predefine_microblaze(const struct target *self) +{ + predefine("__MICROBLAZE__", 1, "1"); + predefine("__microblaze__", 1, "1"); + + if (arch_big_endian) + predefine("__MICROBLAZEEB__", 1, "1"); + else + predefine("__MICROBLAZEEL__", 1, "1"); +} + +const struct target target_microblaze = { + .mach = MACH_MICROBLAZE, + .bitness = ARCH_LP32, + .big_endian = true, + + .bits_in_longdouble = 64, + + .predefine = predefine_microblaze, +}; @@ -63,6 +63,7 @@ static const struct target *targets[] = { [MACH_I386] = &target_i386, [MACH_BFIN] = &target_bfin, [MACH_X86_64] = &target_x86_64, + [MACH_MICROBLAZE] = &target_microblaze, [MACH_MIPS32] = &target_mips32, [MACH_MIPS64] = &target_mips64, [MACH_NIOS2] = &target_nios2, @@ -93,6 +94,7 @@ enum machine target_parse(const char *name) { "i386", MACH_I386, 32, }, { "bfin", MACH_BFIN, 32, }, { "m68k", MACH_M68K, 32, }, + { "microblaze", MACH_MICROBLAZE,32, }, { "mips", MACH_MIPS32, 0, }, { "nios2", MACH_NIOS2, 32, }, { "powerpc", MACH_PPC32, 0, }, @@ -86,6 +86,7 @@ extern const struct target target_arm; extern const struct target target_arm64; extern const struct target target_bfin; extern const struct target target_m68k; +extern const struct target target_microblaze; extern const struct target target_mips32; extern const struct target target_mips64; extern const struct target target_nios2; |