1/** 2 * \file 3 * \brief User-side system call implementation, architecture-independent 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, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group. 13 */ 14 15#include <barrelfish/barrelfish.h> 16#include <barrelfish/caddr.h> 17#include <barrelfish/dispatch.h> 18#include <barrelfish/syscall_arch.h> 19#include <barrelfish/curdispatcher_arch.h> 20 21/* For documentation on system calls see include/barrelfish/syscalls.h 22 */ 23 24errval_t sys_yield(capaddr_t target) 25{ 26 assert_disabled((get_dispatcher_shared_generic(curdispatcher())->disabled)); 27 return syscall2(SYSCALL_YIELD, target).error; 28} 29 30errval_t sys_suspend(bool halt) 31{ 32 return syscall2(SYSCALL_SUSPEND, halt).error; 33} 34 35errval_t sys_print(const char *string, size_t length) 36{ 37 return syscall3(SYSCALL_PRINT, (uintptr_t)string, length).error; 38} 39 40errval_t sys_getchar(char *c) 41{ 42 struct sysret ret= syscall1(SYSCALL_GETCHAR); 43 *c= ret.value; 44 return ret.error; 45} 46