mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
FROMLIST: virt: gunyah: msgq: Add hypercalls to send and receive messages
Add hypercalls to send and receive messages on a Gunyah message queue. Change-Id: I4ee7893c4ce76ea273fa4db7c43c345905f87ed0 Signed-off-by: Elliot Berman <quic_eberman@quicinc.com> Bug: 268234781 Link: https://lore.kernel.org/all/20230304010632.2127470-7-quic_eberman@quicinc.com/
This commit is contained in:
committed by
Aleksei Vetrov
parent
cc7db24050
commit
5943689fc3
@@ -41,6 +41,8 @@ EXPORT_SYMBOL_GPL(arch_is_gh_guest);
|
||||
fn)
|
||||
|
||||
#define GH_HYPERCALL_HYP_IDENTIFY GH_HYPERCALL(0x8000)
|
||||
#define GH_HYPERCALL_MSGQ_SEND GH_HYPERCALL(0x801B)
|
||||
#define GH_HYPERCALL_MSGQ_RECV GH_HYPERCALL(0x801C)
|
||||
|
||||
/**
|
||||
* gh_hypercall_hyp_identify() - Returns build information and feature flags
|
||||
@@ -60,5 +62,34 @@ void gh_hypercall_hyp_identify(struct gh_hypercall_hyp_identify_resp *hyp_identi
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(gh_hypercall_hyp_identify);
|
||||
|
||||
enum gh_error gh_hypercall_msgq_send(u64 capid, size_t size, void *buff, int tx_flags, bool *ready)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
|
||||
arm_smccc_1_1_hvc(GH_HYPERCALL_MSGQ_SEND, capid, size, (uintptr_t)buff, tx_flags, 0, &res);
|
||||
|
||||
if (res.a0 == GH_ERROR_OK)
|
||||
*ready = !!res.a1;
|
||||
|
||||
return res.a0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(gh_hypercall_msgq_send);
|
||||
|
||||
enum gh_error gh_hypercall_msgq_recv(u64 capid, void *buff, size_t size, size_t *recv_size,
|
||||
bool *ready)
|
||||
{
|
||||
struct arm_smccc_res res;
|
||||
|
||||
arm_smccc_1_1_hvc(GH_HYPERCALL_MSGQ_RECV, capid, (uintptr_t)buff, size, 0, &res);
|
||||
|
||||
if (res.a0 == GH_ERROR_OK) {
|
||||
*recv_size = res.a1;
|
||||
*ready = !!res.a2;
|
||||
}
|
||||
|
||||
return res.a0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(gh_hypercall_msgq_recv);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("Gunyah Hypervisor Hypercalls");
|
||||
|
||||
@@ -108,4 +108,10 @@ struct gh_hypercall_hyp_identify_resp {
|
||||
|
||||
void gh_hypercall_hyp_identify(struct gh_hypercall_hyp_identify_resp *hyp_identity);
|
||||
|
||||
#define GH_HYPERCALL_MSGQ_TX_FLAGS_PUSH BIT(0)
|
||||
|
||||
enum gh_error gh_hypercall_msgq_send(u64 capid, size_t size, void *buff, int tx_flags, bool *ready);
|
||||
enum gh_error gh_hypercall_msgq_recv(u64 capid, void *buff, size_t size, size_t *recv_size,
|
||||
bool *ready);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user