mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-11-04 11:48:50 +00:00
Now, trampline code is used by both AP start and BSP s3 resume. For s3 resume, ACPI (5.2.10 Firmware ACPI Control Structure (FACS). table 5-37) defines the real mode address should be set to: realmode address = CS(waking_vec >> 4): IP(wakeing_vec & 0x000F) But not all bootloader (like ABL) follow ACPI definition about the CS:IP setup before jump to trampline code for S3 resume. To handle all these cases, a long jmp is issued at very beginning of trampline code to fixup the CS:IP setup. After the fixup, the CS is set to: (waking_vect >> 4), the IP is set to: (the_address_ of_next_instruction_of_long_jmp & 0xF). Which is aligned with ACPI definition. Another thing is that we can't calculate the fixup CS and IP value. The reason is related with limitations of real mode (can't get current ip address without stack). So we calculate the CS and IP when preparing the trampline code. Signed-off-by: Zheng Gen <gen.zheng@intel.com> Signed-off-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com> Acked-by: Eddie Dong <Eddie.dong@intel.com>