[SeaBIOS] [PATCH 00/12] Support using SMM for 32bit trampolining

Kevin O'Connor kevin at koconnor.net
Tue Sep 30 20:38:34 CEST 2014

This series reworks the internal 16bit <-> 32bit trampolining that the
SeaBIOS code uses during runtime, and it adds support for using System
Management Mode (SMM) for performing a more correct switch to 32bit
mode during runtime.  Currently, QEMU v2.1 in TCG mode is needed in
order for the SMM handler to be utilized.

This series was inspired by the desire to move more hardware
processing to 32bit mode.  This change, however, does not move any
additional code to 32bit.  The series may still be useful though when
running some existing 32bit drivers (eg, ahci and xhci).

The series is also available at:

With the completion of this series, the full 32bit hardware branch is
down to only three patches.  For reference, that branch is at:


Kevin O'Connor (12):
  Move stack hop code below call32/call16 code in stacks.c
  Add need_hop_back() call that determines if stack_hop_back is needed
  Update invoke_mouse_handler() to use need_hop_back()
  Update stack_hop_back() to jump to 16bit mode if called in 32bit mode.
  Track when entering via call32() and use the same mode for
  Simplify farcall16 code
  Update reset() to use call16_back()
  build: Support declaring 32bit C functions that must reside in the
  Move call16() functions from romlayout.S to inline assembler in
  Break up call32() into call32() and call32_sloppy()
  Fully restore 16bit state during call16_sloppy()
  Implement call32 mechanism using SMIs.

 scripts/layoutrom.py |  16 +-
 src/Kconfig          |   4 +
 src/fw/smm.c         |  46 ++++-
 src/mouse.c          |  15 +-
 src/romlayout.S      |  42 -----
 src/stacks.c         | 510 ++++++++++++++++++++++++++++++++++++++-------------
 src/stacks.h         |  23 ++-
 src/types.h          |   4 +
 8 files changed, 477 insertions(+), 183 deletions(-)


More information about the SeaBIOS mailing list