1/*
2 * Copyright (c) 2012 ETH Zurich.
3 * All rights reserved.
4 *
5 * This file is distributed under the terms in the attached LICENSE file.
6 * If you do not find this file, copies can be found by writing to:
7 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
8 */
9
10#ifndef GENCAP_H
11#define GENCAP_H
12
13#include <barrelfish/caddr.h>
14#include <stdint.h>
15
16struct domcapref {
17    struct capref croot;
18    capaddr_t cptr;
19    uint8_t level;
20};
21
22static inline struct domcapref
23get_cap_domref(struct capref cap)
24{
25    return (struct domcapref) {
26        // XXX: should be get_croot_addr(cap)?
27        .croot = cap_root,
28        .cptr  = get_cap_addr(cap),
29        .level = get_cap_level(cap),
30    };
31}
32
33#endif
34