#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 <endian.h>
#include "macro.h"
#include "util.h"
/* A cleaned up architecture definition. We don't want to get lost in
* processor features, models, generations or even ABIs. Hence we
* focus on general family, and distinguish word width and
* endianness. */
enum {
ARCHITECTURE_X86 = 0,
};
int uname_architecture(void);
/*
* LIB_ARCH_TUPLE should resolve to the local library path
* architecture tuple systemd is built for, according to the Debian
* tuple list:
*
*
* This is used in library search paths that should understand
* Debian's paths on all distributions.
*/
#if defined(__x86_64__)
#elif defined(__powerpc64__)
# if __BYTE_ORDER == __BIG_ENDIAN
# else
# endif
#elif defined(__powerpc__)
# if __BYTE_ORDER == __BIG_ENDIAN
# else
# error "Missing LIB_ARCH_TUPLE for PPCLE"
# endif
#elif defined(__hppa64__)
# error "Missing LIB_ARCH_TUPLE for HPPA64"
#elif defined(__sparc64__)
#elif defined(__mips64__)
# if __BYTE_ORDER == __BIG_ENDIAN
# error "Missing LIB_ARCH_TUPLE for MIPS64"
# else
# error "Missing LIB_ARCH_TUPLE for MIPS64_LE"
# endif
# if __BYTE_ORDER == __BIG_ENDIAN
# else
# endif
#elif defined(__aarch64__)
# if __BYTE_ORDER == __BIG_ENDIAN
# else
# endif
# if __BYTE_ORDER == __BIG_ENDIAN
# if defined(__ARM_EABI__)
# if defined(__ARM_PCS_VFP)
# else
# endif
# else
# endif
# else
# if defined(__ARM_EABI__)
# if defined(__ARM_PCS_VFP)
# else
# endif
# else
# endif
# endif
# error "Missing LIB_ARCH_TUPLE for SH64"
#elif defined(__tilegx__)
# error "Missing LIB_ARCH_TUPLE for TILEGX"
# error "Missing LIB_ARCH_TUPLE for CRIS"
#else
# error "Please register your architecture here!"
#endif
#ifndef PROC_CPUINFO_MODEL
#warning "PROC_CPUINFO_MODEL not defined for your architecture"
#endif
const char *architecture_to_string(int a) _const_;
int architecture_from_string(const char *s) _pure_;