2016-02-11 11:59:31 +01:00
|
|
|
/**
|
|
|
|
* \brief Calls supported by machine mode (or SBI interface in RISC-V)
|
|
|
|
* \author Sebastian Sumpf
|
2015-11-10 12:49:05 +01:00
|
|
|
* \author Martin Stein
|
2016-02-11 11:59:31 +01:00
|
|
|
* \date 2015-06-14
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2015-2016 Genode Labs GmbH
|
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
|
|
* under the terms of the GNU General Public License version 2.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _MACHINE_CALL_H_
|
|
|
|
#define _MACHINE_CALL_H_
|
|
|
|
|
2015-11-10 12:49:05 +01:00
|
|
|
/* base-hw includes */
|
|
|
|
#include <kernel/interface.h>
|
2016-02-11 11:59:31 +01:00
|
|
|
|
|
|
|
namespace Machine {
|
|
|
|
|
2015-11-10 12:49:05 +01:00
|
|
|
using namespace Kernel;
|
2016-02-11 11:59:31 +01:00
|
|
|
|
2015-11-10 12:49:05 +01:00
|
|
|
/**
|
|
|
|
* SBI calls to machine mode.
|
|
|
|
*
|
|
|
|
* Keep in sync with mode_transition.s.
|
|
|
|
*/
|
|
|
|
constexpr Call_arg call_id_put_char() { return 0x100; }
|
|
|
|
constexpr Call_arg call_id_set_sys_timer() { return 0x101; }
|
|
|
|
constexpr Call_arg call_id_is_user_mode() { return 0x102; }
|
2016-02-11 11:59:31 +01:00
|
|
|
|
2015-11-10 12:49:05 +01:00
|
|
|
inline void put_char(Genode::uint64_t const c) {
|
|
|
|
call(call_id_put_char(), (Call_arg)c); }
|
|
|
|
|
|
|
|
inline void set_sys_timer(addr_t const t) {
|
|
|
|
call(call_id_set_sys_timer(), (Call_arg)t); }
|
|
|
|
|
|
|
|
inline bool is_user_mode() { return call(call_id_is_user_mode()); }
|
2016-02-11 11:59:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* _MACHINE_CALL_H_ */
|