PERFORCE change 28106 for review
Peter Wemm
peter at FreeBSD.org
Fri Apr 4 17:51:00 PST 2003
http://perforce.freebsd.org/chv.cgi?CH=28106
Change 28106 by peter at peter_daintree on 2003/04/04 17:50:39
64 bit updates. I have to check the register constraints though.
Affected files ...
.. //depot/projects/hammer/sys/x86_64/include/cpufunc.h#5 edit
Differences ...
==== //depot/projects/hammer/sys/x86_64/include/cpufunc.h#5 (text+ko) ====
@@ -52,10 +52,12 @@
#define readb(va) (*(volatile u_int8_t *) (va))
#define readw(va) (*(volatile u_int16_t *) (va))
#define readl(va) (*(volatile u_int32_t *) (va))
+#define readq(va) (*(volatile u_int64_t *) (va))
#define writeb(va, d) (*(volatile u_int8_t *) (va) = (d))
#define writew(va, d) (*(volatile u_int16_t *) (va) = (d))
#define writel(va, d) (*(volatile u_int32_t *) (va) = (d))
+#define writeq(va, d) (*(volatile u_int64_t *) (va) = (d))
#ifdef __GNUC__
@@ -313,9 +315,9 @@
static __inline u_long
read_rflags(void)
{
- u_int ef;
+ u_long ef;
- __asm __volatile("pushfl; XXX; popl %0" : "=r" (ef));
+ __asm __volatile("pushfq; popq %0" : "=r" (ef));
return (ef);
}
@@ -324,7 +326,7 @@
{
u_int64_t rv;
- __asm __volatile("rdmsr XXX" : "=A" (rv) : "c" (msr));
+ __asm __volatile("rdmsr" : "=A" (rv) : "c" (msr));
return (rv);
}
@@ -333,7 +335,7 @@
{
u_int64_t rv;
- __asm __volatile("rdpmc XXX" : "=A" (rv) : "c" (pmc));
+ __asm __volatile("rdpmc" : "=A" (rv) : "c" (pmc));
return (rv);
}
@@ -342,7 +344,7 @@
{
u_int64_t rv;
- __asm __volatile("rdtsc XXX" : "=A" (rv));
+ __asm __volatile("rdtsc" : "=A" (rv));
return (rv);
}
@@ -355,13 +357,13 @@
static __inline void
write_rflags(u_long ef)
{
- __asm __volatile("pushl %0; XXXpopfl" : : "r" (ef));
+ __asm __volatile("pushl %0; popfq" : : "r" (ef));
}
static __inline void
wrmsr(u_int msr, u_int64_t newval)
{
- __asm __volatile("wrmsr XXX" : : "A" (newval), "c" (msr));
+ __asm __volatile("wrmsr" : : "A" (newval), "c" (msr));
}
static __inline void
@@ -441,6 +443,7 @@
__asm __volatile("invlpg %0" : : "m" (*(char *)addr) : "memory");
}
+/* XXX these are replaced with rdmsr/wrmsr */
static __inline u_int
rfs(void)
{
More information about the p4-projects
mailing list