svn commit: r192533 - in head/sys/powerpc: booke powerpc

Rafal Jaworowski raj at FreeBSD.org
Thu May 21 12:05:24 UTC 2009


Author: raj
Date: Thu May 21 12:05:15 2009
New Revision: 192533
URL: http://svn.freebsd.org/changeset/base/192533

Log:
  Improve style(9), clean up.

Modified:
  head/sys/powerpc/booke/clock.c
  head/sys/powerpc/booke/locore.S
  head/sys/powerpc/booke/vm_machdep.c
  head/sys/powerpc/powerpc/busdma_machdep.c

Modified: head/sys/powerpc/booke/clock.c
==============================================================================
--- head/sys/powerpc/booke/clock.c	Thu May 21 11:43:37 2009	(r192532)
+++ head/sys/powerpc/booke/clock.c	Thu May 21 12:05:15 2009	(r192533)
@@ -79,14 +79,14 @@ __FBSDID("$FreeBSD$");
 /*
  * Initially we assume a processor with a bus frequency of 12.5 MHz.
  */
-u_int			tickspending;
-u_long			ns_per_tick = 80;
-static u_long		ticks_per_sec = 12500000;
-static long		ticks_per_intr;
+u_int tickspending;
+u_long ns_per_tick = 80;
+static u_long ticks_per_sec = 12500000;
+static long ticks_per_intr;
 
 #define	DIFF19041970	2082844800
 
-static timecounter_get_t	decr_get_timecount;
+static timecounter_get_t decr_get_timecount;
 
 static struct timecounter	decr_timecounter = {
 	decr_get_timecount,	/* get_timecount */
@@ -122,7 +122,6 @@ decr_intr(struct trapframe *frame)
 	statclock(TRAPF_USERMODE(frame));
 	if (profprocs != 0)
 		profclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
-
 }
 
 void
@@ -181,14 +180,13 @@ decr_tc_init(void)
 	tc_init(&decr_timecounter);
 }
 
-
 static unsigned
 decr_get_timecount(struct timecounter *tc)
 {
 	quad_t tb;
 
 	tb = mftb();
-	return tb;
+	return (tb);
 }
 
 /*
@@ -207,7 +205,7 @@ DELAY(int n)
 	}
 
 	start = mftb();
-	end = start + (u_quad_t)ticks_per_sec / ( USECS_IN_SEC / n);
+	end = start + (u_quad_t)ticks_per_sec / (USECS_IN_SEC / n);
 	do {
 		now = mftb();
 	} while (now < end || (now > start && end < start));

Modified: head/sys/powerpc/booke/locore.S
==============================================================================
--- head/sys/powerpc/booke/locore.S	Thu May 21 11:43:37 2009	(r192532)
+++ head/sys/powerpc/booke/locore.S	Thu May 21 12:05:15 2009	(r192533)
@@ -334,9 +334,7 @@ kernload_ap:
 
 	lis	%r3, KERNBASE at h
 	ori	%r3, %r3, KERNBASE at l	/* EPN = KERNBASE */
-#if SMP
 	ori	%r3, %r3, MAS2_M at l	/* WIMGE = 0b00100 */
-#endif
 	mtspr	SPR_MAS2, %r3
 	isync
 

