diff --git a/.gitee/CODEOWNERS b/.gitee/CODEOWNERS
index d5482979e978b71b625e828fa7c7b000f0435b2d..b2cbf9c11773268e220e76d2b0674b36a888b6a6 100644
--- a/.gitee/CODEOWNERS
+++ b/.gitee/CODEOWNERS
@@ -13,23 +13,23 @@
* limitations under the License.
*/
-adapter/ @duwei-23
-framework/ @duwei-23
-framework/model/input/ @time_zhang
-framework/model/audio/ @whoselettlelion
-framework/include/audio/ @whoselettlelion
-framework/model/sensor/ @whoselettlelion
-framework/model/misc/ @whoselettlelion
-framework/model/display/ @whoselettlelion
-framework/model/camera/ @duwei-23
-framework/include/camera/ @duwei-23
-framework/model/wifi/ @duwei-23
-framework/model/network/ @duwei-23
-framework/model/usb/ @duwei-23
-framework/include/wifi/ @duwei-23
-framework/include/bluetooth/ @duwei-23
-framework/include/ethernet/ @duwei-23
-framework/include/net/ @duwei-23
+adapter/ @dufresne__andy
+framework/ @dufresne__andy
+framework/model/input/ @dufresne__andy
+framework/model/audio/ @dufresne__andy
+framework/include/audio/ @dufresne__andy
+framework/model/sensor/ @dufresne__andy
+framework/model/misc/ @dufresne__andy
+framework/model/display/ @dufresne__andy
+framework/model/camera/ @dufresne__andy
+framework/include/camera/ @dufresne__andy
+framework/model/wifi/ @dufresne__andy
+framework/model/network/ @dufresne__andy
+framework/model/usb/ @dufresne__andy
+framework/include/wifi/ @dufresne__andy
+framework/include/bluetooth/ @dufresne__andy
+framework/include/ethernet/ @dufresne__andy
+framework/include/net/ @dufresne__andy
# any change to interfaces/inner_api/hdi/hdf_device_manager_interface_code.h needs to be reviewed by @leonchan5
interfaces/inner_api/hdi/hdf_device_manager_interface_code.h @leonchan5
diff --git a/adapter/uhdf2/hdi/src/hdi_smq_syncer.cpp b/adapter/uhdf2/hdi/src/hdi_smq_syncer.cpp
index 1c9a156bcf6c74a217b0b654ac36bfddd1041718..4717577d160496dd06b2bbbb075afdbb063ea293 100644
--- a/adapter/uhdf2/hdi/src/hdi_smq_syncer.cpp
+++ b/adapter/uhdf2/hdi/src/hdi_smq_syncer.cpp
@@ -98,6 +98,15 @@ int SharedMemQueueSyncer::Wake(uint32_t bitset)
return HDF_SUCCESS;
}
+int SharedMemQueueSyncer::CheckSyncStatus(uint32_t bitset)
+{
+ uint32_t syncWordOld = std::atomic_load(syncAddr_);
+ if (syncWordOld & bitset) {
+ return HDF_SUCCESS;
+ }
+ return HDF_FAILURE;
+}
+
void SharedMemQueueSyncer::TimeoutToRealtime(int64_t timeout, struct timespec &realtime)
{
constexpr int64_t nano = SEC_TO_NANOSEC;
diff --git a/framework/test/coretest/.keep b/framework/test/coretest/.keep
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/framework/test/coretest/hdf_core_test_for_audio b/framework/test/coretest/hdf_core_test_for_audio
new file mode 100644
index 0000000000000000000000000000000000000000..32fd0c2c6f3131673f58bafc9aff55865f163be8
--- /dev/null
+++ b/framework/test/coretest/hdf_core_test_for_audio
@@ -0,0 +1,8 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ *
+ * HDF is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
+ * See the LICENSE file in the root of this repository for complete details.
+ */
+ hdf_core_test_for_audio
\ No newline at end of file
diff --git a/interfaces/inner_api/hdi/base/hdi_smq.h b/interfaces/inner_api/hdi/base/hdi_smq.h
index 88789769478f09d8201831f0aae8a291f6fe331c..b0207428e4b01621fa35339f62a09f2d5d2f83d6 100644
--- a/interfaces/inner_api/hdi/base/hdi_smq.h
+++ b/interfaces/inner_api/hdi/base/hdi_smq.h
@@ -196,6 +196,16 @@ public:
*/
int ReadNonBlocking(T *data, size_t count);
+ /**
+ * @brief Reset all the status in SharedMemQueue.
+ *
+ * all the data in SMQ will be discard.
+ *
+ * @param.
+ * @return Returns 0 if the operation is successful; returns a non-zero value otherwise.
+ */
+ int Reset();
+
/**
* @brief Obtains the number of elements that can be written to the SMQ.
*
@@ -477,6 +487,29 @@ int SharedMemQueue::Write(const T *data, size_t count, int64_t waitTimeNanoSe
return ret;
}
+template
+int SharedMemQueue::Reset()
+{
+ // do not invoke this function in multi-thread in same side
+ if (meta_->GetType() != SmqType::SYNCED_SMQ) {
+ HDF_LOGW("unsynecd smq reset status");
+ readOffset_->exchange(writeOffset_->load(std::memory_order_acquire));
+ return HDF_SUCCESS;
+ }
+ int ret = syncer_->CheckSyncStatus(SharedMemQueueSyncer::SYNC_WORD_READ);
+ if (ret == HDF_SUCCESS) {
+ HDF_LOGI("Currently reset by read side, reset and wake write side.");
+ readOffset_->exchange(writeOffset_->load(std::memory_order_acquire));
+ syncer_->Wake(SharedMemQueueSyncer::SYNC_WORD_WRITE);
+ return HDF_SUCCESS;
+ } else {
+ HDF_LOGI("Currently reset by write side.");
+ readOffset_->exchange(writeOffset_->load(std::memory_order_acquire));
+ }
+
+ return HDF_SUCCESS;
+}
+
template
int SharedMemQueue::Read(T *data, size_t count, int64_t waitTimeNanoSec)
{
diff --git a/interfaces/inner_api/hdi/base/hdi_smq_syncer.h b/interfaces/inner_api/hdi/base/hdi_smq_syncer.h
index 00d83e6fc29092209af6f1812e83475c3634be40..246d10164b6b3a213b548ced977f5dcc9fe562a5 100644
--- a/interfaces/inner_api/hdi/base/hdi_smq_syncer.h
+++ b/interfaces/inner_api/hdi/base/hdi_smq_syncer.h
@@ -79,6 +79,14 @@ public:
*/
int Wake(uint32_t bitset);
+ /**
+ * @brief Check the sync word.
+ *
+ * @param bitset Indicates the synchronization type.
+ * @return Returns 0 if the waiter is woken up.
+ */
+ int CheckSyncStatus(uint32_t bitset);
+
private:
/**
* @brief Waits until a certain condition becomes true.