mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-24 10:17:28 +00:00
HV: treewide: unify the type of bit-field members
Qualified or unqualified int or bool are the only types allowed for bit-field members in C99, and MISRA C further forbids using plain int. Use uint32_t (which is equivalent to unsigned int) for all bit-field members. Signed-off-by: Junjie Mao <junjie.mao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -121,8 +121,8 @@
|
||||
|
||||
#ifndef LOCORE
|
||||
|
||||
#define PAD3 int: 32; int: 32; int: 32
|
||||
#define PAD4 int: 32; int: 32; int: 32; int: 32
|
||||
#define PAD3 uint32_t: 32; uint32_t: 32; uint32_t: 32
|
||||
#define PAD4 uint32_t: 32; uint32_t: 32; uint32_t: 32; uint32_t: 32
|
||||
|
||||
struct lapic_reg {
|
||||
uint32_t val; PAD3;
|
||||
|
@@ -12,24 +12,24 @@
|
||||
union mtrr_cap_reg {
|
||||
uint64_t value;
|
||||
struct {
|
||||
uint64_t vcnt:8;
|
||||
uint64_t fix:1;
|
||||
uint64_t res0:1;
|
||||
uint64_t wc:1;
|
||||
uint64_t res1:21;
|
||||
uint64_t res2:32;
|
||||
uint32_t vcnt:8;
|
||||
uint32_t fix:1;
|
||||
uint32_t res0:1;
|
||||
uint32_t wc:1;
|
||||
uint32_t res1:21;
|
||||
uint32_t res2:32;
|
||||
} bits;
|
||||
};
|
||||
|
||||
union mtrr_def_type_reg {
|
||||
uint64_t value;
|
||||
struct {
|
||||
uint64_t type:8;
|
||||
uint64_t res0:2;
|
||||
uint64_t fixed_enable:1;
|
||||
uint64_t enable:1;
|
||||
uint64_t res1:20;
|
||||
uint64_t res2:32;
|
||||
uint32_t type:8;
|
||||
uint32_t res0:2;
|
||||
uint32_t fixed_enable:1;
|
||||
uint32_t enable:1;
|
||||
uint32_t res1:20;
|
||||
uint32_t res2:32;
|
||||
} bits;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user