void control_wait_response() { // Get current interrupts by disabling temporarily uint32_t restore = or1k_interrupts_disable(); // Enable all interrupts or1k_interrupts_enable(); // Wait until the reply arrived while (ctrl_request.done == 0) { } // Restore previous state of interrupts or1k_interrupts_restore(restore); }
void __malloc_unlock(struct _reent *ptr) { // Decrement counter. The lock may be unlocked recursively _malloc_lock_cnt--; // If this was the last recursive unlock call if(_malloc_lock_cnt == 0){ // reset owner _malloc_lock_own = 0; // Restore IEE flag or1k_interrupts_restore(_malloc_lock_restore_interrupts); // Restore TEE flag or1k_timer_restore(_malloc_lock_restore_timer); } return; }