1 /* 2 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. 3 * 4 * HDF is dual licensed: you can use it either under the terms of 5 * the GPL, or the BSD license, at your option. 6 * See the LICENSE file in the root of this repository for complete details. 7 */ 8 9 #ifndef OSAL_MESSAGE_H 10 #define OSAL_MESSAGE_H 11 12 #include "hdf_slist.h" 13 14 #ifdef __cplusplus 15 extern "C" { 16 #endif /* __cplusplus */ 17 18 struct HdfMessage { 19 struct HdfSListNode entry; 20 struct HdfMessageTask *target; 21 int16_t messageId; 22 uint64_t timeStamp; 23 void *data[1]; 24 }; 25 26 struct HdfMessage *HdfMessageObtain(size_t extendSize); 27 void HdfMessageRecycle(struct HdfMessage *message); 28 void HdfMessageDelete(struct HdfSListNode *listEntry); 29 30 #ifdef __cplusplus 31 } 32 #endif /* __cplusplus */ 33 34 #endif /* OSAL_MESSAGE_H */ 35