aboutsummaryrefslogtreecommitdiff
path: root/components/messaging/ffa/libsp/include/sp_api_defines.h
blob: 9a8055915488b501b1a63b29a2617f458db9cbf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* SPDX-License-Identifier: BSD-3-Clause */
/*
 * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
 */

#ifndef LIBSP_INCLUDE_SP_API_DEFINES_H_
#define LIBSP_INCLUDE_SP_API_DEFINES_H_

/**
 * SP result values are integers where the zero value indicates success and
 * negative values are error codes. The first part of the error code range is
 * mapped directly to the FF-A error code range so the SP result type is able
 * to propagate FF-A error codes. The second part of the range is for SP layer
 * specific error codes. This ranges starts immediately after the value of the
 * last (lowest value) FF-A error code.
 */

#define SP_RESULT_OFFSET	(FFA_ABORTED)
#define SP_RESULT_CREATE(x)	(SP_RESULT_OFFSET + (x))

/** SP API call result codes */
#define SP_RESULT_OK			(0)
#define SP_RESULT_FFA(res)		(res)
#define SP_RESULT_INTERNAL_ERROR	SP_RESULT_CREATE(-1)
#define SP_RESULT_INVALID_PARAMETERS	SP_RESULT_CREATE(-2)
#define SP_RESULT_INVALID_STATE		SP_RESULT_CREATE(-3)

#endif /* LIBSP_INCLUDE_SP_API_DEFINES_H_ */