svn commit: r253748 - in head/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include

Andriy Gapon avg at FreeBSD.org
Sun Jul 28 18:32:29 UTC 2013


Author: avg
Date: Sun Jul 28 18:32:27 2013
New Revision: 253748
URL: http://svnweb.freebsd.org/changeset/base/253748

Log:
  put contents of cpu.h under _KERNEL
  
  no userland-serviceable parts inside
  
  MFC after:	20 days

Modified:
  head/sys/amd64/include/cpu.h
  head/sys/arm/include/cpu.h
  head/sys/i386/include/cpu.h
  head/sys/ia64/include/cpu.h
  head/sys/mips/include/cpu.h
  head/sys/powerpc/include/cpu.h
  head/sys/sparc64/include/cpu.h

Modified: head/sys/amd64/include/cpu.h
==============================================================================
--- head/sys/amd64/include/cpu.h	Sun Jul 28 17:54:42 2013	(r253747)
+++ head/sys/amd64/include/cpu.h	Sun Jul 28 18:32:27 2013	(r253748)
@@ -36,6 +36,8 @@
 #ifndef _MACHINE_CPU_H_
 #define	_MACHINE_CPU_H_
 
+#ifdef _KERNEL
+
 /*
  * Definitions unique to i386 cpu support.
  */
@@ -53,7 +55,6 @@
 	(ISPL((framep)->tf_cs) == SEL_UPL)
 #define	TRAPF_PC(framep)	((framep)->tf_rip)
 
-#ifdef _KERNEL
 extern char	btext[];
 extern char	etext[];
 

Modified: head/sys/arm/include/cpu.h
==============================================================================
--- head/sys/arm/include/cpu.h	Sun Jul 28 17:54:42 2013	(r253747)
+++ head/sys/arm/include/cpu.h	Sun Jul 28 18:32:27 2013	(r253748)
@@ -6,10 +6,11 @@
 
 #include <machine/armreg.h>
 
+#ifdef _KERNEL
+
 void	cpu_halt(void);
 void	swi_vm(void *);
 
-#ifdef _KERNEL
 static __inline uint64_t
 get_cyclecount(void)
 {
@@ -19,7 +20,6 @@ get_cyclecount(void)
 	return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
 			
 }
-#endif
 
 #define TRAPF_USERMODE(frame)	((frame->tf_spsr & PSR_MODE) == PSR_USR32_MODE)
 
@@ -50,4 +50,5 @@ void	*initarm(struct arm_boot_params *);
 extern char btext[];
 extern char etext[];
 int badaddr_read(void *, size_t, void *);
+#endif
 #endif /* !MACHINE_CPU_H */

Modified: head/sys/i386/include/cpu.h
==============================================================================
--- head/sys/i386/include/cpu.h	Sun Jul 28 17:54:42 2013	(r253747)
+++ head/sys/i386/include/cpu.h	Sun Jul 28 18:32:27 2013	(r253748)
@@ -43,6 +43,8 @@
 #include <machine/frame.h>
 #include <machine/segments.h>
 
+#ifdef _KERNEL
+
 #define	cpu_exec(p)	/* nothing */
 #define	cpu_swapin(p)	/* nothing */
 #define	cpu_getstack(td)		((td)->td_frame->tf_esp)
@@ -53,7 +55,6 @@
 	((ISPL((framep)->tf_cs) == SEL_UPL) || ((framep)->tf_eflags & PSL_VM))
 #define	TRAPF_PC(framep)	((framep)->tf_eip)
 
-#ifdef _KERNEL
 extern char	btext[];
 extern char	etext[];
 

Modified: head/sys/ia64/include/cpu.h
==============================================================================
--- head/sys/ia64/include/cpu.h	Sun Jul 28 17:54:42 2013	(r253747)
+++ head/sys/ia64/include/cpu.h	Sun Jul 28 18:32:27 2013	(r253748)
@@ -44,12 +44,12 @@
 
 #include <machine/frame.h>
 
+#ifdef _KERNEL
+
 #define	TRAPF_PC(tf)		((tf)->tf_special.iip)
 #define	TRAPF_CPL(tf)		((tf)->tf_special.psr & IA64_PSR_CPL)
 #define	TRAPF_USERMODE(tf)	(TRAPF_CPL(tf) != IA64_PSR_CPL_KERN)
 
-#ifdef _KERNEL
-
 #ifdef GPROF
 extern char btext[];
 extern char etext[];

Modified: head/sys/mips/include/cpu.h
==============================================================================
--- head/sys/mips/include/cpu.h	Sun Jul 28 17:54:42 2013	(r253747)
+++ head/sys/mips/include/cpu.h	Sun Jul 28 18:32:27 2013	(r253748)
@@ -49,6 +49,8 @@
 
 #include <machine/endian.h>
 
+#if defined(_KERNEL)
+
 /* BEGIN: these are going away */
 
 #define	soft_int_mask(softintr)	(1 << ((softintr) + 8))
@@ -74,9 +76,7 @@
  * A machine-independent interface to the CPU's counter.
  */
 #define get_cyclecount()	mips_rd_count()
-#endif				/* !_LOCORE */
 
-#if defined(_KERNEL) && !defined(_LOCORE)
 
 extern char btext[];
 extern char etext[];
@@ -85,5 +85,6 @@ void swi_vm(void *);
 void cpu_halt(void);
 void cpu_reset(void);
 
+#endif				/* !_LOCORE */
 #endif				/* _KERNEL */
 #endif				/* !_MACHINE_CPU_H_ */

Modified: head/sys/powerpc/include/cpu.h
==============================================================================
--- head/sys/powerpc/include/cpu.h	Sun Jul 28 17:54:42 2013	(r253747)
+++ head/sys/powerpc/include/cpu.h	Sun Jul 28 18:32:27 2013	(r253748)
@@ -39,6 +39,8 @@
 #include <machine/pcb.h>
 #include <machine/psl.h>
 
+#ifdef _KERNEL
+
 /*
  * CPU Feature Attributes
  *
@@ -98,4 +100,5 @@ void	cpu_reset(void);
 void	fork_trampoline(void);
 void	swi_vm(void *);
 
+#endif	/* _KERNEL */
 #endif	/* _MACHINE_CPU_H_ */

Modified: head/sys/sparc64/include/cpu.h
==============================================================================
--- head/sys/sparc64/include/cpu.h	Sun Jul 28 17:54:42 2013	(r253747)
+++ head/sys/sparc64/include/cpu.h	Sun Jul 28 18:32:27 2013	(r253748)
@@ -40,6 +40,8 @@
 #include <machine/frame.h>
 #include <machine/tstate.h>
 
+#ifdef _KERNEL
+
 #define	TRAPF_PC(tfp)		((tfp)->tf_tpc)
 #define	TRAPF_USERMODE(tfp)	(((tfp)->tf_tstate & TSTATE_PRIV) == 0)
 
@@ -47,8 +49,6 @@
 #define	cpu_setstack(td, sp)	((td)->td_frame->tf_sp = (sp))
 #define	cpu_spinwait()		/* nothing */
 
-#ifdef _KERNEL
-
 extern	char btext[];
 extern	char etext[];
 


More information about the svn-src-all mailing list