blob: 5359f86bbfc36d826f625f938c7c9243b7688e06 [file] [log] [blame]
Andrew Scull18834872018-10-12 11:48:09 +01001/*
2 * Copyright 2018 Google LLC
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Andrew Scullfbc938a2018-08-20 14:09:28 +010017#pragma once
Wedson Almeida Filho3fcbcff2018-07-10 23:53:39 +010018
Andrew Scull18c78fc2018-08-20 12:57:41 +010019#include "hf/cpu.h"
20#include "hf/vm.h"
Wedson Almeida Filho3fcbcff2018-07-10 23:53:39 +010021
Andrew Scull6d2db332018-10-10 15:28:17 +010022#include "vmapi/hf/call.h"
23
Andrew Scullc0e569a2018-10-02 18:05:21 +010024int64_t api_vm_get_count(void);
Wedson Almeida Filho00df6c72018-10-18 11:19:24 +010025int64_t api_vcpu_get_count(uint32_t vm_id, const struct vcpu *current);
Andrew Scull6d2db332018-10-10 15:28:17 +010026struct hf_vcpu_run_return api_vcpu_run(uint32_t vm_id, uint32_t vcpu_idx,
Wedson Almeida Filho00df6c72018-10-18 11:19:24 +010027 const struct vcpu *current,
Andrew Scull6d2db332018-10-10 15:28:17 +010028 struct vcpu **next);
Wedson Almeida Filho00df6c72018-10-18 11:19:24 +010029int64_t api_vm_configure(ipaddr_t send, ipaddr_t recv,
30 const struct vcpu *current);
Wedson Almeida Filho2f94ec12018-07-26 16:00:48 +010031
Wedson Almeida Filho00df6c72018-10-18 11:19:24 +010032int64_t api_mailbox_send(uint32_t vm_id, size_t size, struct vcpu *current,
33 struct vcpu **next);
Andrew Scull6d2db332018-10-10 15:28:17 +010034struct hf_mailbox_receive_return api_mailbox_receive(bool block,
Wedson Almeida Filho00df6c72018-10-18 11:19:24 +010035 struct vcpu *current,
Andrew Scull6d2db332018-10-10 15:28:17 +010036 struct vcpu **next);
Wedson Almeida Filho00df6c72018-10-18 11:19:24 +010037int64_t api_mailbox_clear(const struct vcpu *current);
Andrew Scull6bca35e2018-10-02 12:05:32 +010038
Wedson Almeida Filho00df6c72018-10-18 11:19:24 +010039struct vcpu *api_wait_for_interrupt(struct vcpu *current);
40struct vcpu *api_yield(struct vcpu *current);