]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Libvtv: Add loongarch support.
authorLulu Cheng <chenglulu@loongson.cn>
Tue, 27 Sep 2022 07:28:43 +0000 (15:28 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Mon, 31 Oct 2022 09:35:02 +0000 (17:35 +0800)
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.

include/vtv-change-permission.h
libvtv/configure.tgt

index 70bdad92bcadf708d83324b0bc36f548966efcf7..e7b9294a081b046c49eb2a0af21f042cc2b782b5 100644 (file)
@@ -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
index aa2a3f675b80a1b5d85827aea11f7747ed5edaa3..6cdd1e97ab1123ee4ae1dbc632532fce3fcf94c9 100644 (file)
@@ -50,6 +50,9 @@ case "${target}" in
        ;;
   x86_64-*-darwin[1]* | i?86-*-darwin[1]*)
        ;;
+  loongarch*-*-linux*)
+       VTV_SUPPORTED=yes
+       ;;
   *)
        ;;
 esac