summary refs log tree commit diff stats
path: root/include/system/system.h
diff options
context:
space:
mode:
authorDaniil Tatianin <d-tatianin@yandex-team.ru>2025-02-12 17:39:19 +0300
committerPeter Xu <peterx@redhat.com>2025-02-12 11:36:13 -0500
commitcd2e472e54a49c13b0a728cdda7c10c50421e23d (patch)
tree759c1143fce120ce6c3109b5107d364c9c86bb7f /include/system/system.h
parentcb74f2b8a65cde2eadbcb5574327ac3f49983d8a (diff)
downloadfocaccia-qemu-cd2e472e54a49c13b0a728cdda7c10c50421e23d.tar.gz
focaccia-qemu-cd2e472e54a49c13b0a728cdda7c10c50421e23d.zip
system: introduce a new MlockState enum
Replace the boolean value enable_mlock with an enum and add a helper to
decide whether we should be calling os_mlock.

This is a stepping stone towards introducing a new mlock mode, which
will be the third possible state of this enum.

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
Link: https://lore.kernel.org/r/20250212143920.1269754-4-d-tatianin@yandex-team.ru
Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'include/system/system.h')
-rw-r--r--include/system/system.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/system/system.h b/include/system/system.h
index 0cbb43ec30..dc7628357a 100644
--- a/include/system/system.h
+++ b/include/system/system.h
@@ -44,10 +44,18 @@ extern int display_opengl;
 extern const char *keyboard_layout;
 extern int old_param;
 extern uint8_t *boot_splash_filedata;
-extern bool enable_mlock;
 extern bool enable_cpu_pm;
 extern QEMUClockType rtc_clock;
 
+typedef enum {
+    MLOCK_OFF = 0,
+    MLOCK_ON,
+} MlockState;
+
+bool should_mlock(MlockState);
+
+extern MlockState mlock_state;
+
 #define MAX_OPTION_ROMS 16
 typedef struct QEMUOptionRom {
     const char *name;