Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Jan 2011 00:52:57 +0000 (UTC)
From:      Matthew D Fleming <mdf@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r217337 - head/sys/x86/x86
Message-ID:  <201101130052.p0D0qvDL032596@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mdf
Date: Thu Jan 13 00:52:57 2011
New Revision: 217337
URL: http://svn.freebsd.org/changeset/base/217337

Log:
  Revert to using bus_size_t for the bounce_zone's alignment member.
  
  Reuqested by:	jhb

Modified:
  head/sys/x86/x86/busdma_machdep.c

Modified: head/sys/x86/x86/busdma_machdep.c
==============================================================================
--- head/sys/x86/x86/busdma_machdep.c	Wed Jan 12 23:46:12 2011	(r217336)
+++ head/sys/x86/x86/busdma_machdep.c	Thu Jan 13 00:52:57 2011	(r217337)
@@ -100,7 +100,7 @@ struct bounce_zone {
 	int		total_bounced;
 	int		total_deferred;
 	int		map_count;
-	uint32_t	alignment;
+	bus_size_t	alignment;
 	bus_addr_t	lowaddr;
 	char		zoneid[8];
 	char		lowaddrid[20];
@@ -993,6 +993,13 @@ busdma_sysctl_tree_top(struct bounce_zon
 	return (bz->sysctl_tree_top);
 }
 
+#if defined(__amd64__) || defined(PAE)
+#define	SYSCTL_ADD_BUS_SIZE_T	SYSCTL_ADD_UQUAD
+#else
+#define	SYSCTL_ADD_BUS_SIZE_T(ctx, parent, nbr, name, flag, ptr, desc)	\
+	SYSCTL_ADD_UINT(ctx, parent, nbr, name, flag, ptr, 0, desc)
+#endif
+
 static int
 alloc_bounce_zone(bus_dma_tag_t dmat)
 {
@@ -1060,9 +1067,9 @@ alloc_bounce_zone(bus_dma_tag_t dmat)
 	SYSCTL_ADD_STRING(busdma_sysctl_tree(bz),
 	    SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO,
 	    "lowaddr", CTLFLAG_RD, bz->lowaddrid, 0, "");
-	SYSCTL_ADD_UINT(busdma_sysctl_tree(bz),
+	SYSCTL_ADD_BUS_SIZE_T(busdma_sysctl_tree(bz),
 	    SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO,
-	    "alignment", CTLFLAG_RD, &bz->alignment, 0, "");
+	    "alignment", CTLFLAG_RD, &bz->alignment, "");
 
 	return (0);
 }



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