void reset(void) { extern void acpi_reset_system(); #if !defined(__xpv) ushort_t *bios_memchk; /* * Can't use psm_map_phys or acpi_reset_system before the hat is * initialized. */ if (khat_running) { bios_memchk = (ushort_t *)psm_map_phys(0x472, sizeof (ushort_t), PROT_READ | PROT_WRITE); if (bios_memchk) *bios_memchk = 0x1234; /* bios memory check disable */ if (options_dip != NULL && ddi_prop_exists(DDI_DEV_T_ANY, ddi_root_node(), 0, "efi-systab")) { if (bootops == NULL) acpi_reset_system(); efi_reset(); } /* * The problem with using stubs is that we can call * acpi_reset_system only after the kernel is up and running. * * We should create a global state to keep track of how far * up the kernel is but for the time being we will depend on * bootops. bootops cleared in startup_end(). */ if (bootops == NULL) acpi_reset_system(); } pc_reset(); #else if (IN_XPV_PANIC()) { if (khat_running && bootops == NULL) { acpi_reset_system(); } pc_reset(); } (void) HYPERVISOR_shutdown(SHUTDOWN_reboot); panic("HYPERVISOR_shutdown() failed"); #endif /*NOTREACHED*/ }
void resetpc() { pc_reset(); // cpuspeed2=(AT)?2:1; // atfullspeed=0; ///* if (romset==ROM_AMI386 || romset==ROM_AMI486) */fullspeed(); shadowbios=0; }
void _exit(int rc) { // Sometimes the exit code panics which causes an infinite loop. // The real fix (?) is to pay proper attention to the panic // dependency in finalisers... if (!exiting) { exiting = 1; knit_fini(); } pc_reset(); }
/* * This overrides the _exit() function in libc. * If the serial console (or remote GDB) is being used, it waits * until all the data has cleared out of the FIFOs; if the VGA * display is being used (normal console), then it waits for a keypress. * When it is done, it calls pc_reset() to reboot the computer. */ static void our_exit(int rc) { extern oskit_addr_t return_address; #if 0 printf("_exit(%d) called; %s...\r\n", rc, return_address ? "returning to netboot" : "rebooting"); #endif if (enable_gdb) { /* Detach from the remote GDB. */ gdb_serial_exit(rc); #ifdef HAVE_DEBUG_REGS /* Turn off the debug registers. */ set_dr7(get_dr7() & ~(DR7_G0 | DR7_G1 | DR7_G2 | DR7_G3)); #endif } /* flush and wait for `_exit called` message */ oskit_stream_release(console); if (!serial_console) { /* This is so that the user has a chance to SEE the output */ //~ printf("Press a key to reboot"); //~ printf("hit dat shit yo."); //~ getchar(); } if (return_address) { /* * The cleanup needs to be done here instead of in the * returned-to code because the return address may not * be accessible with our current paging and segment * state. * The order is important here: paging must be disabled * after we reload the gdt. */ cli(); clts(); phys_mem_va = 0; linear_base_va = 0; base_gdt_init(); /* Reload all since we changed linear_base_va. */ base_cpu_load(); paging_disable(); ((void (*)(void))return_address)(); } else pc_reset(); }
/* * This overrides the _exit() function in libc. * If the serial console (or remote GDB) is being used, it waits * until all the data has cleared out of the FIFOs; if the VGA * display is being used (normal console), then it waits for a keypress. * When it is done, it calls pc_reset() to reboot the computer. */ static void our_exit(int rc) { printf("_exit(%d) called; rebooting...\n", rc); /* wait for GDB to finish receiving exit message */ if (enable_gdb) com_cons_flush(gdb_com_port); /* wait for `_exit called` message */ if (serial_console) com_cons_flush(cons_com_port); else { /* This is so that the user has a chance to SEE the output */ printf("Press a key to reboot"); getchar(); } pc_reset(); }
void resetpchard() { if (!modelchanged) device_close_all(); else modelchanged = 0; device_init(); midi_close(); midi_init(); timer_reset(); sound_reset(); mem_resize(); if (pcfirsttime) { fdc_init(); pcfirsttime = 0; } else fdc_hard_reset(); model_init(); video_init(); speaker_init(); // #ifdef USE_NETWORKING vlan_reset(); //NETWORK network_card_init(network_card_current); // #endif sound_card_init(sound_card_current); if (GUS) device_add(&gus_device); if (GAMEBLASTER) device_add(&cms_device); if (SSI2001) device_add(&ssi2001_device); if (voodoo_enabled) device_add(&voodoo_device); pc_reset(); resetide(); loadnvr(); // cpuspeed2 = (AT)?2:1; // atfullspeed = 0; // setpitclock(models[model].cpu[cpu_manufacturer].cpus[cpu].rspeed); shadowbios = 0; ali1429_reset(); keyboard_at_reset(); // output=3; #if __unix if (cdrom_drive == -1) cdrom_null_reset(); else #endif ioctl_reset(); }
Datum probabilistic_reset(PG_FUNCTION_ARGS) { pc_reset(((ProbabilisticCounter)PG_GETARG_BYTEA_P(0))); PG_RETURN_VOID(); }