summaryrefslogtreecommitdiff
path: root/src/entryfuncs.S
Commit message (Collapse)AuthorAgeFilesLines
* Use an aligned stack offset when entering on the extra stackKevin O'Connor2014-11-121-0/+2
| | | | | | | | | | | | | | | | The size of 'struct bregs' is not evenly divisible by four and where the assembler placed a 'struct bregs' on the extra stack as part of entering into the C functions it caused the C functions to run with a non-aligned stack. It's technically not correct to use an unaligned stack and it is certainly less efficient. This patch avoids using BREGS_size (the sizeof struct bregs) and instead introduces PUSHBREGS_size (the size of the general purpose registers in struct bregs) in the assembler. Where the code actually did use the %cs:%ip and flags, an extra 8 (instead of 6) bytes are added to maintain a sane alignment. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Remove unused macro ENTRY_STKevin O'Connor2014-10-271-23/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Create assembler macros for saving and restoring 'struct bregs'Kevin O'Connor2014-10-271-4/+40
| | | | | | | | | | | Create macros SAVEBREGS_POP_DSEAX and RESTOREBREGS_DSEAX for saving and restoring the cpu state. These are similar to the existing PUSHBREGS and POPBREGS macros. This also fixes a bug in __farcall16 which inadvertently restored %ds in %es and vice-versa. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Don't clobber %ax on ENTRY_INTO32 macroKevin O'Connor2014-10-271-3/+2
| | | | | | | There's no need to clobber %ax in ENTRY_INTO32. Now that %eax isn't clobbered, use ENTRY_INTO32 in entry_csm. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Use customized entry point for each type of build.Kevin O'Connor2014-06-111-6/+0
| | | | | | | | | | | | | | | Set an appropriate elf entry point (entry_elf, entry_csm, reset_vector) for each type of build (coreboot, csm, qemu). Use that entry point when determining which sections to keep. Also, remove the '.export.' mechanism to keep a section in the final binary - it is no longer used. This allows the build to slightly reduce the overall size as entry_elf is no longer needed on non-coreboot builds and entry_csm is no longer needed on non-csm builds. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Add macros for pushing and popping struct bregsDavid Woodhouse2013-02-051-45/+29
| | | | | | | I want to do this too, and can't bring myself to introduce yet another copy. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Acked-by: Marc Jones <marc.jones@se-eng.com>
* Don't pass return address to transition(32,16,16big) on stack.Kevin O'Connor2010-11-251-1/+1
| | | | | | It's difficult to have a uniform view of the stack when transition modes, so pass the return address in a register. As a result, the transition functions only access memory via the %cs selector now.
* Do garbage collection of unused sections.Kevin O'Connor2009-06-101-0/+6
| | | | | | | | | | | Implement -ffunction-sections and -fdata-sections in both 32bit and 16bit code. Make sure all sections have unique names (even asm and discarded sections). Enhance tools/layoutrom.py script to find all sections reachable from exported 16bit code - prune all other sections. Mark sections with "export" if they can be visible outside of code - these sections wont be dropped when pruning unused sections.
* Support %ebp register in 'struct bregs'.Kevin O'Connor2009-05-161-2/+8
| | | | | | Save/restore %ebp on irq entry. Support saving and restoring %ebp on call16. Enable display of %ebp in register dumps.
* Define unified entry points for irq handlers.Kevin O'Connor2009-05-161-27/+54
| | | | | | The irq entry points now push the handler address and jump to a function that does parameter setup. This reduces the code size because the entry setup isn't repeated for every handler.
* Move assembler entry macros in romlayout.S into new file entryfuncs.S.Kevin O'Connor2009-05-061-0/+134
This allows the entry macros to be used in other assembler code.