This commit is contained in:
Luke Wren 2026-01-09 07:08:31 +07:00 committed by GitHub
commit 1be50702fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 5 deletions

View file

@ -18,10 +18,10 @@ void __weak runtime_init_mutex(void) {
static_assert(!(sizeof(recursive_mutex_t)&3), "");
static_assert(!offsetof(mutex_t, core), "");
static_assert(!offsetof(recursive_mutex_t, core), "");
extern lock_core_t __mutex_array_start;
extern lock_core_t __mutex_array_start[];
extern lock_core_t __mutex_array_end;
for (lock_core_t *l = &__mutex_array_start; l < &__mutex_array_end; ) {
for (lock_core_t *l = &__mutex_array_start[0]; l < &__mutex_array_end; ) {
if (l->spin_lock) {
assert(1 == (uintptr_t)l->spin_lock); // indicator for a recursive mutex
recursive_mutex_t *rm = (recursive_mutex_t *)l;
@ -225,4 +225,4 @@ void __time_critical_func(recursive_mutex_exit)(recursive_mutex_t *mtx) {
} else {
spin_unlock(mtx->core.spin_lock, save);
}
}
}

View file

@ -112,6 +112,7 @@ alarm_pool_t *alarm_pool_create_on_timer(alarm_pool_timer_t *timer, uint hardwar
alarm_pool_t *pool = (alarm_pool_t *) malloc(sizeof(alarm_pool_t));
if (pool) {
pool->entries = (alarm_pool_entry_t *) calloc(max_timers, sizeof(alarm_pool_entry_t));
if (!pool->entries) panic("Failed to allocate alarm pool entries");
ta_hardware_alarm_claim(timer, hardware_alarm_num);
alarm_pool_post_alloc_init(pool, timer, hardware_alarm_num, max_timers);
}
@ -122,6 +123,7 @@ alarm_pool_t *alarm_pool_create_on_timer_with_unused_hardware_alarm(alarm_pool_t
alarm_pool_t *pool = (alarm_pool_t *) malloc(sizeof(alarm_pool_t));
if (pool) {
pool->entries = (alarm_pool_entry_t *) calloc(max_timers, sizeof(alarm_pool_entry_t));
if (!pool->entries) panic("Failed to allocate alarm pool entries");
alarm_pool_post_alloc_init(pool, timer, (uint) ta_hardware_alarm_claim_unused(timer, true), max_timers);
}
return pool;
@ -567,4 +569,4 @@ int64_t remaining_alarm_time_us(alarm_id_t alarm_id) {
int32_t remaining_alarm_time_ms(alarm_id_t alarm_id) {
return alarm_pool_remaining_alarm_time_ms(alarm_pool_get_default(), alarm_id);
}
#endif
#endif

View file

@ -239,7 +239,7 @@ static uint64_t capture_additional_rosc_samples(uint n) {
#endif
static void initialise_rand(void) {
rng_128_t local_rng_state = local_rng_state;
rng_128_t local_rng_state = {0};
uint which = 0;
#if PICO_RAND_SEED_ENTROPY_SRC_RAM_HASH
ram_hash = sdbm_hash64_sram(ram_hash);