+ char lti_name[LEDGER_NAME_MAX];
+ char lti_group[LEDGER_NAME_MAX];
+ char lti_units[LEDGER_NAME_MAX];
+};
+
+#ifdef MACH_KERNEL_PRIVATE
+/*
+ * These definitions are only here to allow pmap.c to determine the expected
+ * size of a ledger at build time. Direct access to ledger fields or to
+ * ledger entries is prohibited.
+ */
+
+/*
+ * The explicit alignment is to ensure that atomic operations don't panic
+ * on ARM.
+ */
+struct ledger_entry {
+ volatile uint32_t le_flags;
+#define LEDGER_PERCENT_NONE UINT16_MAX
+ uint16_t le_warn_percent;
+ ledger_amount_t le_limit;
+ volatile ledger_amount_t le_credit __attribute__((aligned(8)));
+ volatile ledger_amount_t le_debit __attribute__((aligned(8)));
+ union {
+ struct {
+ /*
+ * XXX - the following two fields can go away if we move all of
+ * the refill logic into process policy
+ */
+ uint64_t le_refill_period;
+ uint64_t le_last_refill;
+ } le_refill;
+ struct {
+ ledger_amount_t le_lifetime_max; /* Process lifetime peak */
+#if CONFIG_LEDGER_INTERVAL_MAX
+ ledger_amount_t le_interval_max; /* Interval peak XXX better name needed */
+#endif
+ } _le_max;
+ } _le;
+} __attribute__((aligned(8)));
+
+struct ledger {
+ uint64_t l_id;
+ os_refcnt_t l_refs;
+ int32_t l_size;
+ struct ledger_template *l_template;
+ struct ledger_entry l_entries[0] __attribute__((aligned(8)));