blob: c53c35cd075b04a85d060dc11d1ad802ccccb9fb [file] [log] [blame]
Mingyang Sundeae45d2021-09-06 15:31:07 +08001/*
2 * Copyright (c) 2021, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef __BACKEND_H__
9#define __BACKEND_H__
10
11#include <stdint.h>
12#include "psa/error.h"
13#include "spm_ipc.h"
14#include "load/spm_load_api.h"
15
16/* BASIC TYPE DEFINITIONS */
17
18struct backend_ops_t {
19 /*
20 * Runtime model-specific component initialization routine. This
21 * is an `assuredly` function, would panic if any error occurred.
22 */
23 void (*comp_init_assuredly)(struct partition_t *p_pt,
24 uint32_t service_setting);
25
26 /*
27 * Runtime model-specific kick-off method for the whole system.
28 * Returns a hardware-specific control value, which is transparent
29 * to SPM common logic.
30 */
31 uint32_t (*system_run)(void);
32
33 /* Runtime model-specific message handling mechanism. */
34 psa_status_t (*messaging)(struct service_t *p_serv,
35 struct tfm_msg_body_t *p_msg);
36
37};
38
39/* RUNTIME MODEL BACKENDS DECLARATION */
40
41/* IPC backend */
42extern const struct backend_ops_t backend_instance;
43
44/* The component list, and a MACRO indicate this is not a common global. */
45extern struct partition_head_t partition_listhead;
46#define PARTITION_LIST_ADDR (&partition_listhead)
47
48#endif /* __BACKEND_H__ */