Loading...
Searching...
No Matches
arm_smccc.h
Go to the documentation of this file.
/*
* Copyright (C) 2018, 2022, 2024 Kernkonzept GmbH.
* Author(s): Sarah Hoffmann <sarah.hoffmann@kernkonzept.com>
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include <l4/sys/types.h>
#include <l4/sys/utcb.h>
L4_INLINE l4_msgtag_t
l4_arm_smccc_call(l4_cap_idx_t pfc, l4_umword_t func, l4_umword_t in0,
l4_umword_t in1, l4_umword_t in2, l4_umword_t in3,
l4_umword_t in4, l4_umword_t in5, l4_umword_t *out0,
l4_umword_t *out1, l4_umword_t *out2, l4_umword_t *out3,
l4_umword_t client_id) L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_arm_smccc_call_u(l4_cap_idx_t pfc, l4_umword_t func, l4_umword_t in0,
l4_umword_t in1, l4_umword_t in2, l4_umword_t in3,
l4_umword_t in4, l4_umword_t in5, l4_umword_t *out0,
l4_umword_t *out1, l4_umword_t *out2, l4_umword_t *out3,
l4_umword_t client_id, l4_utcb_t *utcb) L4_NOTHROW;
/* IMPLEMENTATION -----------------------------------------------------------*/
#include <l4/sys/ipc.h>
L4_INLINE l4_msgtag_t
l4_arm_smccc_call(l4_cap_idx_t pfc, l4_umword_t func,
l4_umword_t in0, l4_umword_t in1,
l4_umword_t in2, l4_umword_t in3,
l4_umword_t in4, l4_umword_t in5,
l4_umword_t *out0, l4_umword_t *out1,
l4_umword_t *out2, l4_umword_t *out3,
l4_umword_t client_id) L4_NOTHROW
{
return l4_arm_smccc_call_u(pfc, func, in0, in1, in2, in3, in4, in5,
out0, out1, out2, out3, client_id, l4_utcb());
}
L4_INLINE l4_msgtag_t
l4_arm_smccc_call_u(l4_cap_idx_t pfc, l4_umword_t func, l4_umword_t in0,
l4_umword_t in1, l4_umword_t in2, l4_umword_t in3,
l4_umword_t in4, l4_umword_t in5, l4_umword_t *out0,
l4_umword_t *out1, l4_umword_t *out2, l4_umword_t *out3,
l4_umword_t client_id, l4_utcb_t *utcb) L4_NOTHROW
{
l4_msgtag_t ret;
l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
v->mr[0] = func;
v->mr[1] = in0;
v->mr[2] = in1;
v->mr[3] = in2;
v->mr[4] = in3;
v->mr[5] = in4;
v->mr[6] = in5;
v->mr[7] = client_id;
ret = l4_ipc_call(pfc, utcb, l4_msgtag(L4_PROTO_SMCCC, 8, 0, 0),
L4_IPC_NEVER);
if (l4_error(ret) >= 0)
{
*out0 = v->mr[0];
*out1 = v->mr[1];
*out2 = v->mr[2];
*out3 = v->mr[3];
}
return ret;
}
l4_arm_smccc_call
l4_msgtag_t l4_arm_smccc_call(l4_cap_idx_t pfc, l4_umword_t func, l4_umword_t in0, l4_umword_t in1, l4_umword_t in2, l4_umword_t in3, l4_umword_t in4, l4_umword_t in5, l4_umword_t *out0, l4_umword_t *out1, l4_umword_t *out2, l4_umword_t *out3, l4_umword_t client_id) L4_NOTHROW
C interface for calling the ARM secure monitor, see L4::Arm_smccc::call() for the C++ interface.
Definition arm_smccc.h:42
l4_umword_t
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
l4_cap_idx_t
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:336
l4_ipc_call
l4_msgtag_t l4_ipc_call(l4_cap_idx_t object, l4_utcb_t *utcb, l4_msgtag_t tag, l4_timeout_t timeout) L4_NOTHROW
Object call (usual invocation).
Definition ipc.h:565
l4_error
long l4_error(l4_msgtag_t tag) L4_NOTHROW
Get IPC error code if any or message tag label otherwise for an IPC call.
Definition ipc.h:646
l4_msgtag
l4_msgtag_t l4_msgtag(long label, unsigned words, unsigned items, unsigned flags) L4_NOTHROW
Create a message tag from the specified values.
Definition types.h:405
L4_PROTO_SMCCC
@ L4_PROTO_SMCCC
Protocol ID for ARM SMCCC calls.
Definition types.h:66
L4_IPC_NEVER
#define L4_IPC_NEVER
never timeout
Definition __timeout.h:76
l4_utcb_t
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:56
l4_utcb
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Definition utcb.h:346
L4_NOTHROW
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition compiler.h:161
L4_INLINE
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
ipc.h
Common IPC interface.
types.h
Common L4 ABI Data Types.
utcb.h
UTCB definitions.
l4_msgtag_t
Message tag data structure.
Definition types.h:154
l4_msg_regs_t
Encapsulation of the message-register block in the UTCB.
Definition utcb.h:68
l4_msg_regs_t::mr
l4_umword_t mr[L4_UTCB_GENERIC_DATA_SIZE]
Message registers.
Definition utcb.h:69