Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 May 2017 10:44:43 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r319066 - in stable/10/sys: dev/sound/pcm tools/sound
Message-ID:  <201705281044.v4SAihSw045497@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Sun May 28 10:44:43 2017
New Revision: 319066
URL: https://svnweb.freebsd.org/changeset/base/319066

Log:
  MFC r318860:
  Declare the "snd_fxdiv_table" once. This shaves around 24Kbytes of
  binary data from sound.ko and the kernel.

Modified:
  stable/10/sys/dev/sound/pcm/buffer.c
  stable/10/sys/tools/sound/snd_fxdiv_gen.awk
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sound/pcm/buffer.c
==============================================================================
--- stable/10/sys/dev/sound/pcm/buffer.c	Sun May 28 10:43:16 2017	(r319065)
+++ stable/10/sys/dev/sound/pcm/buffer.c	Sun May 28 10:44:43 2017	(r319066)
@@ -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$");

Modified: stable/10/sys/tools/sound/snd_fxdiv_gen.awk
==============================================================================
--- stable/10/sys/tools/sound/snd_fxdiv_gen.awk	Sun May 28 10:43:16 2017	(r319065)
+++ stable/10/sys/tools/sound/snd_fxdiv_gen.awk	Sun May 28 10:44:43 2017	(r319066)
@@ -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");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705281044.v4SAihSw045497>