aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2010-11-25 15:48:44 +0200
committerLasse Collin <lasse.collin@tukaani.org>2010-11-25 15:48:44 +0200
commitbd4ca616fd7ba4559f9a0b5d399a4cd2d6fc75b6 (patch)
treed3f1d82a1af2225d810079f5ba9c32d38e3956da
parent115d16e64b315dbc1eff7f9da86faaad55d90c3b (diff)
downloadxz-embedded-bd4ca616fd7ba4559f9a0b5d399a4cd2d6fc75b6.tar.gz
Remove noinline_for_stack.
It's not needed to keep the stack usage of xz_dec_bcj_run() low because the BCJ filters get inlined into bcj_apply(), and that is not inlined into xz_dec_bcj_run(). Thanks to Andrew Morton.
-rw-r--r--linux/lib/xz/xz_dec_bcj.c18
-rw-r--r--userspace/xz_config.h14
2 files changed, 6 insertions, 26 deletions
diff --git a/linux/lib/xz/xz_dec_bcj.c b/linux/lib/xz/xz_dec_bcj.c
index d4f3500..f666fe4 100644
--- a/linux/lib/xz/xz_dec_bcj.c
+++ b/linux/lib/xz/xz_dec_bcj.c
@@ -85,8 +85,7 @@ static inline int bcj_x86_test_msbyte(uint8_t b)
return b == 0x00 || b == 0xFF;
}
-static noinline_for_stack size_t
-bcj_x86(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+static size_t bcj_x86(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
{
static const bool mask_to_allowed_status[8]
= { true, true, true, false, true, false, false, false };
@@ -158,8 +157,7 @@ bcj_x86(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
#endif
#ifdef XZ_DEC_POWERPC
-static noinline_for_stack size_t
-bcj_powerpc(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+static size_t bcj_powerpc(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
{
size_t i;
uint32_t instr;
@@ -180,8 +178,7 @@ bcj_powerpc(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
#endif
#ifdef XZ_DEC_IA64
-static noinline_for_stack size_t
-bcj_ia64(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+static size_t bcj_ia64(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
{
static const uint8_t branch_table[32] = {
0, 0, 0, 0, 0, 0, 0, 0,
@@ -265,8 +262,7 @@ bcj_ia64(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
#endif
#ifdef XZ_DEC_ARM
-static noinline_for_stack size_t
-bcj_arm(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+static size_t bcj_arm(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
{
size_t i;
uint32_t addr;
@@ -289,8 +285,7 @@ bcj_arm(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
#endif
#ifdef XZ_DEC_ARMTHUMB
-static noinline_for_stack size_t
-bcj_armthumb(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+static size_t bcj_armthumb(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
{
size_t i;
uint32_t addr;
@@ -318,8 +313,7 @@ bcj_armthumb(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
#endif
#ifdef XZ_DEC_SPARC
-static noinline_for_stack size_t
-bcj_sparc(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+static size_t bcj_sparc(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
{
size_t i;
uint32_t instr;
diff --git a/userspace/xz_config.h b/userspace/xz_config.h
index 33b017a..71bb029 100644
--- a/userspace/xz_config.h
+++ b/userspace/xz_config.h
@@ -56,20 +56,6 @@
# 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__
-# define noinline_for_stack __attribute__((__noinline__))
-# else
-# define noinline_for_stack
-# endif
-#endif
-
/* Inline functions to access unaligned unsigned 32-bit integers */
#ifndef get_unaligned_le32
static inline uint32_t get_unaligned_le32(const uint8_t *buf)