summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1996-04-07 18:30:56 +0000
committerbde <bde@FreeBSD.org>1996-04-07 18:30:56 +0000
commitb6732671c141de708116fc9628450b6c3f1accdb (patch)
tree1b4ccce0da34fc40447b357235fec9d9cb63ae90 /sys
parentb4a0a5c2e577225c475b40df1abbcb05c310a467 (diff)
downloadFreeBSD-src-b6732671c141de708116fc9628450b6c3f1accdb.zip
FreeBSD-src-b6732671c141de708116fc9628450b6c3f1accdb.tar.gz
Changed bdb() to breakpoint() and always enable it.
Made the style more consistent, especially for the new Pentium functions.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/include/cpufunc.h64
-rw-r--r--sys/i386/include/cpufunc.h64
2 files changed, 60 insertions, 68 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index 9e4896d..1f18615 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.47 1996/03/28 20:39:45 wollman Exp $
+ * $Id: cpufunc.h,v 1.48 1996/03/31 04:05:21 bde Exp $
*/
/*
@@ -47,18 +47,11 @@
#ifdef __GNUC__
-#ifdef BDE_DEBUGGER
-extern int bdb_exists;
-
-static __inline int
-bdb(void)
+static __inline void
+breakpoint(void)
{
- if (!bdb_exists)
- return (0);
__asm __volatile("int $3");
- return (1);
}
-#endif /* BDE_DEBUGGER */
static __inline void
disable_intr(void)
@@ -195,7 +188,7 @@ inw(u_int port)
return (data);
}
-static __inline unsigned
+static __inline u_int
loadandclear(u_int *addr)
{
u_int result;
@@ -290,45 +283,48 @@ read_eflags(void)
return (ef);
}
-static __inline void
-write_eflags(u_long ef)
+static __inline quad_t
+rdmsr(u_int msr)
{
- __asm __volatile("pushl %0; popfl" : : "r" (ef));
+ quad_t rv;
+
+ __asm __volatile(".byte 0x0f, 0x32" : "=A" (rv) : "c" (msr));
+ return (rv);
}
-static __inline long long
-rdmsr(unsigned msr)
+static __inline quad_t
+rdpmc(u_int pmc)
{
- long long rv;
- __asm __volatile(".byte 0x0f, 0x32" : "=A" (rv) : "c" (msr));
- return rv;
+ quad_t rv;
+
+ __asm __volatile(".byte 0x0f, 0x33" : "=A" (rv) : "c" (pmc));
+ return (rv);
}
-static __inline long long
+static __inline quad_t
rdtsc(void)
{
- long long rv;
+ quad_t rv;
+
__asm __volatile(".byte 0x0f, 0x31" : "=A" (rv));
- return rv;
+ return (rv);
}
-static __inline long long
-rdpmc(unsigned pmc)
+static __inline void
+write_eflags(u_long ef)
{
- long long rv;
- __asm __volatile(".byte 0x0f, 0x33" : "=A" (rv) : "c" (pmc));
- return rv;
+ __asm __volatile("pushl %0; popfl" : : "r" (ef));
}
static __inline void
-wrmsr(unsigned msr, long long newval)
+wrmsr(u_int msr, quad_t newval)
{
__asm __volatile(".byte 0x0f, 0x30" : : "A" (newval), "c" (msr));
}
#else /* !__GNUC__ */
-int bdb __P((void));
+int breakpoint __P((void));
void disable_intr __P((void));
void enable_intr __P((void));
u_char inb __P((u_int port));
@@ -345,13 +341,13 @@ void outsl __P((u_int port, void *addr, size_t cnt));
void outsw __P((u_int port, void *addr, size_t cnt));
void outw __P((u_int port, u_short data));
void pmap_update __P((void));
-u_long read_eflags __P((void));
u_long rcr2 __P((void));
-void write_eflags __P((u_long ef));
-quad_t rdmsr __P((unsigned msr));
+quad_t rdmsr __P((u_int msr));
+quad_t rdpmc __P((u_int pmc));
quad_t rdtsc __P((void));
-quad_t rdpmc __P((unsigned pmc));
-void wrmsr __P((unsigned msr, quad_t newval));
+u_long read_eflags __P((void));
+void write_eflags __P((u_long ef));
+void wrmsr __P((u_int msr, quad_t newval));
#endif /* __GNUC__ */
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index 9e4896d..1f18615 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.47 1996/03/28 20:39:45 wollman Exp $
+ * $Id: cpufunc.h,v 1.48 1996/03/31 04:05:21 bde Exp $
*/
/*
@@ -47,18 +47,11 @@
#ifdef __GNUC__
-#ifdef BDE_DEBUGGER
-extern int bdb_exists;
-
-static __inline int
-bdb(void)
+static __inline void
+breakpoint(void)
{
- if (!bdb_exists)
- return (0);
__asm __volatile("int $3");
- return (1);
}
-#endif /* BDE_DEBUGGER */
static __inline void
disable_intr(void)
@@ -195,7 +188,7 @@ inw(u_int port)
return (data);
}
-static __inline unsigned
+static __inline u_int
loadandclear(u_int *addr)
{
u_int result;
@@ -290,45 +283,48 @@ read_eflags(void)
return (ef);
}
-static __inline void
-write_eflags(u_long ef)
+static __inline quad_t
+rdmsr(u_int msr)
{
- __asm __volatile("pushl %0; popfl" : : "r" (ef));
+ quad_t rv;
+
+ __asm __volatile(".byte 0x0f, 0x32" : "=A" (rv) : "c" (msr));
+ return (rv);
}
-static __inline long long
-rdmsr(unsigned msr)
+static __inline quad_t
+rdpmc(u_int pmc)
{
- long long rv;
- __asm __volatile(".byte 0x0f, 0x32" : "=A" (rv) : "c" (msr));
- return rv;
+ quad_t rv;
+
+ __asm __volatile(".byte 0x0f, 0x33" : "=A" (rv) : "c" (pmc));
+ return (rv);
}
-static __inline long long
+static __inline quad_t
rdtsc(void)
{
- long long rv;
+ quad_t rv;
+
__asm __volatile(".byte 0x0f, 0x31" : "=A" (rv));
- return rv;
+ return (rv);
}
-static __inline long long
-rdpmc(unsigned pmc)
+static __inline void
+write_eflags(u_long ef)
{
- long long rv;
- __asm __volatile(".byte 0x0f, 0x33" : "=A" (rv) : "c" (pmc));
- return rv;
+ __asm __volatile("pushl %0; popfl" : : "r" (ef));
}
static __inline void
-wrmsr(unsigned msr, long long newval)
+wrmsr(u_int msr, quad_t newval)
{
__asm __volatile(".byte 0x0f, 0x30" : : "A" (newval), "c" (msr));
}
#else /* !__GNUC__ */
-int bdb __P((void));
+int breakpoint __P((void));
void disable_intr __P((void));
void enable_intr __P((void));
u_char inb __P((u_int port));
@@ -345,13 +341,13 @@ void outsl __P((u_int port, void *addr, size_t cnt));
void outsw __P((u_int port, void *addr, size_t cnt));
void outw __P((u_int port, u_short data));
void pmap_update __P((void));
-u_long read_eflags __P((void));
u_long rcr2 __P((void));
-void write_eflags __P((u_long ef));
-quad_t rdmsr __P((unsigned msr));
+quad_t rdmsr __P((u_int msr));
+quad_t rdpmc __P((u_int pmc));
quad_t rdtsc __P((void));
-quad_t rdpmc __P((unsigned pmc));
-void wrmsr __P((unsigned msr, quad_t newval));
+u_long read_eflags __P((void));
+void write_eflags __P((u_long ef));
+void wrmsr __P((u_int msr, quad_t newval));
#endif /* __GNUC__ */
OpenPOWER on IntegriCloud