1 /* 2 * SHARED BUFFER 3 * 4 * Copyright (C) 2017-2022 Intel Corporation. 5 * 6 * SPDX-License-Identifier: BSD-3-Clause 7 * 8 * Li Fei <fei1.li@intel.com> 9 * 10 */ 11 12 #ifndef SHARED_BUFFER_H 13 #define SHARED_BUFFER_H 14 #include <acrn_common.h> 15 #include <asm/guest/vm.h> 16 /** 17 *@pre sbuf != NULL 18 *@pre data != NULL 19 */ 20 uint32_t sbuf_put(struct shared_buf *sbuf, uint8_t *data, uint32_t max_len); 21 uint32_t sbuf_put_many(struct shared_buf *sbuf, uint32_t elem_size, uint8_t *data, uint32_t data_size); 22 int32_t sbuf_share_setup(uint16_t cpu_id, uint32_t sbuf_id, uint64_t *hva); 23 void sbuf_reset(void); 24 uint32_t sbuf_next_ptr(uint32_t pos, uint32_t span, uint32_t scope); 25 int32_t sbuf_setup_common(__unused struct acrn_vm *vm, uint16_t cpu_id, uint32_t sbuf_id, uint64_t *hva); 26 27 #endif /* SHARED_BUFFER_H */ 28