HV:CPU: Add 'U/UL' for unsigned const value

According to MISRA C:2012, suffix 'U/UL' shall be for
unsigned const value, the member of enum variable should
not be used to compare with integer variable.

Add 'U/UL' for unsigned const value in the CPU module;
Use Macro insteading of enum feature_word since the member
of feature_word is used to compare with integer variable;
Use hex number insteading of Macro in the assembly code.

V1-->V2:

        Update the suffix of some constant value as 'UL'
        according to its'storage variable;
        Split MACRO updates used in the assembly code
	in other patch.

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Xiangyang Wu
2018-07-06 13:49:41 +08:00
committed by wenlingz
parent 21f0bddff8
commit 474e9af216
8 changed files with 191 additions and 194 deletions

View File

@@ -89,12 +89,12 @@
#define CPUID_TLB 2
#define CPUID_SERIALNUM 3
#define CPUID_EXTEND_FEATURE 7
#define CPUID_MAX_EXTENDED_FUNCTION 0x80000000
#define CPUID_EXTEND_FUNCTION_1 0x80000001
#define CPUID_EXTEND_FUNCTION_2 0x80000002
#define CPUID_EXTEND_FUNCTION_3 0x80000003
#define CPUID_EXTEND_FUNCTION_4 0x80000004
#define CPUID_EXTEND_ADDRESS_SIZE 0x80000008
#define CPUID_MAX_EXTENDED_FUNCTION 0x80000000U
#define CPUID_EXTEND_FUNCTION_1 0x80000001U
#define CPUID_EXTEND_FUNCTION_2 0x80000002U
#define CPUID_EXTEND_FUNCTION_3 0x80000003U
#define CPUID_EXTEND_FUNCTION_4 0x80000004U
#define CPUID_EXTEND_ADDRESS_SIZE 0x80000008U
static inline void __cpuid(uint32_t *eax, uint32_t *ebx,
@@ -112,7 +112,7 @@ static inline void cpuid(uint32_t leaf,
uint32_t *ecx, uint32_t *edx)
{
*eax = leaf;
*ecx = 0;
*ecx = 0U;
__cpuid(eax, ebx, ecx, edx);
}