aboutsummaryrefslogtreecommitdiff
path: root/util/pagesize.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-10-11 09:56:16 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-10-11 09:56:16 +0100
commite74c0cfa57323e5806894c65086f411112168820 (patch)
treea3bef61f13efe7f63074b68abe09449f9b71db46 /util/pagesize.c
parent567d0a19c7998fa366598b83d5a6e5f0759d3ea9 (diff)
parent8df8d529ed958de4e23dcbf38bd34eff1a4716f2 (diff)
Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20171010' into staging
Queued TCG patches # gpg: Signature made Tue 10 Oct 2017 20:23:12 BST # gpg: using RSA key 0x64DF38E8AF7E215F # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F * remotes/rth/tags/pull-tcg-20171010: tcg/mips: delete commented out extern keyword. tcg: define TCG_HIGHWATER util: move qemu_real_host_page_size/mask to osdep.h tcg: take .helpers out of TCGContext tci: move tci_regs to tcg_qemu_tb_exec's stack exec-all: extract tb->tc_* into a separate struct tc_tb translate-all: define and use DEBUG_TB_CHECK_GATE translate-all: define and use DEBUG_TB_INVALIDATE_GATE exec-all: introduce TB_PAGE_ADDR_FMT translate-all: define and use DEBUG_TB_FLUSH_GATE exec-all: bring tb->invalid into tb->cflags tcg: consolidate TB lookups in tb_lookup__cpu_state tcg: remove addr argument from lookup_tb_ptr tcg/mips: constify tcg_target_callee_save_regs tcg/i386: constify tcg_target_callee_save_regs cpu-exec: rename have_tb_lock to acquired_tb_lock in tb_find translate-all: make have_tb_lock static exec-all: fix typos in TranslationBlock's documentation tcg: fix corruption of code_time profiling counter upon tb_flush cputlb: bring back tlb_flush_count under !TLB_DEBUG Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util/pagesize.c')
-rw-r--r--util/pagesize.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/util/pagesize.c b/util/pagesize.c
new file mode 100644
index 0000000000..998632cf6e
--- /dev/null
+++ b/util/pagesize.c
@@ -0,0 +1,18 @@
+/*
+ * pagesize.c - query the host about its page size
+ *
+ * Copyright (C) 2017, Emilio G. Cota <cota@braap.org>
+ * License: GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+
+uintptr_t qemu_real_host_page_size;
+intptr_t qemu_real_host_page_mask;
+
+static void __attribute__((constructor)) init_real_host_page_size(void)
+{
+ qemu_real_host_page_size = getpagesize();
+ qemu_real_host_page_mask = -(intptr_t)qemu_real_host_page_size;
+}