1 /* 2 * Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved. 3 * Copyright (c) 2022-2023, Linaro Limited. All rights reserved. 4 * 5 * SPDX-License-Identifier: BSD-3-Clause 6 */ 7 #ifndef OPENAMP_MESSENGER_API_H 8 #define OPENAMP_MESSENGER_API_H 9 10 #include <stddef.h> 11 #include <stdint.h> 12 13 #include "openamp_messenger.h" 14 15 struct openamp_messenger { 16 const struct openamp_platform_ops *platform_ops; 17 uint32_t ref_count; 18 uint8_t status; 19 20 void *transport; 21 void *platform; 22 }; 23 24 int openamp_messenger_init(struct openamp_messenger *openamp); 25 void openamp_messenger_deinit(struct openamp_messenger *openamp); 26 void openamp_messenger_call_end(struct openamp_messenger *openamp); 27 int openamp_messenger_call_invoke(struct openamp_messenger *openamp, 28 uint8_t **resp_buf, size_t *resp_len); 29 int openamp_messenger_call_begin(struct openamp_messenger *openamp, 30 uint8_t **req_buf, size_t req_len); 31 32 void *openamp_messenger_phys_to_virt(struct openamp_messenger *openamp, 33 void *pa); 34 void *openamp_messenger_virt_to_phys(struct openamp_messenger *openamp, 35 void *va); 36 #endif 37