Skip to content

Commit f1f5c43

Browse files
committed
refactor(vmm): Rename constants for register modification
Rename the following constants to make it clear which register the bit belongs to: - `TSC_DEADLINE_BITINDEX` => `ECX_TSC_DEADLINE_BITINDEX` - `HYPERVISOR_BITINDEX` => `ECX_HYPERVISOR_BITINDEX` Signed-off-by: Takahiro Itazuri <[email protected]>
1 parent 87c78b5 commit f1f5c43

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/vmm/src/cpu_config/x86_64/cpuid/normalize.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,14 @@ impl super::Cpuid {
206206
cpu_index: u8,
207207
cpu_count: u8,
208208
) -> Result<(), FeatureInformationError> {
209-
/// Flush a cache line size.
209+
// Flush a cache line size.
210210
const EBX_CLFLUSH_CACHELINE: u32 = 8;
211211

212212
// TSC-Deadline.
213-
const TSC_DEADLINE_BITINDEX: u8 = 24;
213+
const ECX_TSC_DEADLINE_BITINDEX: u8 = 24;
214214

215-
/// CPU is running on a hypervisor.
216-
const HYPERVISOR_BITINDEX: u8 = 31;
215+
// CPU is running on a hypervisor.
216+
const ECX_HYPERVISOR_BITINDEX: u8 = 31;
217217

218218
let leaf_1 = self
219219
.get_mut(&CpuidKey::leaf(0x1))
@@ -223,10 +223,10 @@ impl super::Cpuid {
223223
// operation using a TSC deadline value.
224224
//
225225
// tsc_deadline: 24,
226-
set_bit(&mut leaf_1.result.ecx, TSC_DEADLINE_BITINDEX, true);
226+
set_bit(&mut leaf_1.result.ecx, ECX_TSC_DEADLINE_BITINDEX, true);
227227

228228
// Hypervisor bit
229-
set_bit(&mut leaf_1.result.ecx, HYPERVISOR_BITINDEX, true);
229+
set_bit(&mut leaf_1.result.ecx, ECX_HYPERVISOR_BITINDEX, true);
230230

231231
// Initial APIC ID.
232232
//

0 commit comments

Comments
 (0)