blob: 44c3c2560a163332e0e37d46e320ecde0f2f90cd [file] [log] [blame]
Antonio Nino Diaze46924e2018-11-08 10:58:26 +00001/*
2 * Copyright (c) 2018, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef SPRT_CLIENT_H
8#define SPRT_CLIENT_H
9
10#include <stdint.h>
11
12#include "sprt_common.h"
13
14/*
15 * Point the SPRT library at a shared buffer between SPM and SP.
16 */
17void sprt_initialize_queues(void *buffer_base);
18
19/*
20 * Return SPRT version.
21 */
22uint32_t sprt_version(void);
23
24/*
25 * Called by the main SPRT client execution context when there are no more
26 * messages available via sprt_get_next_message(), or if the SPRT client wishes
27 * to yield execution to allow other SPs to run.
28 */
29void sprt_wait_for_messages(void);
30
31/*
32 * Returns the next message to be processed by the SPRT client. There can be
33 * multiple queues of messages for a partition, `queue_num` specifies which
34 * queue to read from. Each message can be retrieved only once. The message
35 * pointer must point to a valid memory owned by the caller. A zero return
36 * value indicates there is a message for the SP, -ENOENT means there are no
37 * messages.
38 */
39int sprt_get_next_message(struct sprt_queue_entry_message *message,
40 int queue_num);
41
42/*
43 * End processing of the message passing arg0 to arg3 back to the SPCI client.
44 */
45void sprt_message_end(struct sprt_queue_entry_message *message,
46 u_register_t arg0, u_register_t arg1, u_register_t arg2,
47 u_register_t arg3);
48
49#endif /* SPRT_CLIENT_H */