blob: c6bc73ea46df39d0651c5b054b190be71dd4762b [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"
14
Andrew Walbranb5ab43c2020-04-30 11:32:54 +010015#include "vmapi/hf/ffa.h"
Jose Marinho75509b42019-04-09 09:34:59 +010016
Olivier Deprezb76307d2022-06-09 17:17:45 +020017#define FFA_VERSION_RESERVED_BIT (UINT32_C(1) << 31)
18
J-Alves13318e32021-02-22 17:21:00 +000019static inline struct ffa_value ffa_error(int32_t error_code)
Andrew Walbrand4d2fa12019-10-01 16:47:25 +010020{
J-Alves13318e32021-02-22 17:21:00 +000021 return (struct ffa_value){.func = FFA_ERROR_32,
22 .arg2 = (uint32_t)error_code};
Andrew Walbrand4d2fa12019-10-01 16:47:25 +010023}
J-Alves27b71962022-12-12 15:29:58 +000024
25struct ffa_value ffa_msg_recv_return(const struct vm *receiver);
26
27bool is_ffa_direct_msg_request_ongoing(struct vcpu_locked locked);