All pastes #574367 Raw Edit

Mine

public text v1 · immutable
#574367 ·published 2007-06-18 15:07 UTC
rendered paste body
case SD_HOTSWAP:
            if (card_detect_target())
            {
                sleep(HZ/10);
                spinlock_lock(&sd_mtx);
                card_info[1].initialized = false;
                spinlock_unlock(&sd_mtx);
                disk_mount(1); /* mount SD-CARD */
                queue_broadcast(SYS_HOTSWAP_INSERTED, 0);
            }
            else
            {
                spinlock_lock(&sd_mtx);
                card_info[1].initialized = false;
                spinlock_unlock(&sd_mtx);
                disk_unmount(1); /* release "by force" */
                queue_broadcast(SYS_HOTSWAP_EXTRACTED, 0);
            }

            queue_broadcast(SYS_FS_CHANGED, 0);
            break;