From owner-svn-src-stable-11@freebsd.org  Sun May 28 10:43:18 2017
Return-Path: <owner-svn-src-stable-11@freebsd.org>
Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CE5ED85C93;
 Sun, 28 May 2017 10:43:18 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CC69B1E86;
 Sun, 28 May 2017 10:43:17 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4SAhGXK045378;
 Sun, 28 May 2017 10:43:16 GMT (envelope-from hselasky@FreeBSD.org)
Received: (from hselasky@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4SAhGl7045376;
 Sun, 28 May 2017 10:43:16 GMT (envelope-from hselasky@FreeBSD.org)
Message-Id: <201705281043.v4SAhGl7045376@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hselasky set sender to
 hselasky@FreeBSD.org using -f
From: Hans Petter Selasky <hselasky@FreeBSD.org>
Date: Sun, 28 May 2017 10:43:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject: svn commit: r319065 - in stable/11/sys: dev/sound/pcm tools/sound
X-SVN-Group: stable-11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable-11@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: SVN commit messages for only the 11-stable src tree
 <svn-src-stable-11.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-stable-11>, 
 <mailto:svn-src-stable-11-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable-11/>
List-Post: <mailto:svn-src-stable-11@freebsd.org>
List-Help: <mailto:svn-src-stable-11-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11>, 
 <mailto:svn-src-stable-11-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 28 May 2017 10:43:18 -0000

Author: hselasky
Date: Sun May 28 10:43:16 2017
New Revision: 319065
URL: https://svnweb.freebsd.org/changeset/base/319065

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

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

Modified: stable/11/sys/dev/sound/pcm/buffer.c
==============================================================================
--- stable/11/sys/dev/sound/pcm/buffer.c	Sun May 28 09:29:53 2017	(r319064)
+++ stable/11/sys/dev/sound/pcm/buffer.c	Sun May 28 10:43:16 2017	(r319065)
@@ -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/11/sys/tools/sound/snd_fxdiv_gen.awk
==============================================================================
--- stable/11/sys/tools/sound/snd_fxdiv_gen.awk	Sun May 28 09:29:53 2017	(r319064)
+++ stable/11/sys/tools/sound/snd_fxdiv_gen.awk	Sun May 28 10:43:16 2017	(r319065)
@@ -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");