3 * \brief Debug system calls shared by all architectures, user-side
7 * Copyright (c) 2007, 2008, 2009, 2010, ETH Zurich.
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.
15 #include <barrelfish/barrelfish.h>
16 #include <barrelfish/dispatch.h>
17 #include <barrelfish/syscall_arch.h>
18 #include <barrelfish_kpi/sys_debug.h>
19 #include <barrelfish/sys_debug.h>
23 errval_t sys_nop(void)
25 return syscall1(SYSCALL_NOP).error;
28 errval_t sys_reboot(void)
30 return syscall1(SYSCALL_REBOOT).error;
33 errval_t sys_debug_context_counter_reset(void)
35 return syscall2(SYSCALL_DEBUG, DEBUG_CONTEXT_COUNTER_RESET).error;
38 errval_t sys_debug_context_counter_read(uint64_t *ret)
40 struct sysret sr = syscall2(SYSCALL_DEBUG, DEBUG_CONTEXT_COUNTER_READ);
45 errval_t sys_debug_print_context_counter(void)
48 errval_t err = sys_debug_context_counter_read(&val);
50 printf("core %d: csc = %" PRIu64 "\n", disp_get_core_id(), val);
55 errval_t sys_debug_timeslice_counter_read(uint64_t *ret)
57 struct sysret sr = syscall2(SYSCALL_DEBUG, DEBUG_TIMESLICE_COUNTER_READ);
62 errval_t sys_debug_print_timeslice(void)
65 errval_t err = sys_debug_timeslice_counter_read(&val);
67 printf("core %d: kernel_now = %" PRIu64 "\n", disp_get_core_id(), val);
72 errval_t sys_debug_flush_cache(void)
74 return syscall2(SYSCALL_DEBUG, DEBUG_FLUSH_CACHE).error;
77 errval_t sys_debug_send_ipi(uint8_t destination, uint8_t shorthand, uint8_t vector)
79 return syscall5(SYSCALL_DEBUG,
80 DEBUG_SEND_IPI, destination, shorthand, vector).error;
83 errval_t sys_debug_set_breakpoint(uintptr_t addr, uint8_t mode, uint8_t length)
85 return syscall5(SYSCALL_DEBUG,
86 DEBUG_SET_BREAKPOINT, addr, mode, length).error;
89 errval_t sys_debug_cap_trace_ctrl(bool enable, genpaddr_t start, gensize_t size)
91 return syscall5(SYSCALL_DEBUG,
92 DEBUG_TRACE_PMEM_CTRL, enable, start, size).error;
96 sys_debug_print_capabilities(void) {
97 return syscall2(SYSCALL_DEBUG, DEBUG_PRINT_CAPABILITIES).error;