mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2026-01-28 01:47:21 +01:00
Merge 21e00db871 into 9c6713a8ed
This commit is contained in:
commit
1be50702fd
3 changed files with 7 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue