Skip to content

Commit adddf51

Browse files
binbinwu1lijinxia
authored andcommitted
hv: move define of struct cpu_gp_regs to a separate headfile
EFI stub code need to reference to the struct cpu_gp_regs, which is currently defined in vcpu.h, however include vcpu.h in EFI stub code will include other header files not requried by EFI stub code. After moving the define of struct cpu_gp_regs to a separate headfile, the file can be included in EFI stub code without other header files. Signed-off-by: Binbin Wu <binbin.wu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 5a5b2a1 commit adddf51

File tree

2 files changed

+32
-22
lines changed

2 files changed

+32
-22
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (C) 2018 Intel Corporation. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#ifndef _VGPR_H_
8+
#define _VGPR_H_
9+
10+
/* General-purpose register layout aligned with the general-purpose register idx
11+
* when vmexit, such as vmexit due to CR access, refer to SMD Vol.3C 27-6.
12+
*/
13+
struct cpu_gp_regs {
14+
uint64_t rax;
15+
uint64_t rcx;
16+
uint64_t rdx;
17+
uint64_t rbx;
18+
uint64_t rsp;
19+
uint64_t rbp;
20+
uint64_t rsi;
21+
uint64_t rdi;
22+
uint64_t r8;
23+
uint64_t r9;
24+
uint64_t r10;
25+
uint64_t r11;
26+
uint64_t r12;
27+
uint64_t r13;
28+
uint64_t r14;
29+
uint64_t r15;
30+
};
31+
#endif

hypervisor/include/arch/x86/guest/vcpu.h

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#ifndef ASSEMBLER
5151

5252
#include <guest.h>
53+
#include <gpr.h>
5354

5455
enum vcpu_state {
5556
VCPU_INIT,
@@ -66,28 +67,6 @@ enum vm_cpu_mode {
6667
CPU_MODE_64BIT, /* IA-32E mode (CS.L = 1) */
6768
};
6869

69-
/* General-purpose register layout aligned with the general-purpose register idx
70-
* when vmexit, such as vmexit due to CR access, refer to SMD Vol.3C 27-6.
71-
*/
72-
struct cpu_gp_regs {
73-
uint64_t rax;
74-
uint64_t rcx;
75-
uint64_t rdx;
76-
uint64_t rbx;
77-
uint64_t rsp;
78-
uint64_t rbp;
79-
uint64_t rsi;
80-
uint64_t rdi;
81-
uint64_t r8;
82-
uint64_t r9;
83-
uint64_t r10;
84-
uint64_t r11;
85-
uint64_t r12;
86-
uint64_t r13;
87-
uint64_t r14;
88-
uint64_t r15;
89-
};
90-
9170
struct segment_sel {
9271
uint16_t selector;
9372
uint64_t base;

0 commit comments

Comments
 (0)