aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2017-05-28 10:46:34 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2017-05-28 10:46:34 +0000
commitda49da4b7166e055d2c409f8677b3b5661985c46 (patch)
tree25763e431649555f100a6db7175b5abedc01622c
parentaf134725236bac32196d34ed8125b083d70672aa (diff)
downloadsrc-da49da4b7166e055d2c409f8677b3b5661985c46.tar.gz
src-da49da4b7166e055d2c409f8677b3b5661985c46.zip
MFC r318860:
Declare the "snd_fxdiv_table" once. This shaves around 24Kbytes of binary data from sound.ko and the kernel.
Notes
Notes: svn path=/stable/8/; revision=319068
-rw-r--r--sys/dev/sound/pcm/buffer.c1
-rw-r--r--sys/tools/sound/snd_fxdiv_gen.awk7
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/sound/pcm/buffer.c b/sys/dev/sound/pcm/buffer.c
index a545d1006bef..5c0d58398ebb 100644
--- a/sys/dev/sound/pcm/buffer.c
+++ b/sys/dev/sound/pcm/buffer.c
@@ -35,6 +35,7 @@
#include "feeder_if.h"
#define SND_USE_FXDIV
+#define SND_DECLARE_FXDIV
#include "snd_fxdiv_gen.h"
SND_DECLARE_FILE("$FreeBSD$");
diff --git a/sys/tools/sound/snd_fxdiv_gen.awk b/sys/tools/sound/snd_fxdiv_gen.awk
index 2e1d3a545380..6e869d071b27 100644
--- a/sys/tools/sound/snd_fxdiv_gen.awk
+++ b/sys/tools/sound/snd_fxdiv_gen.awk
@@ -108,7 +108,10 @@ BEGIN {
printf(" * 508 = SND_CHN_MAX * PCM_32_BPS, which is why....\n");
printf(" */\n\n");
- printf("static const uint32_t snd_fxdiv_table[][2] = {\n");
+ printf("extern const uint32_t snd_fxdiv_table[%d][2];\n\n", SND_MAX_ALIGN + 1);
+
+ printf("#ifdef SND_DECLARE_FXDIV\n");
+ printf("const uint32_t snd_fxdiv_table[%d][2] = {\n", SND_MAX_ALIGN + 1);
for (i = 1; i <= SND_MAX_ALIGN; i++) {
if (aligns[i] != 1)
@@ -120,7 +123,7 @@ BEGIN {
i, r["mul"], r["shift"]);
}
- printf("};\n\n");
+ printf("};\n#endif\n\n");
printf("#define SND_FXDIV_MAX\t\t0x%08x\n", FXONE);
printf("#define SND_FXDIV(x, y)\t\t(((uint32_t)(x) *\t\t\t\\\n");