blob: 4dac261ab52fd5aa026fb6c3e60de0a77bd600ae [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
Karl Meakindc759f52024-05-07 16:08:02 +010018static inline struct ffa_value ffa_error(enum ffa_error error_code)
Andrew Walbrand4d2fa12019-10-01 16:47:25 +010019{
J-Alves8fc1b502024-06-17 09:21:11 +010020 return (struct ffa_value){.func = FFA_ERROR_32,
21 .arg2 = (uint32_t)error_code};
Andrew Walbrand4d2fa12019-10-01 16:47:25 +010022}
J-Alves27b71962022-12-12 15:29:58 +000023
24struct ffa_value ffa_msg_recv_return(const struct vm *receiver);
25
26bool is_ffa_direct_msg_request_ongoing(struct vcpu_locked locked);