Felix Held | 4667322 | 2020-04-04 02:37:04 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Felix Held | 4667322 | 2020-04-04 02:37:04 +0200 | [diff] [blame] | 2 | |
| 3 | #include <cpu/x86/post_code.h> |
| 4 | |
Raul E Rangel | ec26428 | 2020-06-04 16:42:50 -0600 | [diff] [blame^] | 5 | .global bootblock_resume_entry |
| 6 | bootblock_resume_entry: |
| 7 | post_code(0xb0) |
| 8 | |
| 9 | /* Get an early timestamp */ |
| 10 | rdtsc |
| 11 | movd %eax, %mm1 |
| 12 | movd %edx, %mm2 |
| 13 | |
| 14 | /* Fall through to bootblock_pre_c_entry */ |
| 15 | |
Felix Held | 4667322 | 2020-04-04 02:37:04 +0200 | [diff] [blame] | 16 | /* |
| 17 | * on entry: |
| 18 | * mm0: BIST (ignored) |
| 19 | * mm2_mm1: timestamp at bootblock_protected_mode_entry |
| 20 | */ |
| 21 | |
| 22 | .global bootblock_pre_c_entry |
| 23 | bootblock_pre_c_entry: |
| 24 | post_code(0xa0) |
| 25 | |
| 26 | movl $_eearlyram_stack, %esp |
| 27 | |
| 28 | /* Align the stack and keep aligned for call to bootblock_c_entry() */ |
| 29 | and $0xfffffff0, %esp |
| 30 | sub $8, %esp |
| 31 | |
| 32 | movd %mm2, %eax |
| 33 | pushl %eax /* tsc[63:32] */ |
| 34 | movd %mm1, %eax |
| 35 | pushl %eax /* tsc[31:0] */ |
| 36 | |
| 37 | post_code(0xa2) |
| 38 | |
| 39 | call bootblock_c_entry |
| 40 | /* Never reached */ |
| 41 | |
| 42 | .halt_forever: |
| 43 | post_code(POST_DEAD_CODE) |
| 44 | hlt |
| 45 | jmp .halt_forever |