Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/common/pico_sync/mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -225,4 +225,4 @@ void __time_critical_func(recursive_mutex_exit)(recursive_mutex_t *mtx) {
} else {
spin_unlock(mtx->core.spin_lock, save);
}
}
}
4 changes: 3 additions & 1 deletion src/common/pico_time/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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;
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/rp2_common/pico_multicore/multicore.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ static inline void clear_claimed_bit(uint8_t *bits, uint bit_index) {
static bool multicore_doorbell_claim_under_lock(uint doorbell_num, uint core_mask, bool required) {
static_assert(NUM_CORES == 2, "");
uint claimed_cores_for_doorbell = (uint) (is_bit_claimed(doorbell_claimed[0], doorbell_num) |
(is_bit_claimed(doorbell_claimed[1], doorbell_num + 1u) << 1));
(is_bit_claimed(doorbell_claimed[1], doorbell_num) << 1));
if (claimed_cores_for_doorbell & core_mask) {
if (required) {
panic( "Multicore doorbell %d already claimed on core mask 0x%x; requested core mask 0x%x\n",
Expand Down
2 changes: 1 addition & 1 deletion src/rp2_common/pico_rand/rand.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading