Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167271630
D51820.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D51820.diff
View Options
diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c
--- a/sys/arm/arm/generic_timer.c
+++ b/sys/arm/arm/generic_timer.c
@@ -231,6 +231,25 @@
return (val);
}
+#ifdef __aarch64__
+/*
+ * Read the self-syncronized counter. These cannot be read speculatively so
+ * don't need an isb before them.
+ */
+static uint64_t
+get_cntxctss(bool physical)
+{
+ uint64_t val;
+
+ if (physical)
+ val = READ_SPECIALREG(CNTPCTSS_EL0_REG);
+ else
+ val = READ_SPECIALREG(CNTVCTSS_EL0_REG);
+
+ return (val);
+}
+#endif
+
static int
set_ctrl(uint32_t val, bool physical)
{
@@ -631,6 +650,7 @@
pcell_t clock;
#endif
#ifdef __aarch64__
+ uint64_t id_aa64mmfr0_el1;
int user_phys;
#endif
int error;
@@ -641,6 +661,11 @@
return (ENXIO);
sc->get_cntxct = &get_cntxct;
+#ifdef __aarch64__
+ if (get_kernel_reg(ID_AA64MMFR0_EL1, &id_aa64mmfr0_el1) &&
+ ID_AA64MMFR0_ECV_VAL(id_aa64mmfr0_el1) >= ID_AA64MMFR0_ECV_IMPL)
+ sc->get_cntxct = &get_cntxctss;
+#endif
#ifdef FDT
/* Get the base clock frequency */
node = ofw_bus_get_node(dev);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Aug 21, 1:37 PM (3 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37034396
Default Alt Text
D51820.diff (1 KB)
Attached To
Mode
D51820: arm: Use the Self-Synchronized counter registers
Attached
Detach File
Event Timeline
Log In to Comment