[PATCH v3 3/3] amd64: Port to RTEMS

Jan Sommer jan.sommer at dlr.de
Tue Feb 11 12:06:52 UTC 2020


---
 freebsd/sys/amd64/include/machine/cpufunc.h | 6 ++++++
 rtemsbsd/amd64/include/machine/clock.h      | 2 ++
 2 files changed, 8 insertions(+)
 create mode 100644 rtemsbsd/amd64/include/machine/clock.h

diff --git a/freebsd/sys/amd64/include/machine/cpufunc.h b/freebsd/sys/amd64/include/machine/cpufunc.h
index cf514cb6..d96f9702 100644
--- a/freebsd/sys/amd64/include/machine/cpufunc.h
+++ b/freebsd/sys/amd64/include/machine/cpufunc.h
@@ -164,6 +164,7 @@ enable_intr(void)
 
 #define	HAVE_INLINE_FFSL
 
+#ifndef __rtems__
 static __inline __pure2 int
 ffsl(long mask)
 {
@@ -201,6 +202,7 @@ flsll(long long mask)
 {
 	return (flsl((long)mask));
 }
+#endif /* __rtems__ */
 
 #endif /* _KERNEL */
 
@@ -357,6 +359,7 @@ read_rflags(void)
 	return (rf);
 }
 
+#ifndef __rtems__
 static __inline uint64_t
 rdmsr(u_int msr)
 {
@@ -365,6 +368,7 @@ rdmsr(u_int msr)
 	__asm __volatile("rdmsr" : "=a" (low), "=d" (high) : "c" (msr));
 	return (low | ((uint64_t)high << 32));
 }
+#endif /* __rtems__ */
 
 static __inline uint32_t
 rdmsr32(u_int msr)
@@ -423,6 +427,7 @@ write_rflags(u_long rf)
 	__asm __volatile("pushq %0;  popfq" : : "r" (rf));
 }
 
+#ifndef __rtems__
 static __inline void
 wrmsr(u_int msr, uint64_t newval)
 {
@@ -432,6 +437,7 @@ wrmsr(u_int msr, uint64_t newval)
 	high = newval >> 32;
 	__asm __volatile("wrmsr" : : "a" (low), "d" (high), "c" (msr));
 }
+#endif /* __rtems__ */
 
 static __inline void
 load_cr0(u_long data)
diff --git a/rtemsbsd/amd64/include/machine/clock.h b/rtemsbsd/amd64/include/machine/clock.h
new file mode 100644
index 00000000..415e2b55
--- /dev/null
+++ b/rtemsbsd/amd64/include/machine/clock.h
@@ -0,0 +1,2 @@
+extern int tsc_is_invariant;
+extern uint64_t tsc_freq;
-- 
2.17.1



More information about the devel mailing list