pagesize.c 499 B

123456789101112131415161718
  1. /*
  2. * pagesize.c - query the host about its page size
  3. *
  4. * Copyright (C) 2017, Emilio G. Cota <cota@braap.org>
  5. * License: GNU GPL, version 2 or later.
  6. * See the COPYING file in the top-level directory.
  7. */
  8. #include "qemu/osdep.h"
  9. uintptr_t qemu_real_host_page_size;
  10. intptr_t qemu_real_host_page_mask;
  11. static void __attribute__((constructor)) init_real_host_page_size(void)
  12. {
  13. qemu_real_host_page_size = getpagesize();
  14. qemu_real_host_page_mask = -(intptr_t)qemu_real_host_page_size;
  15. }