1/**
2 * \file
3 * \brief Debug system calls for all x86 architectures, 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#include <barrelfish/sys_debug.h>
20#include <stdio.h>
21#include <inttypes.h>
22
23errval_t sys_debug_get_tsc_per_ms(uint64_t *ret)
24{
25    struct sysret sr = syscall2(SYSCALL_DEBUG, DEBUG_GET_TSC_PER_MS);
26    *ret = sr.value;
27    return sr.error;
28}
29
30errval_t sys_debug_get_apic_id(uint8_t *ret)
31{
32    struct sysret sr = syscall2(SYSCALL_DEBUG, DEBUG_GET_APIC_ID);
33    *ret = sr.value;
34    return sr.error;
35}
36
37errval_t sys_debug_get_apic_timer(uint32_t *ret)
38{
39    struct sysret sr = syscall2(SYSCALL_DEBUG, DEBUG_GET_APIC_TIMER);
40    *ret = sr.value;
41    return sr.error;
42}
43
44errval_t sys_debug_get_apic_ticks_per_sec(uint32_t *ret)
45{
46    struct sysret sr = syscall2(SYSCALL_DEBUG, DEBUG_GET_APIC_TICKS_PER_SEC);
47    *ret = sr.value;
48    return sr.error;
49}
50