Wedson Almeida Filho | 3fcbcff | 2018-07-10 23:53:39 +0100 | [diff] [blame] | 1 | #ifndef _API_H |
| 2 | #define _API_H |
| 3 | |
Andrew Scull | 18c78fc | 2018-08-20 12:57:41 +0100 | [diff] [blame^] | 4 | #include "hf/cpu.h" |
| 5 | #include "hf/vm.h" |
Wedson Almeida Filho | 3fcbcff | 2018-07-10 23:53:39 +0100 | [diff] [blame] | 6 | |
| 7 | /* TODO: Can we hide these? */ |
| 8 | extern struct vm secondary_vm[MAX_VMS]; |
| 9 | extern uint32_t secondary_vm_count; |
| 10 | extern struct vm primary_vm; |
| 11 | |
Wedson Almeida Filho | 2f94ec1 | 2018-07-26 16:00:48 +0100 | [diff] [blame] | 12 | struct vcpu *api_switch_to_primary(size_t primary_retval, |
| 13 | enum vcpu_state secondary_state); |
| 14 | |
Wedson Almeida Filho | 3fcbcff | 2018-07-10 23:53:39 +0100 | [diff] [blame] | 15 | int32_t api_vm_get_count(void); |
| 16 | int32_t api_vcpu_get_count(uint32_t vm_idx); |
| 17 | int32_t api_vcpu_run(uint32_t vm_idx, uint32_t vcpu_idx, struct vcpu **next); |
| 18 | struct vcpu *api_wait_for_interrupt(void); |
Andrew Scull | 265ada9 | 2018-07-30 15:19:01 +0100 | [diff] [blame] | 19 | int32_t api_vm_configure(ipaddr_t send, ipaddr_t recv); |
Wedson Almeida Filho | 2f94ec1 | 2018-07-26 16:00:48 +0100 | [diff] [blame] | 20 | |
| 21 | int32_t api_rpc_request(uint32_t vm_idx, size_t size); |
| 22 | int32_t api_rpc_read_request(bool block, struct vcpu **next); |
| 23 | int32_t api_rpc_reply(size_t size, bool ack, struct vcpu **next); |
| 24 | int32_t api_rpc_ack(void); |
Wedson Almeida Filho | 3fcbcff | 2018-07-10 23:53:39 +0100 | [diff] [blame] | 25 | |
Andrew Scull | 4f170f5 | 2018-07-19 12:58:20 +0100 | [diff] [blame] | 26 | #endif /* _API_H */ |