]> git.proxmox.com Git - mirror_qemu.git/commit
bsd-user: various helper routines for sysctl
authorWarner Losh <imp@bsdimp.com>
Mon, 13 Feb 2023 23:02:03 +0000 (16:02 -0700)
committerWarner Losh <imp@bsdimp.com>
Wed, 1 Mar 2023 18:09:18 +0000 (11:09 -0700)
commit0867507857f7e305ec3ade01c6b28c32edf593c1
treee41a04ee5bd03eb2b2f4c12040ce11478c313a01
parentfb96f5dfed8a45f44356899c92d6fcba0e7658a5
bsd-user: various helper routines for sysctl

cap_memory - Caps the memory to just below MAXINT
scale_to_guest_pages - Account for difference in host / guest page size
h2g_long_sat - converts a int64_t to a int32_t, saturating at max / min values
h2g_ulong_sat - converts a uint64_t to a uint32_t, saturating at max value

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
bsd-user/freebsd/os-sys.c