aboutsummaryrefslogtreecommitdiff
path: root/src/stacks.h
AgeCommit message (Collapse)AuthorFilesLines
2021-09-24stacks.h: Provide replacement for thread functions when !CONFIG_THREADSHelge Deller1-2/+15
Rearrange the thread functions and provide wrappers which evaluates to no code when !CONFIG_THREADS. The function call16_int() isn't used on PA-RISC, so replace it by an empty function call. Signed-off-by: Helge Deller <deller@gmx.de>
2015-10-15stacks: Use macro wrappers for call32() and stack_hop_back()Kevin O'Connor1-5/+20
The C code only uses _cfuncX_ prefixes for parameters to the call32(), stack_hop_back(), and call32_params() functions. It's simpler to use macro wrappers around those functions which provide the required prefix. This also changes the parameter order of stack_hop() and stack_hop_back() to use the more natural (func, params) ordering. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2015-07-14Don't enable interrupts prior to IVT and PIC setupKevin O'Connor1-1/+1
The machine may crash if an interrupt occurs prior to the setup of the interrupt vector table (IVT) and programmable interrupt controller (PIC). This patch makes sure that interrupts remain disabled until these components are setup. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-15Implement call32 mechanism using SMIs.Kevin O'Connor1-0/+5
Add support for jumping into 32bit mode using a System Management Mode (SMM) handler. When available, this allows SeaBIOS to transition to 32bit mode even when called in vm86 mode. It will also prevent the clobbering of the segment registers. Currently, the SMM mode is only supported in QEMU when running in TCG mode. Also, QEMU v2.1 (or later) is needed for it to work when in vm86 mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-10-11Simplify farcall16 codeKevin O'Connor1-3/+3
With this change, farcall16() is only used for external API calls and is only invoked from a 32bit mode entered directly via transition32. farcall16big() is also only used for external API calls and is only invoked from a 32bit mode entered directly via transition32. call16_int() now calls _farcall16() directly, and it will use normal 16bit mode or big real mode as required. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-09-30Update stack_hop_back() to jump to 16bit mode if called in 32bit mode.Kevin O'Connor1-1/+1
Also, update callers to rely on this feature. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-09-30Add need_hop_back() call that determines if stack_hop_back is neededKevin O'Connor1-0/+10
Also, use need_hop_back() instead of on_extra_stack() in code that determines whether or not to call stack_hop_back(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-09-30Move stack hop code below call32/call16 code in stacks.cKevin O'Connor1-1/+1
This change is a just code movement. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-06-06Abstract reset call (and possible 16bit mode switch) into reset() function.Kevin O'Connor1-0/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-04-07Replace CONFIG_THREAD_OPTIONROMS with a runtime config setting.Kevin O'Connor1-0/+2
Replace the CONFIG_THREAD_OPTIONROMS option with the CBFS (or fw_cfg) file "etc/threads". This allows for the "threads during optionrom" capability to be enabled/disabled without requiring SeaBIOS to be recompiled. A value of "2" in this file will enable threads to run during option rom execution. This change also allows for all threads to be disabled via the same runtime config file. Setting the file to a value of "0" will cause SeaBIOS to perform all hardware initialization serially. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2014-01-29Add call32_params() helper function.Kevin O'Connor1-0/+1
Add helper function for calling 32bit functions with more than just one parameter. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2013-09-18Move stacks.c definitions from util.h to new file stacks.h.Kevin O'Connor1-0/+34
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>