aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLulu Cheng <chenglulu@loongson.cn>2022-09-27 15:28:43 +0800
committerLulu Cheng <chenglulu@loongson.cn>2022-10-31 17:35:02 +0800
commit27b9e1158b3e819ba77367b6b0d6161186b0ca7f (patch)
tree0ad03dc4fa91023fa41a3f5249a28dde7cfdc0e1
parent259a11555c90783e53c046c310080407ee54a31e (diff)
downloadgcc-27b9e1158b3e819ba77367b6b0d6161186b0ca7f.zip
gcc-27b9e1158b3e819ba77367b6b0d6161186b0ca7f.tar.gz
gcc-27b9e1158b3e819ba77367b6b0d6161186b0ca7f.tar.bz2
Libvtv: Add loongarch support.
The loongarch64 specification permits page sizes of 4KiB, 16KiB and 64KiB, but only 16KiB pages are supported for now. Co-Authored-By: qijingwen <qijingwen@loongson.cn> include/ChangeLog: * vtv-change-permission.h (defined): Determines whether the macro __loongarch_lp64 is defined (VTV_PAGE_SIZE): Set VTV_PAGE_SIZE to 16KiB for loongarch64. libvtv/ChangeLog: * configure.tgt: Add loongarch support.
-rw-r--r--include/vtv-change-permission.h4
-rw-r--r--libvtv/configure.tgt3
2 files changed, 7 insertions, 0 deletions
diff --git a/include/vtv-change-permission.h b/include/vtv-change-permission.h
index 70bdad9..e7b9294 100644
--- a/include/vtv-change-permission.h
+++ b/include/vtv-change-permission.h
@@ -48,6 +48,10 @@ extern void __VLTChangePermission (int);
#else
#if defined(__sun__) && defined(__svr4__) && defined(__sparc__)
#define VTV_PAGE_SIZE 8192
+#elif defined(__loongarch_lp64)
+/* The page size is configurable by the kernel to be 4, 16 or 64 KiB.
+ For now, only the default page size of 16KiB is supported. */
+#define VTV_PAGE_SIZE 16384
#else
#define VTV_PAGE_SIZE 4096
#endif
diff --git a/libvtv/configure.tgt b/libvtv/configure.tgt
index aa2a3f6..6cdd1e9 100644
--- a/libvtv/configure.tgt
+++ b/libvtv/configure.tgt
@@ -50,6 +50,9 @@ case "${target}" in
;;
x86_64-*-darwin[1]* | i?86-*-darwin[1]*)
;;
+ loongarch*-*-linux*)
+ VTV_SUPPORTED=yes
+ ;;
*)
;;
esac