Skip to content

Commit e8983d5

Browse files
authored
Merge branch 'master' into update-availability
2 parents 8ae1e51 + ce844bc commit e8983d5

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

.github/actions/bootstrap/action.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ runs:
2626
# because the bootstrapped Pigweed environment contains absolute paths.
2727
echo "Calculating bootstrap cache key for '$PWD'"
2828
FILES_HASH="${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}"
29-
OS_HASH="$(md5sum /etc/lsb-release | cut -d' ' -f1)"
30-
PYTHON_HASH="$(python --version | md5sum | cut -d' ' -f1)"
29+
case "$RUNNER_OS" in
30+
macOS) OS_HASH="$(sw_vers | shasum -a 256 | cut -d' ' -f1)";;
31+
*) OS_HASH="$(shasum -a 256 /etc/lsb-release | cut -d' ' -f1)";;
32+
esac
33+
PYTHON_HASH="$(python --version | shasum -a 256 | cut -d' ' -f1)"
3134
FINAL_HASH="$(echo "$PWD:$FILES_HASH:$OS_HASH:$PYTHON_HASH" | shasum -a 256 | cut -d' ' -f1)"
3235
echo key="${RUNNER_OS}-${RUNNER_ARCH}-${{ inputs.platform }}-${FINAL_HASH}" | tee -a "$GITHUB_OUTPUT"
3336

src/platform/silabs/PlatformManagerImpl.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ namespace DeviceLayer {
4747
PlatformManagerImpl PlatformManagerImpl::sInstance;
4848

4949
#if defined(SL_MBEDTLS_USE_TINYCRYPT)
50-
sys_mutex_t PlatformManagerImpl::rngMutexHandle = NULL;
50+
osMutexId_t PlatformManagerImpl::rngMutexHandle = nullptr;
5151

5252
int PlatformManagerImpl::uECC_RNG_Function(uint8_t * dest, unsigned int size)
5353
{
54-
sys_mutex_lock(&rngMutexHandle);
54+
osMutexAcquire(rngMutexHandle, osWaitForever);
5555
int res = (chip::Crypto::DRBG_get_bytes(dest, size) == CHIP_NO_ERROR) ? size : 0;
56-
sys_mutex_unlock(&rngMutexHandle);
56+
osMutexRelease(rngMutexHandle);
5757

5858
return res;
5959
}
@@ -97,7 +97,8 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void)
9797
ReturnErrorOnFailure(chip::Crypto::add_entropy_source(app_entropy_source, NULL, 16));
9898
#endif // !SLI_SI91X_MCU_INTERFACE
9999
/* Set RNG function for tinycrypt operations. */
100-
VerifyOrExit(sys_mutex_new(&rngMutexHandle) == ERR_OK, err = CHIP_ERROR_NO_MEMORY);
100+
rngMutexHandle = osMutexNew(nullptr);
101+
VerifyOrExit((&rngMutexHandle != nullptr), err = CHIP_ERROR_NO_MEMORY);
101102
uECC_set_rng(PlatformManagerImpl::uECC_RNG_Function);
102103
#endif // SL_MBEDTLS_USE_TINYCRYPT
103104

src/platform/silabs/PlatformManagerImpl.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION
2929
#include "wfx_host_events.h"
3030
#endif
31+
#include <cmsis_os2.h>
3132

3233
namespace chip {
3334
namespace DeviceLayer {
@@ -45,7 +46,7 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener
4546
// Since the RNG callback will be called from multiple threads,
4647
// use this mutex to lock/unlock the call to Matter RNG API, which
4748
// uses some global variables.
48-
static sys_mutex_t rngMutexHandle;
49+
static osMutexId_t rngMutexHandle;
4950

5051
// Callback used by tinycrypt to generate random numbers.
5152
// It must be set before calling any sign operations,

src/platform/silabs/SiWx917/wifi/wfx_host_events.h

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "wfx_msgs.h"
2424

2525
/* LwIP includes. */
26-
#include "lwip/apps/httpd.h"
2726
#include "lwip/ip_addr.h"
2827
#include "lwip/netif.h"
2928
#include "lwip/netifapi.h"

src/platform/silabs/efr32/wifi/wfx_host_events.h

-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ typedef struct __attribute__((__packed__)) sl_wfx_mib_req_s
117117
#endif /* WF200 */
118118

119119
/* LwIP includes. */
120-
#include "lwip/apps/httpd.h"
121120
#include "lwip/ip_addr.h"
122121
#include "lwip/netif.h"
123122
#include "lwip/netifapi.h"

0 commit comments

Comments
 (0)