Line data Source code
1 : /* SPDX-FileCopyrightText: Copyright 2026 Cozens Software Solutions Limited
2 : * SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0 OR LicenseRef-PolyForm-Internal-Use-1.0.0 OR LicenseRef-COSOSO-Commercial
3 : */
4 :
5 : #ifndef SOLIDSYSLOGFREERTOSMUTEXPRIVATE_H
6 : #define SOLIDSYSLOGFREERTOSMUTEXPRIVATE_H
7 :
8 : #include <stdint.h>
9 : #include "SolidSyslogError.h"
10 : #include "SolidSyslogPrival.h"
11 : #include "SolidSyslogFreeRtosMutexErrors.h"
12 :
13 : #include "FreeRTOS.h"
14 : #include "semphr.h"
15 :
16 : #include "SolidSyslogMutexDefinition.h"
17 :
18 : /* xSemaphoreCreateMutexStatic returns a handle that is the same pointer
19 : * as the StaticSemaphore_t passed in, so the per-instance struct doesn't
20 : * carry a separate SemaphoreHandle_t - the primitive is embedded directly,
21 : * as in every Mutex adapter. */
22 : struct SolidSyslogFreeRtosMutex
23 : {
24 : struct SolidSyslogMutex Base;
25 : StaticSemaphore_t Buffer;
26 : };
27 :
28 : void SolidSyslogFreeRtosMutex_Initialise(struct SolidSyslogMutex* base);
29 : void SolidSyslogFreeRtosMutex_Cleanup(struct SolidSyslogMutex* base);
30 :
31 13 : static inline void FreeRtosMutex_Report(
32 : enum SolidSyslogSeverity severity,
33 : uint16_t category,
34 : enum SolidSyslogMutexErrors code
35 : )
36 : {
37 13 : SolidSyslog_Error(severity, &SolidSyslogFreeRtosMutexErrorSource, category, (int32_t) code);
38 13 : }
39 :
40 : #endif /* SOLIDSYSLOGFREERTOSMUTEXPRIVATE_H */
|