1/**
2 * \file
3 * \brief Debug system calls, specific for x86_32, user-side
4 */
5
6/*
7 * Copyright (c) 2007, 2008, 2009, 2010, ETH Zurich.
8 * All rights reserved.
9 *
10 * This file is distributed under the terms in the attached LICENSE file.
11 * If you do not find this file, copies can be found by writing to:
12 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
13 */
14
15#include <barrelfish/barrelfish.h>
16#include <barrelfish/dispatch.h>
17#include <barrelfish/syscall_arch.h>
18#include <barrelfish_kpi/sys_debug.h>
19#define ENABLE_FEIGN_FRAME_CAP
20#include <barrelfish/sys_debug.h>
21#include <stdio.h>
22#include <inttypes.h>
23
24errval_t sys_debug_feign_frame_cap(struct capref slot, lpaddr_t base,
25                                   uint8_t bits)
26{
27    uint8_t cap_bits = get_cnode_valid_bits(slot);
28    capaddr_t addr = get_cnode_addr(slot);
29
30    return syscall5(SYSCALL_DEBUG,
31                    DEBUG_FEIGN_FRAME_CAP, addr, base, bits | (cap_bits << 8) | (slot.slot << 16)).error;
32}
33