Declare the "snd_fxdiv_table" once. This shaves around 24Kbytes of

binary data from sound.ko and the kernel.

MFC after:		3 days
This commit is contained in:
Hans Petter Selasky 2017-05-25 05:23:47 +00:00
parent 7e0699952a
commit 3f9dcc588d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=318860
2 changed files with 6 additions and 2 deletions

View File

@ -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$");

View File

@ -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");