aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/pcpu.h
diff options
context:
space:
mode:
authorRuslan Bukin <br@FreeBSD.org>2018-09-12 08:05:33 +0000
committerRuslan Bukin <br@FreeBSD.org>2018-09-12 08:05:33 +0000
commit86c5937532768ce2936c70b1be159af4c11d35ef (patch)
tree26c0eecdb76facddb47f1306d0c110d6428a3a68 /sys/sys/pcpu.h
parentc9e562b188682eb9be39a8124893aa172b57d3ca (diff)
downloadsrc-86c5937532768ce2936c70b1be159af4c11d35ef.tar.gz
src-86c5937532768ce2936c70b1be159af4c11d35ef.zip
Don't mark module data as static on RISC-V.
Similar to arm64, riscv compiler uses PC-relative loads/stores, and with static data compiler does not emit relocations. In result, kernel module linker has nothing to fix and data accessed from the wrong location. Approved by: re (gjb) Sponsored by: DARPA, AFRL
Notes
Notes: svn path=/head/; revision=338608
Diffstat (limited to 'sys/sys/pcpu.h')
-rw-r--r--sys/sys/pcpu.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h
index d2084b77b3df..19bc4a8b9076 100644
--- a/sys/sys/pcpu.h
+++ b/sys/sys/pcpu.h
@@ -84,7 +84,7 @@ extern uintptr_t dpcpu_off[];
/* struct _hack is to stop this from being used with the static keyword. */
#define DPCPU_DEFINE(t, n) \
struct _hack; t DPCPU_NAME(n) __section(DPCPU_SETNAME) __used
-#if defined(KLD_MODULE) && defined(__aarch64__)
+#if defined(KLD_MODULE) && (defined(__aarch64__) || defined(__riscv))
/*
* On some architectures the compiler will use PC-relative load to
* find the address of DPCPU data with the static keyword. We then