summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1999-01-08 19:51:02 +0000
committerbde <bde@FreeBSD.org>1999-01-08 19:51:02 +0000
commitb823adf4bef0aa373c7a9080c22e20b7bc2fc081 (patch)
treed88f2b08aa2391231a36e2a68a1ded7aa1402924
parente53595f704322430791eaee9e3f65b0c80fc6c0e (diff)
downloadFreeBSD-src-b823adf4bef0aa373c7a9080c22e20b7bc2fc081.zip
FreeBSD-src-b823adf4bef0aa373c7a9080c22e20b7bc2fc081.tar.gz
Fixed some style bugs. Clarified a comment.
-rw-r--r--sys/amd64/include/cpufunc.h25
-rw-r--r--sys/i386/include/cpufunc.h25
2 files changed, 24 insertions, 26 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index c3dd48b..0e4697f 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cpufunc.h,v 1.82 1999/01/08 16:29:57 bde Exp $
+ * $Id: cpufunc.h,v 1.83 1999/01/08 19:17:45 bde Exp $
*/
/*
@@ -220,11 +220,11 @@ invd(void)
__asm __volatile("invd");
}
-#ifdef KERNEL
-#ifdef SMP
+#if defined(SMP) && defined(KERNEL)
/*
- * When using APIC IPI's, the inlining cost is prohibitive since the call
+ * When using APIC IPI's, invlpg() is not simply the invlpg instruction
+ * (this is a bug) and the inlining cost is prohibitive since the call
* executes into the IPI transmission system.
*/
void invlpg __P((u_int addr));
@@ -233,7 +233,7 @@ void invltlb __P((void));
static __inline void
cpu_invlpg(void *addr)
{
- __asm __volatile("invlpg %0"::"m"(*(char *)addr):"memory");
+ __asm __volatile("invlpg %0" : : "m" (*(char *)addr) : "memory");
}
static __inline void
@@ -250,15 +250,15 @@ cpu_invltlb(void)
++tlb_flush_count;
#endif
}
-#else /* !SMP */
+
+#else /* !(SMP && KERNEL) */
static __inline void
invlpg(u_int addr)
{
- __asm __volatile("invlpg %0"::"m"(*(char *)addr):"memory");
+ __asm __volatile("invlpg %0" : : "m" (*(char *)addr) : "memory");
}
-
static __inline void
invltlb(void)
{
@@ -269,13 +269,12 @@ invltlb(void)
*/
__asm __volatile("movl %%cr3, %0; movl %0, %%cr3" : "=r" (temp)
: : "memory");
-#if defined(SWTCH_OPTIM_STATS)
+#ifdef SWTCH_OPTIM_STATS
++tlb_flush_count;
#endif
}
-#endif /* SMP */
-#endif /* KERNEL */
+#endif /* SMP && KERNEL */
static __inline u_short
inw(u_int port)
@@ -397,7 +396,7 @@ rdtsc(void)
}
static __inline void
-setbits(volatile unsigned *addr, u_int bits)
+setbits(volatile u_int *addr, u_int bits)
{
__asm __volatile(
#ifdef SMP
@@ -450,7 +449,7 @@ u_int64_t rdmsr __P((u_int msr));
u_int64_t rdpmc __P((u_int pmc));
u_int64_t rdtsc __P((void));
u_int read_eflags __P((void));
-void setbits __P((volatile unsigned *addr, u_int bits));
+void setbits __P((volatile u_int *addr, u_int bits));
void wbinvd __P((void));
void write_eflags __P((u_int ef));
void wrmsr __P((u_int msr, u_int64_t newval));
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index c3dd48b..0e4697f 100644
--- a/sys/i386/include/cpufunc.h
+++ b/sys/i386/include/cpufunc.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cpufunc.h,v 1.82 1999/01/08 16:29:57 bde Exp $
+ * $Id: cpufunc.h,v 1.83 1999/01/08 19:17:45 bde Exp $
*/
/*
@@ -220,11 +220,11 @@ invd(void)
__asm __volatile("invd");
}
-#ifdef KERNEL
-#ifdef SMP
+#if defined(SMP) && defined(KERNEL)
/*
- * When using APIC IPI's, the inlining cost is prohibitive since the call
+ * When using APIC IPI's, invlpg() is not simply the invlpg instruction
+ * (this is a bug) and the inlining cost is prohibitive since the call
* executes into the IPI transmission system.
*/
void invlpg __P((u_int addr));
@@ -233,7 +233,7 @@ void invltlb __P((void));
static __inline void
cpu_invlpg(void *addr)
{
- __asm __volatile("invlpg %0"::"m"(*(char *)addr):"memory");
+ __asm __volatile("invlpg %0" : : "m" (*(char *)addr) : "memory");
}
static __inline void
@@ -250,15 +250,15 @@ cpu_invltlb(void)
++tlb_flush_count;
#endif
}
-#else /* !SMP */
+
+#else /* !(SMP && KERNEL) */
static __inline void
invlpg(u_int addr)
{
- __asm __volatile("invlpg %0"::"m"(*(char *)addr):"memory");
+ __asm __volatile("invlpg %0" : : "m" (*(char *)addr) : "memory");
}
-
static __inline void
invltlb(void)
{
@@ -269,13 +269,12 @@ invltlb(void)
*/
__asm __volatile("movl %%cr3, %0; movl %0, %%cr3" : "=r" (temp)
: : "memory");
-#if defined(SWTCH_OPTIM_STATS)
+#ifdef SWTCH_OPTIM_STATS
++tlb_flush_count;
#endif
}
-#endif /* SMP */
-#endif /* KERNEL */
+#endif /* SMP && KERNEL */
static __inline u_short
inw(u_int port)
@@ -397,7 +396,7 @@ rdtsc(void)
}
static __inline void
-setbits(volatile unsigned *addr, u_int bits)
+setbits(volatile u_int *addr, u_int bits)
{
__asm __volatile(
#ifdef SMP
@@ -450,7 +449,7 @@ u_int64_t rdmsr __P((u_int msr));
u_int64_t rdpmc __P((u_int pmc));
u_int64_t rdtsc __P((void));
u_int read_eflags __P((void));
-void setbits __P((volatile unsigned *addr, u_int bits));
+void setbits __P((volatile u_int *addr, u_int bits));
void wbinvd __P((void));
void write_eflags __P((u_int ef));
void wrmsr __P((u_int msr, u_int64_t newval));
OpenPOWER on IntegriCloud