1/** 2 * \file 3 * \brief User-side system call wrappers 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#ifndef LIBBARRELFISH_SYSCALL_H 16#define LIBBARRELFISH_SYSCALL_H 17 18/* Proper Barrelfish system calls */ 19 20#include <sys/cdefs.h> /* for __BEGIN_DECLS, __END_DECLS */ 21#include <errors/errno.h> /* for errval_t */ 22#include <barrelfish_kpi/types.h> 23 24__BEGIN_DECLS 25 26/** 27 * \brief Yield the CPU. 28 * 29 * Yields the remainder of the time-slice for this dispatcher to the next 30 * runnable dispatcher. 31 * 32 * \param target Dispatcher to yield to, or CPTR_NULL for an undirected yield 33 * 34 * \return Syscall error code (#SYS_ERR_OK on success). 35 */ 36errval_t sys_yield(capaddr_t target); 37 38/** Suspend the current cpu */ 39errval_t sys_suspend(bool halt); 40 41/* Debug/Benchmarking system calls */ 42errval_t sys_nop(void); 43errval_t sys_reboot(void); 44 45/** 46 * \brief Print a string through the kernel. 47 * 48 * This calls #SYSCALL_PRINT to print 'string' of length 'length' through 49 * the kernel. Whether and where 'string' is printed is determined by 50 * the kernel. 51 * 52 * \param string Pointer to string to print. 53 * \param length Length of string. 54 * 55 * \return Syscall error code (#SYS_ERR_OK on success). 56 */ 57errval_t sys_print(const char *string, size_t length); 58 59errval_t sys_getchar(char *c); 60 61__END_DECLS 62 63#endif //LIBBARRELFISH_SYSCALL_H 64