blob: 0009ac8d9096f3c052744641ee175474d2e4e9e8 [file] [log] [blame]
Wedson Almeida Filho3fcbcff2018-07-10 23:53:39 +01001#ifndef _API_H
2#define _API_H
3
Andrew Scull18c78fc2018-08-20 12:57:41 +01004#include "hf/cpu.h"
5#include "hf/vm.h"
Wedson Almeida Filho3fcbcff2018-07-10 23:53:39 +01006
7/* TODO: Can we hide these? */
8extern struct vm secondary_vm[MAX_VMS];
9extern uint32_t secondary_vm_count;
10extern struct vm primary_vm;
11
Wedson Almeida Filho2f94ec12018-07-26 16:00:48 +010012struct vcpu *api_switch_to_primary(size_t primary_retval,
13 enum vcpu_state secondary_state);
14
Wedson Almeida Filho3fcbcff2018-07-10 23:53:39 +010015int32_t api_vm_get_count(void);
16int32_t api_vcpu_get_count(uint32_t vm_idx);
17int32_t api_vcpu_run(uint32_t vm_idx, uint32_t vcpu_idx, struct vcpu **next);
18struct vcpu *api_wait_for_interrupt(void);
Andrew Scull265ada92018-07-30 15:19:01 +010019int32_t api_vm_configure(ipaddr_t send, ipaddr_t recv);
Wedson Almeida Filho2f94ec12018-07-26 16:00:48 +010020
21int32_t api_rpc_request(uint32_t vm_idx, size_t size);
22int32_t api_rpc_read_request(bool block, struct vcpu **next);
23int32_t api_rpc_reply(size_t size, bool ack, struct vcpu **next);
24int32_t api_rpc_ack(void);
Wedson Almeida Filho3fcbcff2018-07-10 23:53:39 +010025
Andrew Scull4f170f52018-07-19 12:58:20 +010026#endif /* _API_H */