blob: 4ca2ca59f1f8d6ba875a28052cef1c121c5b7118 [file] [log] [blame]
Thomas Heijligen6efdfb32021-10-12 15:16:46 +02001/*
2 * This file is part of the flashrom project.
3 *
4 * Copyright (C) 2011 Carl-Daniel Hailfinger
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16/*
17 * This file determines the target architecture. It should only be used
18 * by the Makefile
19 */
20
21#if defined (__i386__) || defined (__x86_64__) || defined(__amd64__)
Nico Huberc3b02dc2023-08-12 01:13:45 +020022 #define __FLASHPROG_ARCH__ "x86"
Thomas Heijligen6efdfb32021-10-12 15:16:46 +020023#elif defined (__mips) || defined (__mips__) || defined (__MIPS__) || defined (mips)
Nico Huberc3b02dc2023-08-12 01:13:45 +020024 #define __FLASHPROG_ARCH__ "mips"
Thomas Heijligen6efdfb32021-10-12 15:16:46 +020025#elif defined(__powerpc) || defined(__powerpc__) || defined(__powerpc64__) || defined(__POWERPC__) || \
26 defined(__ppc__) || defined(__ppc64__) || defined(_M_PPC) || defined(_ARCH_PPC) || \
27 defined(_ARCH_PPC64) || defined(__ppc)
Nico Huberc3b02dc2023-08-12 01:13:45 +020028 #define __FLASHPROG_ARCH__ "ppc"
Thomas Heijligen6efdfb32021-10-12 15:16:46 +020029#elif defined(__arm__) || defined(__TARGET_ARCH_ARM) || defined(_ARM) || defined(_M_ARM) || defined(__arm) || \
30 defined(__aarch64__)
Nico Huberc3b02dc2023-08-12 01:13:45 +020031 #define __FLASHPROG_ARCH__ "arm"
Thomas Heijligen6efdfb32021-10-12 15:16:46 +020032#elif defined (__sparc__) || defined (__sparc)
Nico Huberc3b02dc2023-08-12 01:13:45 +020033 #define __FLASHPROG_ARCH__ "sparc"
Thomas Heijligen6efdfb32021-10-12 15:16:46 +020034#elif defined (__alpha__)
Nico Huberc3b02dc2023-08-12 01:13:45 +020035 #define __FLASHPROG_ARCH__ "alpha"
Thomas Heijligen6efdfb32021-10-12 15:16:46 +020036#elif defined (__hppa__) || defined (__hppa)
Nico Huberc3b02dc2023-08-12 01:13:45 +020037 #define __FLASHPROG_ARCH__ "hppa"
Thomas Heijligen6efdfb32021-10-12 15:16:46 +020038#elif defined (__m68k__)
Nico Huberc3b02dc2023-08-12 01:13:45 +020039 #define __FLASHPROG_ARCH__ "m68k"
Thomas Heijligen6efdfb32021-10-12 15:16:46 +020040#elif defined (__riscv)
Nico Huberc3b02dc2023-08-12 01:13:45 +020041 #define __FLASHPROG_ARCH__ "riscv"
Thomas Heijligen6efdfb32021-10-12 15:16:46 +020042#elif defined (__sh__)
Nico Huberc3b02dc2023-08-12 01:13:45 +020043 #define __FLASHPROG_ARCH__ "sh"
Thomas Heijligen6efdfb32021-10-12 15:16:46 +020044#elif defined(__s390__) || defined(__s390x__) || defined(__zarch__)
Nico Huberc3b02dc2023-08-12 01:13:45 +020045 #define __FLASHPROG_ARCH__ "s390"
Thomas Heijligen6efdfb32021-10-12 15:16:46 +020046#elif defined(__arc__)
Nico Huberc3b02dc2023-08-12 01:13:45 +020047 #define __FLASHPROG_ARCH__ "arc"
Veronika Kremneva317b4ec2021-10-15 14:18:26 +030048#elif defined(__ARC64__)
Nico Huberc3b02dc2023-08-12 01:13:45 +020049 #define __FLASHPROG_ARCH__ "arc64"
Anton Samsonove5313182022-08-04 11:48:23 +030050#elif defined(__e2k__)
Nico Huberc3b02dc2023-08-12 01:13:45 +020051 #define __FLASHPROG_ARCH__ "e2k"
Thomas Heijligen6efdfb32021-10-12 15:16:46 +020052#else
Nico Huberc3b02dc2023-08-12 01:13:45 +020053 #define __FLASHPROG_ARCH__ "unknown"
Thomas Heijligen6efdfb32021-10-12 15:16:46 +020054#endif
Nico Huberc3b02dc2023-08-12 01:13:45 +020055__FLASHPROG_ARCH__