git: aa766e2a03f0 - main - ofw_cpu: fix __riscv preprocessor check
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 10 Jan 2025 19:18:29 UTC
The branch main has been updated by mhorne:
URL: https://cgit.FreeBSD.org/src/commit/?id=aa766e2a03f0eb2fb6272828865c83a807b81cf1
commit aa766e2a03f0eb2fb6272828865c83a807b81cf1
Author: Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2025-01-10 18:46:01 +0000
Commit: Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2025-01-10 18:46:01 +0000
ofw_cpu: fix __riscv preprocessor check
The canonical name is __riscv, not __riscv__. Newer compilers no longer
emit the latter.
This re-enables finding the nominal frequency from the CPU's clock.
I checked, and there are no remaining mistakes like this in the tree.
Reviewed by: jrtc27, imp, jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48122
---
sys/dev/ofw/ofw_cpu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sys/dev/ofw/ofw_cpu.c b/sys/dev/ofw/ofw_cpu.c
index ad0fd670421a..cbca8caee186 100644
--- a/sys/dev/ofw/ofw_cpu.c
+++ b/sys/dev/ofw/ofw_cpu.c
@@ -42,7 +42,7 @@
#include <dev/ofw/ofw_bus_subr.h>
#include <dev/ofw/ofw_cpu.h>
-#if defined(__arm__) || defined(__arm64__) || defined(__riscv__)
+#if defined(__arm__) || defined(__arm64__) || defined(__riscv)
#include <dev/clk/clk.h>
#endif
@@ -206,7 +206,7 @@ ofw_cpu_attach(device_t dev)
phandle_t node;
pcell_t cell;
int rv;
-#if defined(__arm__) || defined(__arm64__) || defined(__riscv__)
+#if defined(__arm__) || defined(__arm64__) || defined(__riscv)
clk_t cpuclk;
uint64_t freq;
#endif
@@ -276,7 +276,7 @@ ofw_cpu_attach(device_t dev)
sc->sc_cpu_pcpu = pcpu_find(device_get_unit(dev));
if (OF_getencprop(node, "clock-frequency", &cell, sizeof(cell)) < 0) {
-#if defined(__arm__) || defined(__arm64__) || defined(__riscv__)
+#if defined(__arm__) || defined(__arm64__) || defined(__riscv)
rv = clk_get_by_ofw_index(dev, 0, 0, &cpuclk);
if (rv == 0) {
rv = clk_get_freq(cpuclk, &freq);