blob: 66946d5a73b40c3e5fcc71f526f0b5630811a683 [file] [log] [blame]
Jose Marinhofc0b2b62019-06-06 11:18:45 +01001/*
J-Alves13318e32021-02-22 17:21:00 +00002 * Copyright 2021 The Hafnium Authors.
Jose Marinhofc0b2b62019-06-06 11:18:45 +01003 *
Andrew Walbrane959ec12020-06-17 15:01:09 +01004 * Use of this source code is governed by a BSD-style
5 * license that can be found in the LICENSE file or at
6 * https://opensource.org/licenses/BSD-3-Clause.
Jose Marinhofc0b2b62019-06-06 11:18:45 +01007 */
8
9#pragma once
10
Andrew Walbran475c1452020-02-07 13:22:22 +000011#include <stdint.h>
Jose Marinho75509b42019-04-09 09:34:59 +010012
Andrew Walbran352aa3d2020-05-01 17:51:33 +010013#include "hf/check.h"
J-Alvescf6253e2024-01-03 13:48:48 +000014#include "hf/vm.h"
Andrew Walbran352aa3d2020-05-01 17:51:33 +010015
Andrew Walbranb5ab43c2020-04-30 11:32:54 +010016#include "vmapi/hf/ffa.h"
Jose Marinho75509b42019-04-09 09:34:59 +010017
Olivier Deprezb76307d2022-06-09 17:17:45 +020018#define FFA_VERSION_RESERVED_BIT (UINT32_C(1) << 31)
19
J-Alves13318e32021-02-22 17:21:00 +000020static inline struct ffa_value ffa_error(int32_t error_code)
Andrew Walbrand4d2fa12019-10-01 16:47:25 +010021{
J-Alves13318e32021-02-22 17:21:00 +000022 return (struct ffa_value){.func = FFA_ERROR_32,
23 .arg2 = (uint32_t)error_code};
Andrew Walbrand4d2fa12019-10-01 16:47:25 +010024}
J-Alves27b71962022-12-12 15:29:58 +000025
26struct ffa_value ffa_msg_recv_return(const struct vm *receiver);
27
28bool is_ffa_direct_msg_request_ongoing(struct vcpu_locked locked);