Module Name: src Committed By: matt Date: Fri Sep 5 05:47:40 UTC 2014
Modified Files: src/sys/sys: device.h disklabel.h resourcevar.h Log Message: Don't nest structure definitions. To generate a diff of this commit: cvs rdiff -u -r1.144 -r1.145 src/sys/sys/device.h cvs rdiff -u -r1.116 -r1.117 src/sys/sys/disklabel.h cvs rdiff -u -r1.54 -r1.55 src/sys/sys/resourcevar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/sys/device.h diff -u src/sys/sys/device.h:1.144 src/sys/sys/device.h:1.145 --- src/sys/sys/device.h:1.144 Sat Oct 12 16:49:01 2013 +++ src/sys/sys/device.h Fri Sep 5 05:47:40 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: device.h,v 1.144 2013/10/12 16:49:01 christos Exp $ */ +/* $NetBSD: device.h,v 1.145 2014/09/05 05:47:40 matt Exp $ */ /* * Copyright (c) 1996, 2000 Christopher G. Demetriou @@ -138,6 +138,11 @@ struct device_suspensor { #define DEVICE_SUSPENSORS_MAX 16 +struct device_garbage { + device_t *dg_devs; + int dg_ndevs; +}; + struct device { devclass_t dv_class; /* this device's classification */ TAILQ_ENTRY(device) dv_list; /* entry on list of all devices */ @@ -182,10 +187,7 @@ struct device { *dv_bus_suspensors[DEVICE_SUSPENSORS_MAX], *dv_driver_suspensors[DEVICE_SUSPENSORS_MAX], *dv_class_suspensors[DEVICE_SUSPENSORS_MAX]; - struct device_garbage { - device_t *dg_devs; - int dg_ndevs; - } dv_garbage; + struct device_garbage dv_garbage; }; /* dv_flags */ Index: src/sys/sys/disklabel.h diff -u src/sys/sys/disklabel.h:1.116 src/sys/sys/disklabel.h:1.117 --- src/sys/sys/disklabel.h:1.116 Tue Nov 5 00:36:02 2013 +++ src/sys/sys/disklabel.h Fri Sep 5 05:47:40 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.h,v 1.116 2013/11/05 00:36:02 msaitoh Exp $ */ +/* $NetBSD: disklabel.h,v 1.117 2014/09/05 05:47:40 matt Exp $ */ /* * Copyright (c) 1987, 1988, 1993 @@ -98,6 +98,24 @@ #define DISKMAGIC ((uint32_t)0x82564557) /* The disk magic number */ #ifndef _LOCORE +struct partition { /* the partition table */ + uint32_t p_size; /* number of sectors in partition */ + uint32_t p_offset; /* starting sector */ + union { + uint32_t fsize; /* FFS, ADOS: filesystem basic fragment size */ + uint32_t cdsession; /* ISO9660: session offset */ + } __partition_u2; +#define p_fsize __partition_u2.fsize +#define p_cdsession __partition_u2.cdsession + uint8_t p_fstype; /* filesystem type, see below */ + uint8_t p_frag; /* filesystem fragments per block */ + union { + uint16_t cpg; /* UFS: FS cylinders per group */ + uint16_t sgs; /* LFS: FS segment shift */ + } __partition_u1; +#define p_cpg __partition_u1.cpg +#define p_sgs __partition_u1.sgs +}; struct disklabel { uint32_t d_magic; /* the magic number */ uint16_t d_type; /* drive type */ @@ -181,25 +199,8 @@ struct disklabel { uint16_t d_npartitions; /* number of partitions in following */ uint32_t d_bbsize; /* size of boot area at sn0, bytes */ uint32_t d_sbsize; /* max size of fs superblock, bytes */ - struct partition { /* the partition table */ - uint32_t p_size; /* number of sectors in partition */ - uint32_t p_offset; /* starting sector */ - union { - uint32_t fsize; /* FFS, ADOS: - filesystem basic fragment size */ - uint32_t cdsession; /* ISO9660: session offset */ - } __partition_u2; -#define p_fsize __partition_u2.fsize -#define p_cdsession __partition_u2.cdsession - uint8_t p_fstype; /* filesystem type, see below */ - uint8_t p_frag; /* filesystem fragments per block */ - union { - uint16_t cpg; /* UFS: FS cylinders per group */ - uint16_t sgs; /* LFS: FS segment shift */ - } __partition_u1; -#define p_cpg __partition_u1.cpg -#define p_sgs __partition_u1.sgs - } d_partitions[MAXPARTITIONS]; /* actually may be more */ + struct partition d_partitions[MAXPARTITIONS]; + /* the partition table, actually may be more */ }; #if defined(__HAVE_OLD_DISKLABEL) && !HAVE_NBTOOL_CONFIG_H Index: src/sys/sys/resourcevar.h diff -u src/sys/sys/resourcevar.h:1.54 src/sys/sys/resourcevar.h:1.55 --- src/sys/sys/resourcevar.h:1.54 Sat Nov 3 23:22:22 2012 +++ src/sys/sys/resourcevar.h Fri Sep 5 05:47:40 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: resourcevar.h,v 1.54 2012/11/03 23:22:22 njoly Exp $ */ +/* $NetBSD: resourcevar.h,v 1.55 2014/09/05 05:47:40 matt Exp $ */ /* * Copyright (c) 1991, 1993 @@ -43,6 +43,15 @@ /* * Kernel per-process accounting / statistics */ +struct uprof { /* profile arguments */ + char * pr_base; /* buffer base */ + size_t pr_size; /* buffer size */ + u_long pr_off; /* pc offset */ + u_int pr_scale; /* pc scaling */ + u_long pr_addr; /* temp storage for addr until AST */ + u_long pr_ticks; /* temp storage for ticks until AST */ +}; + struct pstats { #define pstat_startzero p_ru struct rusage p_ru; /* stats for this proc */ @@ -51,15 +60,7 @@ struct pstats { #define pstat_startcopy p_timer struct itimerspec p_timer[3]; /* virtual-time timers */ - - struct uprof { /* profile arguments */ - char * pr_base; /* buffer base */ - size_t pr_size; /* buffer size */ - u_long pr_off; /* pc offset */ - u_int pr_scale; /* pc scaling */ - u_long pr_addr; /* temp storage for addr until AST */ - u_long pr_ticks; /* temp storage for ticks until AST */ - } p_prof; + struct uprof p_prof; /* profile arguments */ #define pstat_endcopy p_start struct timeval p_start; /* starting time */ };