/* Generated by ./src/xlat/gen.sh from ./src/xlat/kvm_mem_flags.in; do not edit. */

#include "gcc_compat.h"
#include "static_assert.h"

#if defined(KVM_MEM_LOG_DIRTY_PAGES) || (defined(HAVE_DECL_KVM_MEM_LOG_DIRTY_PAGES) && HAVE_DECL_KVM_MEM_LOG_DIRTY_PAGES)
DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
static_assert((KVM_MEM_LOG_DIRTY_PAGES) == ((1 << 0)), "KVM_MEM_LOG_DIRTY_PAGES != (1 << 0)");
DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
#else
# define KVM_MEM_LOG_DIRTY_PAGES (1 << 0)
#endif
#if defined(KVM_MEM_READONLY) || (defined(HAVE_DECL_KVM_MEM_READONLY) && HAVE_DECL_KVM_MEM_READONLY)
DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
static_assert((KVM_MEM_READONLY) == ((1 << 1)), "KVM_MEM_READONLY != (1 << 1)");
DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
#else
# define KVM_MEM_READONLY (1 << 1)
#endif
#if defined(KVM_MEM_GUEST_MEMFD) || (defined(HAVE_DECL_KVM_MEM_GUEST_MEMFD) && HAVE_DECL_KVM_MEM_GUEST_MEMFD)
DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
static_assert((KVM_MEM_GUEST_MEMFD) == ((1 << 2)), "KVM_MEM_GUEST_MEMFD != (1 << 2)");
DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
#else
# define KVM_MEM_GUEST_MEMFD (1 << 2)
#endif
#undef XLAT_PREV_VAL

#ifndef XLAT_MACROS_ONLY

# ifdef IN_MPERS

#  error static const struct xlat kvm_mem_flags in mpers mode

# else

DIAG_PUSH_IGNORE_TAUTOLOGICAL_CONSTANT_COMPARE
static const struct xlat_data kvm_mem_flags_xdata[] = {
 XLAT(KVM_MEM_LOG_DIRTY_PAGES),
 #define XLAT_VAL_0 ((unsigned) (KVM_MEM_LOG_DIRTY_PAGES))
 #define XLAT_STR_0 STRINGIFY(KVM_MEM_LOG_DIRTY_PAGES)
 XLAT(KVM_MEM_READONLY),
 #define XLAT_VAL_1 ((unsigned) (KVM_MEM_READONLY))
 #define XLAT_STR_1 STRINGIFY(KVM_MEM_READONLY)
 XLAT(KVM_MEM_GUEST_MEMFD),
 #define XLAT_VAL_2 ((unsigned) (KVM_MEM_GUEST_MEMFD))
 #define XLAT_STR_2 STRINGIFY(KVM_MEM_GUEST_MEMFD)
};
static
const struct xlat kvm_mem_flags[1] = { {
 .data = kvm_mem_flags_xdata,
 .size = ARRAY_SIZE(kvm_mem_flags_xdata),
 .type = XT_NORMAL,
 .flags_mask = 0
#  ifdef XLAT_VAL_0
  | XLAT_VAL_0
#  endif
#  ifdef XLAT_VAL_1
  | XLAT_VAL_1
#  endif
#  ifdef XLAT_VAL_2
  | XLAT_VAL_2
#  endif
  ,
 .flags_strsz = 0
#  ifdef XLAT_STR_0
  + sizeof(XLAT_STR_0)
#  endif
#  ifdef XLAT_STR_1
  + sizeof(XLAT_STR_1)
#  endif
#  ifdef XLAT_STR_2
  + sizeof(XLAT_STR_2)
#  endif
  ,
} };
DIAG_POP_IGNORE_TAUTOLOGICAL_CONSTANT_COMPARE

#  undef XLAT_STR_0
#  undef XLAT_VAL_0
#  undef XLAT_STR_1
#  undef XLAT_VAL_1
#  undef XLAT_STR_2
#  undef XLAT_VAL_2
# endif /* !IN_MPERS */

#endif /* !XLAT_MACROS_ONLY */
