1/**
2 * \file
3 * \brief Threads architecture-specific code
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#ifndef LIBBARRELFISH_ARCH_THREADS_H
16#define LIBBARRELFISH_ARCH_THREADS_H
17
18#include <barrelfish/syscall_arch.h>
19
20#if 0
21/* this is a label defined in the assembler code that implements cap_invoke() */
22extern void barrelfish_post_syscall_instr(void);
23
24/**
25 * Returns true iff the thread with the given save area has successfully
26 * performed a syscall. Used for the thread_invoke_cap_and_exit() hack.
27 */
28static inline bool thread_check_syscall_succeeded(uintptr_t *save_area)
29{
30    return ((save_area[EIP_REG] == (lvaddr_t)barrelfish_post_syscall_instr)
31            && save_area[EAX_REG] == 0);
32}
33#endif
34
35#endif // LIBBARRELFISH_ARCH_THREADS_H
36