|
| 1 | +diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c |
| 2 | +index 6750da5..2e16f0f 100644 |
| 3 | +--- a/accel/tcg/translate-all.c |
| 4 | ++++ b/accel/tcg/translate-all.c |
| 5 | +@@ -4607,6 +4607,7 @@ int shared_private_interpret(siginfo_t *info, ucontext_t *uc) |
| 6 | + *(int64_t *)(mem_addr + 24) = UC_GET_LASX(&extctx, fd, 3, int64_t); |
| 7 | + goto end; |
| 8 | + #endif |
| 9 | ++#ifndef CONFIG_LOONGARCH_NEW_WORLD |
| 10 | + case 0xc0: |
| 11 | + if (inst & (1<<21)) { |
| 12 | + /*VLDREPL.W*/ |
| 13 | +@@ -4634,6 +4635,7 @@ int shared_private_interpret(siginfo_t *info, ucontext_t *uc) |
| 14 | + *((int8_t *)&UC_FREG(uc)[fd].__val32[i] + 3) = *(int8_t *)mem_addr; |
| 15 | + } |
| 16 | + goto end; |
| 17 | ++#endif |
| 18 | + case 0xb8: /* LDL.W */ |
| 19 | + case 0xb9: /* LDR.W */ |
| 20 | + case 0xba: /* LDL.D */ |
| 21 | +diff --git a/include/loongarch-extcontext.h b/include/loongarch-extcontext.h |
| 22 | +index 461345e..3a6ae91 100644 |
| 23 | +--- a/include/loongarch-extcontext.h |
| 24 | ++++ b/include/loongarch-extcontext.h |
| 25 | +@@ -5,6 +5,8 @@ |
| 26 | + */ |
| 27 | + #ifndef LOONGARCH_EXTCONTEXT_H |
| 28 | + #define LOONGARCH_EXTCONTEXT_H |
| 29 | ++#include "config-host.h" |
| 30 | ++ |
| 31 | + #if defined(CONFIG_LOONGARCH_NEW_WORLD) && defined(__loongarch__) |
| 32 | + #include "qemu/osdep.h" |
| 33 | + #include "asm/sigcontext.h" |
| 34 | +diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h |
| 35 | +index db088ce..8612c75 100644 |
| 36 | +--- a/include/qemu/osdep.h |
| 37 | ++++ b/include/qemu/osdep.h |
| 38 | +@@ -27,15 +27,22 @@ |
| 39 | + #ifndef QEMU_OSDEP_H |
| 40 | + #define QEMU_OSDEP_H |
| 41 | + |
| 42 | ++#include "config-host.h" |
| 43 | ++ |
| 44 | + /* arch dependent signal context retriev macros */ |
| 45 | + #if defined(__mips__) |
| 46 | + #define UC_GR(uc) ((uc)->uc_mcontext.gregs) |
| 47 | + #define UC_PC(uc) ((uc)->uc_mcontext.pc) |
| 48 | + #elif defined(__loongarch__) |
| 49 | ++#ifdef CONFIG_LOONGARCH_NEW_WORLD |
| 50 | + #define UC_GR(uc) ((uc)->uc_mcontext.__gregs) |
| 51 | + #define UC_PC(uc) ((uc)->uc_mcontext.__pc) |
| 52 | +-#define UC_FREG(uc) ((uc)->uc_mcontext.__fpregs) |
| 53 | +-#define UC_FCSR(uc) ((uc)->uc_mcontext.__fcsr) |
| 54 | ++#else |
| 55 | ++ #define UC_GR(uc) ((uc)->uc_mcontext.sc_regs) |
| 56 | ++ #define UC_PC(uc) ((uc)->uc_mcontext.sc_pc) |
| 57 | ++ #define UC_FREG(uc) ((uc)->uc_mcontext.__fpregs) |
| 58 | ++ #define UC_FCSR(uc) ((uc)->uc_mcontext.__fcsr) |
| 59 | ++#endif |
| 60 | + #else |
| 61 | + #error "unknown arch" |
| 62 | + #endif |
| 63 | +diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h |
| 64 | +index 76ae0b5..a46f6f6 100644 |
| 65 | +--- a/linux-user/syscall_defs.h |
| 66 | ++++ b/linux-user/syscall_defs.h |
| 67 | +@@ -1527,8 +1527,15 @@ struct target_winsize { |
| 68 | + #include "termbits.h" |
| 69 | + |
| 70 | + #define HUGETLB_FLAG_ENCODE_SHIFT 26 |
| 71 | ++ |
| 72 | ++#ifndef MAP_HUGE_2MB |
| 73 | + #define MAP_HUGE_2MB (21 << HUGETLB_FLAG_ENCODE_SHIFT) |
| 74 | ++#endif |
| 75 | ++ |
| 76 | ++#ifndef MAP_HUGE_1GB |
| 77 | + #define MAP_HUGE_1GB (30 << HUGETLB_FLAG_ENCODE_SHIFT) |
| 78 | ++#endif |
| 79 | ++ |
| 80 | + #define LEGACY_MAP_MASK (TARGET_MAP_SHARED \ |
| 81 | + | TARGET_MAP_PRIVATE \ |
| 82 | + | TARGET_MAP_FIXED \ |
| 83 | +diff --git a/meson.build b/meson.build |
| 84 | +index a30002f..074aa3a 100644 |
| 85 | +--- a/meson.build |
| 86 | ++++ b/meson.build |
| 87 | +@@ -17,9 +17,9 @@ cc = meson.get_compiler('c') |
| 88 | + config_host = keyval.load(meson.current_build_dir() / 'config-host.mak') |
| 89 | + enable_static = 'CONFIG_STATIC' in config_host |
| 90 | + |
| 91 | +-latx_version_h = vcs_tag(command : ['git', 'describe'], |
| 92 | ++latx_version_h = vcs_tag(command : ['cat', 'VERSION'], |
| 93 | + fallback : 'unknown', |
| 94 | +- input : 'linux-user/latx-version.h.in', |
| 95 | ++ input : 'linux-user/latx-version.h.in', |
| 96 | + output :'latx-version.h') |
| 97 | + # Allow both shared and static libraries unless --enable-static |
| 98 | + static_kwargs = enable_static ? {'static': true} : {} |
| 99 | +@@ -206,7 +206,10 @@ config_host_data.set('CONFIG_MALLOC_TRIM', has_malloc_trim) |
| 100 | + lsb_release = find_program('lsb_release', required: false) |
| 101 | + if lsb_release.found() |
| 102 | + lsb_release_output = run_command('lsb_release', '-si').stdout().strip() |
| 103 | +- if lsb_release_output == 'Loongnix' |
| 104 | ++ if lsb_release_output == 'Debian' |
| 105 | ++ config_host_data.set('HAVE_DRM_H', cc.has_header('libdrm/drm.h')) |
| 106 | ++ config_host_data.set('IS_DEBIAN', 'true') |
| 107 | ++ elif lsb_release_output == 'Loongnix' |
| 108 | + config_host_data.set('HAVE_DRM_H', cc.has_header('libdrm/drm.h')) |
| 109 | + config_host_data.set('IS_LOONGNIX', 'true') |
| 110 | + elif lsb_release_output == 'Arch' |
| 111 | +diff --git a/target/i386/latx/context/myalign.c b/target/i386/latx/context/myalign.c |
| 112 | +index 62698d0..3695113 100644 |
| 113 | +--- a/target/i386/latx/context/myalign.c |
| 114 | ++++ b/target/i386/latx/context/myalign.c |
| 115 | +@@ -1,3 +1,4 @@ |
| 116 | ++#include "config-host.h" |
| 117 | + #include "lsenv.h" |
| 118 | + #include "myalign.h" |
| 119 | + #include "elfloader.h" |
| 120 | +diff --git a/target/i386/latx/context/wrappedlibc.c b/target/i386/latx/context/wrappedlibc.c |
| 121 | +index 3cfe2ac..fa5b70c 100644 |
| 122 | +--- a/target/i386/latx/context/wrappedlibc.c |
| 123 | ++++ b/target/i386/latx/context/wrappedlibc.c |
| 124 | +@@ -1,3 +1,4 @@ |
| 125 | ++#include "config-host.h" |
| 126 | + #define _LARGEFILE_SOURCE 1 |
| 127 | + #define _FILE_OFFSET_BITS 64 |
| 128 | + #include <stdlib.h> |
| 129 | +diff --git a/target/i386/latx/include/generated/wrappedlibctypes.h b/target/i386/latx/include/generated/wrappedlibctypes.h |
| 130 | +index 88c1867..92258aa 100644 |
| 131 | +--- a/target/i386/latx/include/generated/wrappedlibctypes.h |
| 132 | ++++ b/target/i386/latx/include/generated/wrappedlibctypes.h |
| 133 | +@@ -4,6 +4,8 @@ |
| 134 | + #ifndef __wrappedlibcTYPES_H_ |
| 135 | + #define __wrappedlibcTYPES_H_ |
| 136 | + |
| 137 | ++#include "config-host.h" |
| 138 | ++ |
| 139 | + #ifndef LIBNAME |
| 140 | + #error You should only #include this file inside a wrapped*.c file |
| 141 | + #endif |
| 142 | +diff --git a/target/i386/latx/include/library_list.h b/target/i386/latx/include/library_list.h |
| 143 | +index f14793f..01638dd 100755 |
| 144 | +--- a/target/i386/latx/include/library_list.h |
| 145 | ++++ b/target/i386/latx/include/library_list.h |
| 146 | +@@ -2,6 +2,8 @@ |
| 147 | + #error Nope |
| 148 | + #endif |
| 149 | + |
| 150 | ++#include "config-host.h" |
| 151 | ++ |
| 152 | + GO("libEGL.so.1", libegl) |
| 153 | + #ifndef CONFIG_LOONGARCH_NEW_WORLD |
| 154 | + GO("libdl.so.2", libdl) |
| 155 | +diff --git a/target/i386/latx/include/wrappedlibc_private.h b/target/i386/latx/include/wrappedlibc_private.h |
| 156 | +index 2b63178..f836a95 100644 |
| 157 | +--- a/target/i386/latx/include/wrappedlibc_private.h |
| 158 | ++++ b/target/i386/latx/include/wrappedlibc_private.h |
| 159 | +@@ -1,3 +1,4 @@ |
| 160 | ++#include "config-host.h" |
| 161 | + #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA) && defined(GOS)) |
| 162 | + #error Meh... |
| 163 | + #endif |
| 164 | +diff --git a/target/i386/latx/latx-config.c b/target/i386/latx/latx-config.c |
| 165 | +index 5a6d98f..aadcc68 100644 |
| 166 | +--- a/target/i386/latx/latx-config.c |
| 167 | ++++ b/target/i386/latx/latx-config.c |
| 168 | +@@ -1,3 +1,4 @@ |
| 169 | ++#include "config-host.h" |
| 170 | + #include "common.h" |
| 171 | + #include "diStorm/distorm.h" |
| 172 | + #include "ir1.h" |
0 commit comments