architecture.h revision 46eea341c36f0caf0bdd5b2274a1ef7cb4e83e97
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#pragma once
/***
This file is part of systemd.
Copyright 2014 Lennart Poettering
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "util.h"
typedef enum Architecture {
ARCHITECTURE_X86 = 0,
} Architecture;
Architecture uname_architecture(void);
#if defined(__x86_64__)
# define native_architecture() ARCHITECTURE_X86_64
# define native_architecture() ARCHITECTURE_X86
#elif defined(__powerpc64__)
# if defined(WORDS_BIGENDIAN)
# define native_architecture() ARCHITECTURE_PPC64
# else
# define native_architecture() ARCHITECTURE_PPC64_LE
# endif
#elif defined(__powerpc__)
# if defined(WORDS_BIGENDIAN)
# define native_architecture() ARCHITECTURE_PPC
# else
# define native_architecture() ARCHITECTURE_PPC_LE
# endif
# define native_architecture() ARCHITECTURE_IA64
#elif defined(__hppa64__)
# define native_architecture() ARCHITECTURE_PARISC64
# define native_architecture() ARCHITECTURE_PARISC
# define native_architecture() ARCHITECTURE_S390X
# define native_architecture() ARCHITECTURE_S390
#elif defined(__sparc64__)
# define native_architecture() ARCHITECTURE_SPARC64
# define native_architecture() ARCHITECTURE_SPARC
#elif defined(__mips64__)
# define native_architecture() ARCHITECTURE_MIPS64
# define native_architecture() ARCHITECTURE_MIPS
# define native_architecture() ARCHITECTURE_ALPHA
#elif defined(__aarch64__)
# if defined(WORDS_BIGENDIAN)
# define native_architecture() ARCHITECTURE_ARM64_BE
# else
# define native_architecture() ARCHITECTURE_ARM64
# endif
# if defined(WORDS_BIGENDIAN)
# define native_architecture() ARCHITECTURE_ARM_BE
# else
# define native_architecture() ARCHITECTURE_ARM
# endif
# define native_architecture() ARCHITECTURE_SH64
# define native_architecture() ARCHITECTURE_SH
# define native_architecture() ARCHITECTURE_M68K
#elif defined(__tilegx__)
# define native_architecture() ARCHITECTURE_TILEGX
#else
#error "Please register your architecture here!"
#endif