71,28 → 71,6 |
#define CONS_GETCHAR 0x60 |
#define CONS_PUTCHAR 0x61 |
|
|
/* return codes */ |
#define EOK 0 /**< Successful return */ |
#define ENOCPU 1 /**< Invalid CPU id */ |
#define ENORADDR 2 /**< Invalid real address */ |
#define ENOINTR 3 /**< Invalid interrupt id */ |
#define EBADPGSZ 4 /**< Invalid pagesize encoding */ |
#define EBADTSB 5 /**< Invalid TSB description */ |
#define EINVAL 6 /**< Invalid argument */ |
#define EBADTRAP 7 /**< Invalid function number */ |
#define EBADALIGN 8 /**< Invalid address alignment */ |
#define EWOULDBLOCK 9 /**< Cannot complete operation without blocking */ |
#define ENOACCESS 10 /**< No access to specified resource */ |
#define EIO 11 /**< I/O Error */ |
#define ECPUERROR 12 /**< CPU is in error state */ |
#define ENOTSUPPORTED 13 /**< Function not supported */ |
#define ENOMAP 14 /**< No mapping found */ |
#define ETOOMANY 15 /**< Too many items specified / limit reached */ |
#define ECHANNEL 16 /**< Invalid LDC channel */ |
#define EBUSY 17 /**< Operation failed as resource is otherwise busy */ |
|
|
/** |
* Performs a hyperfast hypervisor API call from the assembly language code. |
* Expects the registers %o1-%o4 are properly filled with the arguments of the |
136,7 → 114,7 |
__hypercall_fast(p1, p2, p3, p4, p5, function_number) |
|
/** |
* Performs a fast hypervisor API call which can returns a value. |
* Performs a fast hypervisor API call. |
* |
* @param p1 the 1st argument of the hypervisor API call |
* @param p2 the 2nd argument of the hypervisor API call |
144,14 → 122,10 |
* @param p4 the 4th argument of the hypervisor API call |
* @param p5 the 5th argument of the hypervisor API call |
* @param function_number function number of the call |
* @param ret1 pointer to an address where the return value |
* of the hypercall should be saved, or NULL |
* @return error status |
*/ |
static inline uint64_t |
__hypercall_fast_ret1(const uint64_t p1, const uint64_t p2, const uint64_t p3, |
const uint64_t p4, const uint64_t p5, const uint64_t function_number, |
uint64_t * const ret1) |
__hypercall_fast(const uint64_t p1, const uint64_t p2, const uint64_t p3, |
const uint64_t p4, const uint64_t p5, const uint64_t function_number) |
{ |
register uint64_t a6 asm("o5") = function_number; |
register uint64_t a1 asm("o0") = p1; |
168,32 → 142,10 |
: "memory" |
); |
|
if (ret1 != NULL) |
*ret1 = a2; |
return a1; |
} |
|
/** |
* Performs a fast hypervisor API call which return no value except for the |
* error status. |
* |
* @param p1 the 1st argument of the hypervisor API call |
* @param p2 the 2nd argument of the hypervisor API call |
* @param p3 the 3rd argument of the hypervisor API call |
* @param p4 the 4th argument of the hypervisor API call |
* @param p5 the 5th argument of the hypervisor API call |
* @param function_number function number of the call |
* @return error status |
*/ |
static inline uint64_t |
__hypercall_fast(const uint64_t p1, const uint64_t p2, const uint64_t p3, |
const uint64_t p4, const uint64_t p5, const uint64_t function_number) |
{ |
return __hypercall_fast_ret1(p1, p2, p3, p4, p5, function_number, |
NULL); |
} |
|
/** |
* Performs a hyperfast hypervisor API call. |
* |
* @param p1 the 1st argument of the hypervisor API call |