Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Oct 2010 08:36:26 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r214197 - stable/8/sys/sys
Message-ID:  <201010220836.o9M8aQ6a019255@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Fri Oct 22 08:36:26 2010
New Revision: 214197
URL: http://svn.freebsd.org/changeset/base/214197

Log:
  MFC r204955,205885: Various and sundry style, whitespace, and comment
  fixes.
  
  On behalf of:	jhb

Modified:
  stable/8/sys/sys/pcpu.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sys/pcpu.h
==============================================================================
--- stable/8/sys/sys/pcpu.h	Fri Oct 22 06:56:11 2010	(r214196)
+++ stable/8/sys/sys/pcpu.h	Fri Oct 22 08:36:26 2010	(r214197)
@@ -42,22 +42,19 @@
 #include <sys/resource.h>
 #include <machine/pcpu.h>
 
-struct pcb;
-struct thread;
-
 /*
  * Define a set for pcpu data.
  * 
  * We don't use SET_DECLARE because it defines the set as 'a' when we
- * want 'aw'.  GCC considers uninitialized data in a seperate section
- * writable and there is no generic zero initializer that works for
+ * want 'aw'.  gcc considers uninitialized data in a separate section
+ * writable, and there is no generic zero initializer that works for
  * structs and scalars.
  */
 extern uintptr_t *__start_set_pcpu;
 extern uintptr_t *__stop_set_pcpu;
 
 __asm__(
-#if defined(__arm__)
+#ifdef __arm__
 	".section set_pcpu, \"aw\", %progbits\n"
 #else
 	".section set_pcpu, \"aw\", @progbits\n"
@@ -73,8 +70,8 @@ extern uintptr_t dpcpu_off[];
 /*
  * Convenience defines.
  */
-#define	DPCPU_START		(uintptr_t)&__start_set_pcpu
-#define	DPCPU_STOP		(uintptr_t)&__stop_set_pcpu
+#define	DPCPU_START		((uintptr_t)&__start_set_pcpu)
+#define	DPCPU_STOP		((uintptr_t)&__stop_set_pcpu)
 #define	DPCPU_BYTES		(DPCPU_STOP - DPCPU_START)
 #define	DPCPU_MODMIN		2048
 #define	DPCPU_SIZE		roundup2(DPCPU_BYTES, PAGE_SIZE)
@@ -146,8 +143,8 @@ extern uintptr_t dpcpu_off[];
 
 /* 
  * XXXUPS remove as soon as we have per cpu variable
- * linker sets and  can define rm_queue in _rm_lock.h
-*/
+ * linker sets and can define rm_queue in _rm_lock.h
+ */
 struct rm_queue {
 	struct rm_queue* volatile rmq_next;
 	struct rm_queue* volatile rmq_prev;
@@ -155,7 +152,6 @@ struct rm_queue {
 
 #define	PCPU_NAME_LEN (sizeof("CPU ") + sizeof(__XSTRING(MAXCPU) + 1))
 
-
 /*
  * This structure maps out the global data that needs to be kept on a
  * per-cpu basis.  The members are accessed via the PCPU_GET/SET/PTR
@@ -168,43 +164,40 @@ struct pcpu {
 	struct thread	*pc_fpcurthread;	/* Fp state owner */
 	struct thread	*pc_deadthread;		/* Zombie thread or NULL */
 	struct pcb	*pc_curpcb;		/* Current pcb */
-	uint64_t	pc_switchtime;
-	int		pc_switchticks;
+	uint64_t	pc_switchtime;		/* cpu_ticks() at last csw */
+	int		pc_switchticks;		/* `ticks' at last csw */
 	u_int		pc_cpuid;		/* This cpu number */
 	cpumask_t	pc_cpumask;		/* This cpu mask */
 	cpumask_t	pc_other_cpus;		/* Mask of all other cpus */
 	SLIST_ENTRY(pcpu) pc_allcpu;
 	struct lock_list_entry *pc_spinlocks;
 #ifdef KTR
-	char		pc_name[PCPU_NAME_LEN];	/* String name for KTR. */
+	char		pc_name[PCPU_NAME_LEN];	/* String name for KTR */
 #endif
 	struct vmmeter	pc_cnt;			/* VM stats counters */
 	long		pc_cp_time[CPUSTATES];	/* statclock ticks */
 	struct device	*pc_device;
-	void		*pc_netisr;		/* netisr SWI cookie. */
+	void		*pc_netisr;		/* netisr SWI cookie */
 
-	/* 
+	/*
 	 * Stuff for read mostly lock
-	 * 
+	 *
 	 * XXXUPS remove as soon as we have per cpu variable
 	 * linker sets.
 	 */
-	struct rm_queue  pc_rm_queue; 
+	struct rm_queue	pc_rm_queue;
 
-	/*
-	 * Dynamic per-cpu data area.
-	 */
-	uintptr_t	pc_dynamic;
+	uintptr_t	pc_dynamic;		/* Dynamic per-cpu data area */
 
 	/*
 	 * Keep MD fields last, so that CPU-specific variations on a
 	 * single architecture don't result in offset variations of
-	 * the machine-independent fields of the pcpu. Even though
+	 * the machine-independent fields of the pcpu.  Even though
 	 * the pcpu structure is private to the kernel, some ports
-	 * (e.g. lsof, part of gtop) define _KERNEL and include this
-	 * header. While strictly speaking this is wrong, there's no
-	 * reason not to keep the offsets of the MI fields contants.
-	 * If only to make kernel debugging easier...
+	 * (e.g., lsof, part of gtop) define _KERNEL and include this
+	 * header.  While strictly speaking this is wrong, there's no
+	 * reason not to keep the offsets of the MI fields constant
+	 * if only to make kernel debugging easier.
 	 */
 	PCPU_MD_FIELDS;
 } __aligned(128);
@@ -214,6 +207,7 @@ struct pcpu {
 SLIST_HEAD(cpuhead, pcpu);
 
 extern struct cpuhead cpuhead;
+extern struct pcpu *cpuid_to_pcpu[MAXCPU];
 
 #define	curcpu		PCPU_GET(cpuid)
 #define	curproc		(curthread->td_proc)
@@ -228,21 +222,17 @@ extern struct cpuhead cpuhead;
  * db_show_mdpcpu() is responsible for handling machine dependent
  * fields for the DDB 'show pcpu' command.
  */
-
-extern struct pcpu *cpuid_to_pcpu[MAXCPU];
-
-
 void	cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size);
 void	db_show_mdpcpu(struct pcpu *pcpu);
 
-void	pcpu_destroy(struct pcpu *pcpu);
-struct	pcpu *pcpu_find(u_int cpuid);
-void	pcpu_init(struct pcpu *pcpu, int cpuid, size_t size);
 void	*dpcpu_alloc(int size);
 void	dpcpu_copy(void *s, int size);
 void	dpcpu_free(void *s, int size);
 void	dpcpu_init(void *dpcpu, int cpuid);
+void	pcpu_destroy(struct pcpu *pcpu);
+struct	pcpu *pcpu_find(u_int cpuid);
+void	pcpu_init(struct pcpu *pcpu, int cpuid, size_t size);
 
-#endif	/* _KERNEL */
+#endif /* _KERNEL */
 
 #endif /* !_SYS_PCPU_H_ */



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