summaryrefslogtreecommitdiff
path: root/src/apm.c
Commit message (Collapse)AuthorAgeFilesLines
* apm: Remove old Bochs mechanism for shutdown/suspend/standby.Kevin O'Connor2014-04-071-28/+6
| | | | | | | | | Remove the old mechanism that used port 0x8900 to send apm signals. Recent versions of QEMU no longer support this port. Bochs and QEMU only ever supported shutdown anyway, and shutdown is already available via an ACPI mechanism. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Remove ioport.h; disperse its contents to other header files.Kevin O'Connor2013-09-281-1/+1
| | | | | | | Move the inb(), insb(), etc. code from ioport.h to x86.h. Move the PORT_* definitions to their appropriate hardware files. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move fw/acpi.h to std/acpi.h.Kevin O'Connor2013-09-181-1/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move function definitions for output.c from util.h to new file output.h.Kevin O'Connor2013-09-181-4/+5
| | | | | | Also, sort the order of include files in the c files. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move stacks.c definitions from util.h to new file stacks.h.Kevin O'Connor2013-09-181-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Move code cenetered around firmware initialization to src/fw/Kevin O'Connor2013-09-021-2/+2
| | | | | | Move many C files from the src/ directory to the new src/fw/ directory. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* apm: fix shutdownGerd Hoffmann2013-08-081-0/+5
| | | | | | | | | | | | | | | | | | Qemu commit 9ee59f3 removed the bochs bios apm interface emulation at port 0x8900. That broke poweroff via APM. Fix it by powering off the machine using the acpi pm control register. Old code is left in, so seabios wil try both poweroff methods. Cleaning that eventually up is left for another patch, after checking it isn't needed. Qemu never implemented "Standby" and "Suspend", only "Shutdown", so it looks like there might be non-qemu use cases (bochs probably). Easiest way to test this is the syslinux poweroff module; modern linux distros usually have CONFIG_APM turned off. Reported-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Consistently use CONFIG_COREBOOT, CONFIG_QEMU, and runningOnXen().Kevin O'Connor2013-02-121-1/+2
| | | | | | | | | | | | | | | | | | | | | CONFIG_QEMU means compile to start from QEMU (and possibly Xen/KVM/Bochs) and definitely running under QEMU (or Xen/KVM/Bochs). CONFIG_COREBOOT means compile for coreboot and definitely running under coreboot. Places that used CONFIG_COREBOOT to mean "running on real hardware" have been changed to use !CONFIG_QEMU. CONFIG_QEMU_HARDWARE enables support for some virtual hardware devices even if QEMU didn't start SeaBIOS. usingXen() is replaced by runningOnXen(). runningOnQEMU() is added to hardware devices that are only safe to access when we are sure we are running under QEMU (or Xen/KVM/Bochs). Neither the coreboot nor the csm code currently enable runningOnQEMU, but future patches may. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Minor - remove extra include from apm.c.Kevin O'Connor2012-06-131-1/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Don't restrict VISIBLEx C functions to only x mode.Kevin O'Connor2012-05-281-9/+2
| | | | | | | | Since SeaBIOS has been updated to use "_cfuncx_" prefixes when calling cross-mode C functions, there is no reason to restrict an exported C function to only the given mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Rename wait_irq to yield_toirq.Kevin O'Connor2012-05-281-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Rename the apm, pcibios, and elf entry points.Kevin O'Connor2011-07-101-4/+4
| | | | | | | Use a more consistent naming that matches entry_xxx to handle_xxx where possible. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Try to hard-reboot on rerun of post even on emulators.Kevin O'Connor2010-09-151-4/+10
| | | | | | | | Extend the hard-reboot logic to qemu and kvm. On qemu, a reboot will not reset the memory settings for 0xc0000-0xfffff, so copy that memory area manually before rebooting. Unfortunately, kvm does not keep a pristine copy of the BIOS at 0xffff0000, so detect that case and shutdown the machine.
* Reduce #ifs by weeding out some cross-chunk function definitions.Kevin O'Connor2010-01-031-2/+0
| | | | | | | | | | Reduce the need for placing #if guards around functions that are marked as VISIBLE in another code chunk by declaring the functions as "weak" when they are not needed. It's still necessary to ensure that no C code references the data from a different chunk (or an -fwhole-program compile might try to keep a local reference).
* Be sure to add "void" to all function prototypes that take no args.Kevin O'Connor2010-01-031-2/+2
| | | | Omitting "void" leads to a K&R style declaration which was not intended.
* Implement native 32bit APM support.Kevin O'Connor2010-01-011-1/+17
| | | | | Add APM code to 32bit segmented code. Use 32bit APM code instead of jumping into 16bit mode.
* Distinguish between debug reports for unimplemented vs invalid calls.Kevin O'Connor2009-12-131-3/+3
| | | | | | | | Don't use "fail" in the debug output - as this confuses users. When reporting on an invalid parameter - use the word "invalid". When reporting on an unimplemented call - state it is unimplemented. Add separate debug levels for unimplemented vs invalid calls. Also, increase the debug level of several entry points.
* Minor - use wait_irq() instead of irq_enable()/hlt() in apm.Kevin O'Connor2009-12-101-3/+2
|
* Change license from GPLv3 to LGPLv3.Kevin O'Connor2009-01-151-1/+1
| | | | | | | | Change license of contributions from Kevin O'Connor from GPLv3 to LGPLv3 (or later). Since the work as a whole is based on Kevin's contributions and the "bochs bios" which has a license of LGPL (v2 or later), this effectively makes the work as a whole available under LGPLv3 (or later).
* Implement GET/SET_GLOBAL(...) instead of using GET/SET_VAR(CS, ...)Kevin O'Connor2008-12-131-1/+2
|
* Extract 'struct bregs' out of biosvar.h; clean up header includes.Kevin O'Connor2008-07-041-1/+2
|
* APM fixes; don't save/clear/restore %esp high bits.Kevin O'Connor2008-06-071-2/+11
| | | | | | | | Don't worry about %esp high bits - 16bit protected mode may require the bits to be set. It would be very odd to call into the bios with junk in %esp high bits. Fix 32bit apm entry point. Don't log apm calls 155306/15530b.
* Support config option to disable APM BIOS calls.Kevin O'Connor2008-05-261-0/+5
| | | | New option CONFIG_APMBIOS can be used to disable apm.
* Improve control of debug messages.Kevin O'Connor2008-05-241-1/+1
| | | | | | Rename BX_INFO() to dprintf() and add a "severity level" parameter. Add CONFIG_DEBUG_LEVEL compile option to control debug verbosity. Add more debug info to init steps of post.c.
* Initial support for coreboot.Kevin O'Connor2008-05-181-0/+5
| | | | | | | Add new option for targetting a coreboot payload. When in coreboot mode, configure out those parts of the code that wont work on real hardware. Don't include cmos.h in files that don't need it.
* Minor cleanups.Kevin O'Connor2008-05-061-1/+1
| | | | | Several minor comment improvements. Rearrange some definitions to make them more clear.
* Minor cleanups.Kevin O'Connor2008-03-151-0/+1
| | | | | Remove some redundant code from Makefile. Improve a couple of comments.
* Replace debug_exit calls with debug info while setting a failure.Kevin O'Connor2008-03-091-15/+15
| | | | | | Calling debug_exit at the end of a call doesn't help much - several of the registers are already clobbered at this point. It also increases stack usage because it prevents call tail optimization in many places.
* Enhance APM support.Kevin O'Connor2008-03-081-6/+10
| | | | | Create and register protected mode interfaces. Still needs more testing.
* Add initial support for apmbios code.Kevin O'Connor2008-03-051-0/+193