/** System shutdown thread. * @param _action Action to perform once the system has been shut down. * @param arg2 Unused. */ static void shutdown_thread_entry(void *_action, void *arg2) { int action = (int)((ptr_t)_action); thread_wire(curr_thread); thread_disable_preempt(); kprintf(LOG_NOTICE, "system: terminating all processes...\n"); process_shutdown(); kprintf(LOG_NOTICE, "system: unmounting filesystems...\n"); fs_shutdown(); #if CONFIG_SMP kprintf(LOG_NOTICE, "system: shutting down other CPUs...\n"); smp_call_broadcast(shutdown_call_func, NULL, 0); #endif switch(action) { case SHUTDOWN_REBOOT: kprintf(LOG_NOTICE, "system: rebooting...\n"); platform_reboot(); break; case SHUTDOWN_POWEROFF: kprintf(LOG_NOTICE, "system: powering off...\n"); platform_poweroff(); break; } kprintf(LOG_NOTICE, "system: halted.\n"); arch_cpu_halt(); }
void arch_auto_shutdown() { irq_disable(); timer_shutdown(); #if 0 snd_shutdown(); hardware_shutdown(); net_shutdown(); pvr_shutdown(); fs_dcload_shutdown(); fs_vmu_shutdown(); fs_iso9660_shutdown(); #endif fs_ramdisk_shutdown(); fs_romdisk_shutdown(); fs_shutdown(); thd_shutdown(); }
static int lua_net_shutdown(lua_State * L) { int n; if (!init) { goto ok; } if (lwipinit) { httpfs_shutdown(); tcpfs_shutdown(); lwip_shutdown_all(); lwipinit = 0; } if (netinit) { fs_shutdown(); net_input_set_target(0); net_shutdown(); net_driver_close(); netinit = 0; } dma_test(-1); init = 0; printf("net_driver LUA shutdown.\n"); ok: lua_settop(L,0); lua_pushnumber(L,1); return 1; }