Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch use c99 struct initializers
details: https://anonhg.NetBSD.org/src/rev/daa3583d5525
branches: trunk
changeset: 768770:daa3583d5525
user: christos <christos%NetBSD.org@localhost>
date: Sat Aug 27 09:32:11 2011 +0000
description:
use c99 struct initializers
diffstat:
sys/arch/i386/eisa/eisa_machdep.c | 47 ++++++++++--------
sys/arch/i386/mca/mca_machdep.c | 47 ++++++++++--------
sys/arch/x86/isa/isa_machdep.c | 47 ++++++++++--------
sys/arch/x86/pci/pci_machdep.c | 96 ++++++++++++++++++++------------------
sys/arch/xen/xen/isa_machdep.c | 47 ++++++++++--------
sys/arch/xen/xen/xpci_xenbus.c | 96 ++++++++++++++++++++------------------
6 files changed, 202 insertions(+), 178 deletions(-)
diffs (truncated from 520 to 300 lines):
diff -r 6c6b39af63be -r daa3583d5525 sys/arch/i386/eisa/eisa_machdep.c
--- a/sys/arch/i386/eisa/eisa_machdep.c Sat Aug 27 09:28:55 2011 +0000
+++ b/sys/arch/i386/eisa/eisa_machdep.c Sat Aug 27 09:32:11 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: eisa_machdep.c,v 1.35 2011/07/01 18:14:15 dyoung Exp $ */
+/* $NetBSD: eisa_machdep.c,v 1.36 2011/08/27 09:32:12 christos Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: eisa_machdep.c,v 1.35 2011/07/01 18:14:15 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: eisa_machdep.c,v 1.36 2011/08/27 09:32:12 christos Exp $");
#include "ioapic.h"
@@ -93,26 +93,29 @@
* of these funcions.
*/
struct x86_bus_dma_tag eisa_bus_dma_tag = {
- 0, /* _tag_needs_free */
- 0, /* _bounce_thresh */
- 0, /* _bounce_alloc_lo */
- 0, /* _bounce_alloc_hi */
- NULL, /* _may_bounce */
- _bus_dmamap_create,
- _bus_dmamap_destroy,
- _bus_dmamap_load,
- _bus_dmamap_load_mbuf,
- _bus_dmamap_load_uio,
- _bus_dmamap_load_raw,
- _bus_dmamap_unload,
- NULL, /* _dmamap_sync */
- _bus_dmamem_alloc,
- _bus_dmamem_free,
- _bus_dmamem_map,
- _bus_dmamem_unmap,
- _bus_dmamem_mmap,
- _bus_dmatag_subregion,
- _bus_dmatag_destroy,
+ ._tag_needs_free = 0,
+ ._bounce_thresh = 0,
+ ._bounce_alloc_lo = 0,
+ ._bounce_alloc_hi = 0,
+ ._may_bounce = NULL,
+
+ ._dmamap_create = _bus_dmamap_create,
+ ._dmamap_destroy = _bus_dmamap_destroy,
+ ._dmamap_load = _bus_dmamap_load,
+ ._dmamap_load_mbuf = _bus_dmamap_load_mbuf,
+ ._dmamap_load_uio = _bus_dmamap_load_uio,
+ ._dmamap_load_raw = _bus_dmamap_load_raw,
+ ._dmamap_unload = _bus_dmamap_unload,
+ ._dmamap_sync = NULL,
+
+ ._dmamem_alloc = _bus_dmamem_alloc,
+ ._dmamem_free = _bus_dmamem_free,
+ ._dmamem_map = _bus_dmamem_map,
+ ._dmamem_unmap = _bus_dmamem_unmap,
+ ._dmamem_mmap = _bus_dmamem_mmap,
+
+ ._dmatag_subregion = _bus_dmatag_subregion,
+ ._dmatag_destroy = _bus_dmatag_destroy,
};
void
diff -r 6c6b39af63be -r daa3583d5525 sys/arch/i386/mca/mca_machdep.c
--- a/sys/arch/i386/mca/mca_machdep.c Sat Aug 27 09:28:55 2011 +0000
+++ b/sys/arch/i386/mca/mca_machdep.c Sat Aug 27 09:32:11 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mca_machdep.c,v 1.41 2011/07/01 18:14:15 dyoung Exp $ */
+/* $NetBSD: mca_machdep.c,v 1.42 2011/08/27 09:32:12 christos Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mca_machdep.c,v 1.41 2011/07/01 18:14:15 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mca_machdep.c,v 1.42 2011/08/27 09:32:12 christos Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -101,26 +101,29 @@
#define MCA_DMA_BOUNCE_THRESHOLD (16 * 1024 * 1024)
struct x86_bus_dma_tag mca_bus_dma_tag = {
- 0,
- MCA_DMA_BOUNCE_THRESHOLD, /* _bounce_thresh */
- 0, /* _bounce_alloc_lo */
- MCA_DMA_BOUNCE_THRESHOLD, /* _bounce_alloc_hi */
- NULL, /* _may_bounce */
- _bus_dmamap_create,
- _bus_dmamap_destroy,
- _bus_dmamap_load,
- _bus_dmamap_load_mbuf,
- _bus_dmamap_load_uio,
- _bus_dmamap_load_raw,
- _bus_dmamap_unload,
- _bus_dmamap_sync,
- _bus_dmamem_alloc,
- _bus_dmamem_free,
- _bus_dmamem_map,
- _bus_dmamem_unmap,
- _bus_dmamem_mmap,
- _bus_dmatag_subregion,
- _bus_dmatag_destroy,
+ ._tag_needs_free = 0,
+ ._bounce_thresh = MCA_DMA_BOUNCE_THRESHOLD,
+ ._bounce_alloc_lo = 0,
+ ._bounce_alloc_hi = MCA_DMA_BOUNCE_THRESHOLD,
+ ._may_bounce = NULL,
+
+ ._dmamap_create = _bus_dmamap_create,
+ ._dmamap_destroy = _bus_dmamap_destroy,
+ ._dmamap_load = _bus_dmamap_load,
+ ._dmamap_load_mbuf = _bus_dmamap_load_mbuf,
+ ._dmamap_load_uio = _bus_dmamap_load_uio,
+ ._dmamap_load_raw = _bus_dmamap_load_raw,
+ ._dmamap_unload = _bus_dmamap_unload,
+ ._dmamap_sync = _bus_dmamap_sync,
+
+ ._dmamem_alloc = _bus_dmamem_alloc,
+ ._dmamem_free = _bus_dmamem_free,
+ ._dmamem_map = _bus_dmamem_map,
+ ._dmamem_unmap = _bus_dmamem_unmap,
+ ._dmamem_mmap = _bus_dmamem_mmap,
+
+ ._dmatag_subregion = _bus_dmatag_subregion,
+ ._dmatag_destroy = _bus_dmatag_destroy,
};
/* Updated in mca_busprobe() if appropriate. */
diff -r 6c6b39af63be -r daa3583d5525 sys/arch/x86/isa/isa_machdep.c
--- a/sys/arch/x86/isa/isa_machdep.c Sat Aug 27 09:28:55 2011 +0000
+++ b/sys/arch/x86/isa/isa_machdep.c Sat Aug 27 09:32:11 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isa_machdep.c,v 1.28 2009/08/19 15:04:27 dyoung Exp $ */
+/* $NetBSD: isa_machdep.c,v 1.29 2011/08/27 09:32:11 christos Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.28 2009/08/19 15:04:27 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.29 2011/08/27 09:32:11 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -96,26 +96,29 @@
static int _isa_dma_may_bounce(bus_dma_tag_t, bus_dmamap_t, int, int *);
struct x86_bus_dma_tag isa_bus_dma_tag = {
- 0, /* _tag_needs_free */
- ISA_DMA_BOUNCE_THRESHOLD, /* _bounce_thresh */
- 0, /* _bounce_alloc_lo */
- ISA_DMA_BOUNCE_THRESHOLD, /* _bounce_alloc_hi */
- _isa_dma_may_bounce,
- _bus_dmamap_create,
- _bus_dmamap_destroy,
- _bus_dmamap_load,
- _bus_dmamap_load_mbuf,
- _bus_dmamap_load_uio,
- _bus_dmamap_load_raw,
- _bus_dmamap_unload,
- _bus_dmamap_sync,
- _bus_dmamem_alloc,
- _bus_dmamem_free,
- _bus_dmamem_map,
- _bus_dmamem_unmap,
- _bus_dmamem_mmap,
- _bus_dmatag_subregion,
- _bus_dmatag_destroy,
+ ._tag_needs_free = 0,
+ ._bounce_thresh = ISA_DMA_BOUNCE_THRESHOLD,
+ ._bounce_alloc_lo = 0,
+ ._bounce_alloc_hi = ISA_DMA_BOUNCE_THRESHOLD,
+ ._may_bounce = _isa_dma_may_bounce,
+
+ ._dmamap_create = _bus_dmamap_create,
+ ._dmamap_destroy = _bus_dmamap_destroy,
+ ._dmamap_load = _bus_dmamap_load,
+ ._dmamap_load_mbuf = _bus_dmamap_load_mbuf,
+ ._dmamap_load_uio = _bus_dmamap_load_uio,
+ ._dmamap_load_raw = _bus_dmamap_load_raw,
+ ._dmamap_unload = _bus_dmamap_unload,
+ ._dmamap_sync = _bus_dmamap_sync,
+
+ ._dmamem_alloc = _bus_dmamem_alloc,
+ ._dmamem_free = _bus_dmamem_free,
+ ._dmamem_map = _bus_dmamem_map,
+ ._dmamem_unmap = _bus_dmamem_unmap,
+ ._dmamem_mmap = _bus_dmamem_mmap,
+
+ ._dmatag_subregion = _bus_dmatag_subregion,
+ ._dmatag_destroy = _bus_dmatag_destroy,
};
#define IDTVEC(name) __CONCAT(X,name)
diff -r 6c6b39af63be -r daa3583d5525 sys/arch/x86/pci/pci_machdep.c
--- a/sys/arch/x86/pci/pci_machdep.c Sat Aug 27 09:28:55 2011 +0000
+++ b/sys/arch/x86/pci/pci_machdep.c Sat Aug 27 09:32:11 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep.c,v 1.45 2011/05/17 17:34:53 dyoung Exp $ */
+/* $NetBSD: pci_machdep.c,v 1.46 2011/08/27 09:32:11 christos Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.45 2011/05/17 17:34:53 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.46 2011/08/27 09:32:11 christos Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -191,56 +191,62 @@
* of these functions.
*/
struct x86_bus_dma_tag pci_bus_dma_tag = {
- 0, /* tag_needs_free */
+ ._tag_needs_free = 0,
#if defined(_LP64) || defined(PAE)
- PCI32_DMA_BOUNCE_THRESHOLD, /* bounce_thresh */
- ISA_DMA_BOUNCE_THRESHOLD, /* bounce_alloclo */
- PCI32_DMA_BOUNCE_THRESHOLD, /* bounce_allochi */
+ ._bounce_thresh = PCI32_DMA_BOUNCE_THRESHOLD,
+ ._bounce_alloc_lo = ISA_DMA_BOUNCE_THRESHOLD,
+ ._bounce_alloc_hi = PCI32_DMA_BOUNCE_THRESHOLD,
#else
- 0,
- 0,
- 0,
+ ._bounce_thresh = 0,
+ ._bounce_alloc_lo = 0,
+ ._bounce_alloc_hi = 0,
#endif
- NULL, /* _may_bounce */
- _bus_dmamap_create,
- _bus_dmamap_destroy,
- _bus_dmamap_load,
- _bus_dmamap_load_mbuf,
- _bus_dmamap_load_uio,
- _bus_dmamap_load_raw,
- _bus_dmamap_unload,
- _bus_dmamap_sync,
- _bus_dmamem_alloc,
- _bus_dmamem_free,
- _bus_dmamem_map,
- _bus_dmamem_unmap,
- _bus_dmamem_mmap,
- _bus_dmatag_subregion,
- _bus_dmatag_destroy,
+ ._may_bounce = NULL,
+
+ ._dmamap_create = _bus_dmamap_create,
+ ._dmamap_destroy = _bus_dmamap_destroy,
+ ._dmamap_load = _bus_dmamap_load,
+ ._dmamap_load_mbuf = _bus_dmamap_load_mbuf,
+ ._dmamap_load_uio = _bus_dmamap_load_uio,
+ ._dmamap_load_raw = _bus_dmamap_load_raw,
+ ._dmamap_unload = _bus_dmamap_unload,
+ ._dmamap_sync = _bus_dmamap_sync,
+
+ ._dmamem_alloc = _bus_dmamem_alloc,
+ ._dmamem_free = _bus_dmamem_free,
+ ._dmamem_map = _bus_dmamem_map,
+ ._dmamem_unmap = _bus_dmamem_unmap,
+ ._dmamem_mmap = _bus_dmamem_mmap,
+
+ ._dmatag_subregion = _bus_dmatag_subregion,
+ ._dmatag_destroy = _bus_dmatag_destroy,
};
#ifdef _LP64
struct x86_bus_dma_tag pci_bus_dma64_tag = {
- 0, /* tag_needs_free */
- 0,
- 0,
- 0,
- NULL, /* _may_bounce */
- _bus_dmamap_create,
- _bus_dmamap_destroy,
- _bus_dmamap_load,
- _bus_dmamap_load_mbuf,
- _bus_dmamap_load_uio,
- _bus_dmamap_load_raw,
- _bus_dmamap_unload,
- NULL,
- _bus_dmamem_alloc,
- _bus_dmamem_free,
- _bus_dmamem_map,
- _bus_dmamem_unmap,
- _bus_dmamem_mmap,
Home |
Main Index |
Thread Index |
Old Index