3 * \brief Essential capability definitions.
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 #ifndef BARRELFISH_SYS_DEBUG_H
16 #define BARRELFISH_SYS_DEBUG_H
18 #include <sys/cdefs.h>
19 #include <barrelfish/caddr.h>
23 // XXX: arguments to sys_debug_set_breakpoint, which are clearly x86-specific!!
24 #define X86_DEBUG_MODE_EXECONLY (0) ///< Break on instruction execution only.
25 #define X86_DEBUG_MODE_WRITEONLY (1) ///< Break on data writes only.
26 #define X86_DEBUG_MODE_READWRITE (3) ///< Break on data reads or writes but not instruction fetches.
27 #define X86_DEBUG_LENGTH_1BYTE (0)
28 #define X86_DEBUG_LENGTH_2BYTE (1)
29 #define X86_DEBUG_LENGTH_8BYTE (2) ///< Undefined?
30 #define X86_DEBUG_LENGTH_4BYTE (3)
32 errval_t sys_debug_context_counter_reset(void);
33 errval_t sys_debug_context_counter_read(uint64_t *ret);
34 errval_t sys_debug_timeslice_counter_read(uint64_t *ret);
35 errval_t sys_debug_get_tsc_per_ms(uint64_t *ret);
36 errval_t sys_debug_get_apic_id(uint8_t *ret);
37 errval_t sys_debug_get_apic_timer(uint32_t *ret);
38 errval_t sys_debug_print_context_counter(void);
39 errval_t sys_debug_print_timeslice(void);
40 errval_t sys_debug_flush_cache(void);
41 errval_t sys_debug_send_ipi(uint8_t destination, uint8_t shorthand, uint8_t vector);
42 errval_t sys_debug_set_breakpoint(uintptr_t addr, uint8_t mode, uint8_t length);
43 errval_t sys_debug_hardware_timer_read(uintptr_t* ret);
44 errval_t sys_debug_hardware_timer_hertz_read(uintptr_t* ret);
45 errval_t sys_debug_hardware_global_timer_read(uint64_t *ret);
46 errval_t sys_debug_get_apic_ticks_per_sec(uint32_t *ret);
47 errval_t sys_debug_create_irq_src_cap(struct capref cap, uint16_t gsi);
49 #ifdef ENABLE_FEIGN_FRAME_CAP
50 errval_t sys_debug_feign_frame_cap(struct capref slot, lpaddr_t base,
54 errval_t sys_debug_cap_trace_ctrl(uintptr_t types, genpaddr_t start, gensize_t size);
58 #endif //BARRELFISH_SYS_DEBUG_H