}
-static inline struct cte *cte_for_cap(struct capability *cap)
-{
- return (struct cte *) (cap - offsetof(struct cte, cap));
-}
-
static void
paging_map_device_section(uintptr_t ttbase, lvaddr_t va, lpaddr_t pa)
{
return (address & (bytes - 1)) == 0;
}
-static inline struct cte *cte_for_cap(struct capability *cap)
-{
- return (struct cte *) (cap - offsetof(struct cte, cap));
-}
-
// ------------------------------------------------------------------------
// Exported functions
return (address & (bytes - 1)) == 0;
}
-static inline struct cte *cte_for_cap(struct capability *cap)
-{
- return (struct cte *) (cap - offsetof(struct cte, cap));
-}
-
/*
* \brief read the version number of the table (called ignored3), to see if the upper half
* of the table has been modified and needs to be replicated.
return (address & (bytes - 1)) == 0;
}
-static inline struct cte *cte_for_cap(struct capability *cap)
-{
- return (struct cte *) (cap - offsetof(struct cte, cap));
-}
-
union arm_l2_entry;
static void
return (address & (bytes - 1)) == 0;
}
-static inline struct cte *cte_for_cap(struct capability *cap)
-{
- return (struct cte *) (cap - offsetof(struct cte, cap));
-}
-
-
static void
paging_write_l1_entry(uintptr_t ttbase, lvaddr_t va, union arm_l1_entry l1)
{
#include <string.h>
#include <cap_predicates.h>
-static inline struct cte *cte_for_cap(struct capability *cap)
-{
- return (struct cte *) (cap - offsetof(struct cte, cap));
-}
-
#ifdef CONFIG_PAE
/// Map within a x86_32 pdpt
static errval_t x86_32_pdpt(struct capability *dest, cslot_t slot,
#define MEMORY_OFFSET X86_64_MEMORY_OFFSET
#endif
-static inline struct cte *cte_for_cap(struct capability *cap)
-{
- return (struct cte *) (cap - offsetof(struct cte, cap));
-}
-
/// Map within a x86_64 non leaf ptable
static errval_t x86_64_non_ptable(struct capability *dest, cslot_t slot,
struct capability *src, uintptr_t flags,
return (address & (bytes - 1)) == 0;
}
-static inline struct cte *cte_for_cap(struct capability *cap)
-{
- return (struct cte *) (cap - offsetof(struct cte, cap));
-}
-
// ------------------------------------------------------------------------
// Exported functions
(1UL << OBJBITS_CTE) * offset);
}
+static inline struct cte *cte_for_cap(struct capability *cap)
+{
+ return (struct cte *) ((char *)cap - offsetof(struct cte, cap));
+}
+
int sprint_cap(char *buf, size_t len, struct capability *cap);
void caps_trace(const char *func, int line, struct cte *cte, const char *msg);
errval_t caps_create_new(enum objtype type, lpaddr_t addr, size_t bits,
}
}
-static inline struct cte *cte_for_cap(struct capability *cap)
-{
- return (struct cte *) (cap - offsetof(struct cte, cap));
-}
-
struct sysret
sys_map(struct capability *ptable, cslot_t slot, capaddr_t source_cptr,
int source_vbits, uintptr_t flags, uintptr_t offset,