/* Definitions for static attributes
 *
 * To use this file, provide a definition for the ATTR() macro:
 *
 *   ATTR(dir, key, field, type, ctype, ...)
 *
 * @param dir    Directory identifier (without the dir_ prefix).
 * @param key    Key name (a constant C string).
 * @param field  Field name inside @ref kdump_ctx_t.
 * @param type   Attribute type (kdump_attr_type).
 * @param ctype  Suggested C type for the attribute.
 *
 * The variadic argument can be used to pass additional @c attr_template
 * initialization.
 *
 * A typical stanza is:
 * #define ATTR(dir, key, field, type, ctype, ...) \
 *   // use macro arguments to construct whatever you need
 * #include "static-attr.def"
 * #undef ATTR
 */

/* first PFN beyond end of physical RAM (max_pfn) */
ATTR(root, "max_pfn", max_pfn, number, kdump_pfn_t)

/* architecture name */
ATTR(arch, "name", arch_name, string, const char *,
     .ops = &arch_name_ops)

/* ELF machine ID (e_machine field) */
ATTR(arch, "machine", arch_machine, number, uint_fast16_t)

/* little-endian or big-endian */
ATTR(arch, "byte_order", byte_order, number, kdump_byte_order_t)

/* arch pointer size */
ATTR(arch, "ptr_size", ptr_size, number, size_t)

/* target page size */
ATTR(arch, "page_size", page_size, number, size_t, .ops = &page_size_ops)

/* = log2(page_size) */
ATTR(arch, "page_shift", page_shift, number, unsigned, .ops = &page_shift_ops)

/* number of CPUs in the system  */
ATTR(cpu, "number", num_cpus, number, unsigned)

/* number of QEMU CPU states */
ATTR(cpu, "qemu_number", num_qemu_cpus, number, unsigned)

/* dump file descriptor set */
ATTR(file_set, "number", num_files, number, unsigned, .ops = &num_files_ops)

/* file page map */
ATTR(file, "pagemap", file_pagemap, bitmap, kdump_bmp_t *)

/* replace excluded pages with zeroes? */
ATTR(file, "zero_excluded", zero_excluded, number, bool)

/* physical base */
ATTR(linux, "phys_base", phys_base, address, kdump_addr_t, .ops = &linux_dirty_xlat_ops)

/* Xen dump type */
ATTR(xen, "type", xen_type, number, kdump_xen_type_t, .ops = &dirty_xlat_ops)

/* Xen physmap translation */
ATTR(xen, "xlat", xen_xlat, number, kdump_xen_xlat_t, .ops = &dirty_xlat_ops)
