/* xz_config.h - Private includes and definitions for userspace use */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2010 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* This file is based on code from XZ embedded project
*/
#ifndef XZ_CONFIG_H
#define XZ_CONFIG_H
/* Enable BCJ filter decoders. */
#if defined(GRUB_TARGET_CPU_I386) || defined(GRUB_TARGET_CPU_X86_64)
#define XZ_DEC_X86
#endif
#ifdef GRUB_TARGET_CPU_POWERPC
#define XZ_DEC_POWERPC
#endif
#ifdef GRUB_TARGET_CPU_IA64
#define XZ_DEC_IA64
#endif
#ifdef GRUB_TARGET_CPU_ARM
#define XZ_DEC_ARM
#endif
#if 0
#define XZ_DEC_ARMTHUMB
#endif
#ifdef GRUB_TARGET_CPU_SPARC
#define XZ_DEC_SPARC
#endif
#include "xz.h"
#include <stdlib.h>
#define min(x, y) ((x) < (y) ? (x) : (y))
/*
* Some functions have been marked with __always_inline to keep the
* performance reasonable even when the compiler is optimizing for
* small code size. You may be able to save a few bytes by #defining
* __always_inline to plain inline, but don't complain if the code
* becomes slow.
*
* so if you want to change it, it you need to #undef it first.
*/
#ifndef __always_inline
# ifdef __GNUC__
# define __always_inline \
inline __attribute__((__always_inline__))
# else
# define __always_inline inline
# endif
#endif
/*
* Some functions are marked to never be inlined to reduce stack usage.
* If you don't care about stack usage, you may want to modify this so
* that noinline_for_stack is #defined to be empty even when using GCC.
* Doing so may save a few bytes in binary size.
*/
#ifndef noinline_for_stack
# ifdef __GNUC__
# else
# define noinline_for_stack
# endif
#endif
/* Inline functions to access unaligned unsigned 32-bit integers */
{
}
{
}
{
}
{
}
/*
* Use get_unaligned_le32() also for aligned access for simplicity. On
* little endian systems, #define get_le32(ptr) (*(const uint32_t *)(ptr))
* could save a few bytes in code size.
*/
#endif