Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jan 2008 02:46:15 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 132362 for review
Message-ID:  <200801030246.m032kFJd018804@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=132362

Change 132362 by imp@imp_paco-paco on 2008/01/03 02:45:21

	Lots of little cleanups to make machdep.c compile.

Affected files ...

.. //depot/projects/mips2-jnpr/src/sys/mips/include/asm.h#6 edit
.. //depot/projects/mips2-jnpr/src/sys/mips/mips/machdep.c#4 edit

Differences ...

==== //depot/projects/mips2-jnpr/src/sys/mips/include/asm.h#6 (text+ko) ====

@@ -374,93 +374,93 @@
 #endif	/* _MIPS_BSD_API */
 
 #define	mfc0_macro(data, spr)						\
-	asm volatile ("mfc0 %0, $%1"					\
+	__asm __volatile ("mfc0 %0, $%1"				\
 			: "=r" (data)	/* outputs */			\
 			: "i" (spr));	/* inputs */
 
 #define	mtc0_macro(data, spr)						\
-	asm volatile ("mtc0 %0, $%1"					\
+	__asm __volatile ("mtc0 %0, $%1"				\
 			:				/* outputs */	\
 			: "r" (data), "i" (spr));	/* inputs */
 
 #define	cfc0_macro(data, spr)						\
-	asm volatile ("cfc0 %0, $%1"					\
+	__asm __volatile ("cfc0 %0, $%1"				\
 			: "=r" (data)	/* outputs */			\
 			: "i" (spr));	/* inputs */
 
 #define	ctc0_macro(data, spr)						\
-	asm volatile ("ctc0 %0, $%1"					\
+	__asm __volatile ("ctc0 %0, $%1"				\
 			:				/* outputs */	\
 			: "r" (data), "i" (spr));	/* inputs */
 
 
 #define	lbu_macro(data, addr)						\
-	asm volatile ("lbu %0, 0x0(%1)"					\
+	__asm __volatile ("lbu %0, 0x0(%1)"				\
 			: "=r" (data)	/* outputs */			\
 			: "r" (addr));	/* inputs */
 
 #define	lb_macro(data, addr)						\
-	asm volatile ("lb %0, 0x0(%1)"					\
+	__asm __volatile ("lb %0, 0x0(%1)"				\
 			: "=r" (data)	/* outputs */			\
 			: "r" (addr));	/* inputs */
 
 #define	lwl_macro(data, addr)						\
-	asm volatile ("lwl %0, 0x0(%1)"					\
+	__asm __volatile ("lwl %0, 0x0(%1)"				\
 			: "=r" (data)	/* outputs */			\
 			: "r" (addr));	/* inputs */
 
 #define	lwr_macro(data, addr)						\
-	asm volatile ("lwr %0, 0x0(%1)"					\
+	__asm __volatile ("lwr %0, 0x0(%1)"				\
 			: "=r" (data)	/* outputs */			\
 			: "r" (addr));	/* inputs */
 
 #define	ldl_macro(data, addr)						\
-	asm volatile ("ldl %0, 0x0(%1)"					\
+	__asm __volatile ("ldl %0, 0x0(%1)"				\
 			: "=r" (data)	/* outputs */			\
 			: "r" (addr));	/* inputs */
 
 #define	ldr_macro(data, addr)						\
-	asm volatile ("ldr %0, 0x0(%1)"					\
+	__asm __volatile ("ldr %0, 0x0(%1)"				\
 			: "=r" (data)	/* outputs */			\
 			: "r" (addr));	/* inputs */
 
 #define	sb_macro(data, addr)						\
-	asm volatile ("sb %0, 0x0(%1)"					\
+	__asm __volatile ("sb %0, 0x0(%1)"				\
 			:				/* outputs */	\
 			: "r" (data), "r" (addr));	/* inputs */
 
 #define	swl_macro(data, addr)						\
-	asm volatile ("swl %0, 0x0(%1)"					\
+	__asm __volatile ("swl %0, 0x0(%1)"				\
 			: 				/* outputs */	\
 			: "r" (data), "r" (addr));	/* inputs */
 
 #define	swr_macro(data, addr)						\
-	asm volatile ("swr %0, 0x0(%1)"					\
+	__asm __volatile ("swr %0, 0x0(%1)"				\
 			: 				/* outputs */	\
 			: "r" (data), "r" (addr));	/* inputs */
 
 #define	sdl_macro(data, addr)						\
-	asm volatile ("sdl %0, 0x0(%1)"					\
+	__asm __volatile ("sdl %0, 0x0(%1)"				\
 			: 				/* outputs */	\
 			: "r" (data), "r" (addr));	/* inputs */
 
 #define	sdr_macro(data, addr)						\
-	asm volatile ("sdr %0, 0x0(%1)"					\
+	__asm __volatile ("sdr %0, 0x0(%1)"				\
 			:				/* outputs */	\
 			: "r" (data), "r" (addr));	/* inputs */
 
 #define	mfgr_macro(data, gr)						\
-	asm volatile ("move %0, $%1"					\
+	__asm __volatile ("move %0, $%1"				\
 			: "=r" (data)	/* outputs */			\
 			: "i" (gr));	/* inputs */
 
 #define	dmfc0_macro(data, spr)						\
-	asm volatile ("dmfc0 %0, $%1"					\
+	__asm __volatile ("dmfc0 %0, $%1"				\
 			: "=r" (data)	/* outputs */			\
 			: "i" (spr));	/* inputs */
 
 #define	dmtc0_macro(data, spr, sel)					\
-	asm volatile ("dmtc0	%0, $%1, %2"				\
+	__asm __volatile ("dmtc0	%0, $%1, %2"			\
 			:			/* no  outputs */	\
 			: "r" (data), "i" (spr), "i" (sel)); /* inputs */
 

==== //depot/projects/mips2-jnpr/src/sys/mips/mips/machdep.c#4 (text+ko) ====

@@ -174,7 +174,7 @@
 	 */
 	printf("%s", version);
 
-	printf("real memory  = %u (%uK bytes)\n", ptoa(Maxmem),
+	printf("real memory  = %lu (%luK bytes)\n", ptoa(Maxmem),
 	    ptoa(Maxmem) / 1024);
 	realmem = Maxmem;
 	/*
@@ -195,7 +195,7 @@
 
 	vm_ksubmap_init(&kmi);
 
-	printf("avail memory = %u (%uMB)\n", ptoa(cnt.v_free_count),
+	printf("avail memory = %lu (%luMB)\n", ptoa(cnt.v_free_count),
 	    ptoa(cnt.v_free_count) / 1048576);
 
 	/*
@@ -211,11 +211,12 @@
 void
 cpu_reset(void)
 {
-	u_int64_t msg;
 	for (;;)
 		;
 }
 
+#if 0
+/*XXXimp: This seems like a vestage of something in the J! kernel */
 /* Get current clock frequency for the given cpu id. */
 int
 cpu_est_clockrate(int cpu_id, uint64_t *rate)
@@ -223,6 +224,7 @@
 
     return (cpu_clock);
 }
+#endif
 
 /*
  * Shutdown the CPU as much as possible
@@ -281,7 +283,7 @@
 	pcpu_init(pcpup, 0, sizeof(struct pcpu));
 #endif
 
-	proc_linkup(&proc0, &ksegrp0, &thread0);
+	proc_linkup(&proc0, &thread0);
 	PCPU_SET(curthread, &thread0);
 	PCPU_SET(curpcb, thread0.td_pcb);
 }
@@ -342,7 +344,7 @@
 	vm_offset_t AllowMem, memsize;
 	const char *cp;
 	size_t sz;
-	int i, phys_avail_cnt;
+	int phys_avail_cnt;
 
 	/* Determine memory layout */
 	phys_avail_cnt = 0;
@@ -431,7 +433,7 @@
 	sz = round_page(MSGBUF_SIZE);
 	msgbufp = (struct msgbuf *) pmap_steal_memory(sz);
 	msgbufinit(msgbufp, sz);
-	printf("%s: msgbufp[size=%d] = 0x%x\n", __FUNCTION__, sz, msgbufp);
+	printf("%s: msgbufp[size=%d] = 0x%p\n", __FUNCTION__, sz, msgbufp);
 }
 
 
@@ -575,7 +577,7 @@
 #ifdef DDB
 	kdb_init();
 	if ((boothowto & RB_KDB) || (boothowto & RB_GDB))
-		kdb_enter("Boot flags requested debugger");
+		kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger");
 #endif
 
 	pmap_bootstrap();
@@ -646,7 +648,7 @@
 cpu_idle(void)
 {
 	if (mips_cp0_status_read() & SR_INT_ENAB)
-		asm volatile ("wait");
+		__asm __volatile ("wait");
 	else
 		panic("ints disabled in idleproc!");
 }



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