Modified: head/sys/powerpc/booke/vm_machdep.c
==============================================================================
--- head/sys/powerpc/booke/vm_machdep.c	Thu May 21 11:43:37 2009	(r192532)
+++ head/sys/powerpc/booke/vm_machdep.c	Thu May 21 12:05:15 2009	(r192533)
@@ -14,8 +14,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -226,10 +224,7 @@ cpu_fork(struct thread *td1, struct proc
  * This is needed to make kernel threads stay in kernel mode.
  */
 void
-cpu_set_fork_handler(td, func, arg)
-	struct thread *td;
-	void (*func)(void *);
-	void *arg;
+cpu_set_fork_handler(struct thread *td, void (*func)(void *), void *arg)
 {
 	struct callframe *cf;
 
@@ -331,7 +326,7 @@ done:
 }
 
 /*
- * Detatch mapped page and release resources back to the system.
+ * Detach mapped page and release resources back to the system.
  *
  * Remove a reference from the given sf_buf, adding it to the free
  * list when its reference count reaches zero. A freed sf_buf still,
@@ -341,6 +336,7 @@ done:
 void
 sf_buf_free(struct sf_buf *sf)
 {
+
 	mtx_lock(&sf_buf_lock);
 	sf->ref_count--;
 	if (sf->ref_count == 0) {

Modified: head/sys/powerpc/powerpc/busdma_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/busdma_machdep.c	Thu May 21 11:43:37 2009	(r192532)
+++ head/sys/powerpc/powerpc/busdma_machdep.c	Thu May 21 12:05:15 2009	(r192533)
@@ -31,7 +31,7 @@
 __FBSDID("$FreeBSD$");
 
 /*
- * MacPPC bus dma support routines
+ * Bus dma support routines
  */
 
 #include <sys/param.h>
@@ -124,11 +124,10 @@ dflt_lock(void *arg, bus_dma_lock_op_t o
  */
 int
 bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
-		   bus_size_t boundary, bus_addr_t lowaddr,
-		   bus_addr_t highaddr, bus_dma_filter_t *filter,
-		   void *filterarg, bus_size_t maxsize, int nsegments,
-		   bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
-		   void *lockfuncarg, bus_dma_tag_t *dmat)
+    bus_size_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr,
+    bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize,
+    int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
+    void *lockfuncarg, bus_dma_tag_t *dmat)
 {
 	bus_dma_tag_t newtag;
 	int error = 0;
@@ -251,7 +250,7 @@ bus_dmamap_destroy(bus_dma_tag_t dmat, b
  */
 int
 bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags,
-                 bus_dmamap_t *mapp)
+    bus_dmamap_t *mapp)
 {
 	int mflags;
 
@@ -319,9 +318,8 @@ bus_dmamem_free(bus_dma_tag_t dmat, void
  */
 static int
 bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dma_segment_t segs[],
-    void *buf, bus_size_t buflen, struct thread *td,
-    int flags, vm_offset_t *lastaddrp, int *segp,
-    int first)
+    void *buf, bus_size_t buflen, struct thread *td, int flags,
+    vm_offset_t *lastaddrp, int *segp, int first)
 {
 	bus_size_t sgsize;
 	bus_addr_t curaddr, lastaddr, baddr, bmask;
@@ -405,8 +403,8 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma
  */
 int
 bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
-		bus_size_t buflen, bus_dmamap_callback_t *callback,
-		void *callback_arg, int flags)
+    bus_size_t buflen, bus_dmamap_callback_t *callback,
+    void *callback_arg, int flags)
 {
 #ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT
 	bus_dma_segment_t	dm_segments[dmat->nsegments];
@@ -437,8 +435,7 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_
  */
 int
 bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map, struct mbuf *m0,
-		     bus_dmamap_callback2_t *callback, void *callback_arg,
-		     int flags)
+    bus_dmamap_callback2_t *callback, void *callback_arg, int flags)
 {
 #ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT
 	bus_dma_segment_t dm_segments[dmat->nsegments];
@@ -480,7 +477,7 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat,
 
 int
 bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, struct mbuf *m0,
-			bus_dma_segment_t *segs, int *nsegs, int flags)
+    bus_dma_segment_t *segs, int *nsegs, int flags)
 {
 	int error = 0;
 
@@ -514,8 +511,7 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dm
  */
 int
 bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map, struct uio *uio,
-    bus_dmamap_callback2_t *callback, void *callback_arg,
-    int flags)
+    bus_dmamap_callback2_t *callback, void *callback_arg, int flags)
 {
 	vm_offset_t lastaddr;
 #ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT


More information about the svn-src-all mailing list