Skip to content

Commit f18a02a

Browse files
jsun26intellijinxia
authored andcommitted
HV: misra cleanup for platform acpi info
- fix misra integral type violations; - change struct initilization style to make code more readable; Signed-off-by: Victor Sun <victor.sun@intel.com> Reviewed-by: Anthony Xu <anthony.xu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent ee13110 commit f18a02a

File tree

1 file changed

+43
-11
lines changed

1 file changed

+43
-11
lines changed

hypervisor/bsp/sbl/platform_acpi_info.c

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,48 @@
77
#include <hypervisor.h>
88

99
const struct acpi_info host_acpi_info = {
10-
6, /* x86 family: 6 */
11-
0x5C, /* x86 model: 0x5C, ApolloLake */
12-
{
13-
{SPACE_SYSTEM_IO, 32, 0, 3, 0x400}, /* PM1a EVT */
14-
{SPACE_SYSTEM_IO, 0, 0, 0, 0}, /* PM1b EVT */
15-
{SPACE_SYSTEM_IO, 16, 0, 2, 0x404}, /* PM1a CNT */
16-
{SPACE_SYSTEM_IO, 0, 0, 0, 0}, /* PM1b CNT */
17-
{0x05, 0, 0}, /* _S3 Package */
18-
{0x07, 0, 0}, /* _S5 Package */
19-
(uint32_t *)0x7A86BC9C, /* Wake Vector 32 */
20-
(uint64_t *)0x7A86BCA8 /* Wake Vector 64 */
10+
.x86_family = 6U,
11+
.x86_model = 0x5CU, /* ApolloLake */
12+
.pm_s_state = {
13+
.pm1a_evt = {
14+
.space_id = SPACE_SYSTEM_IO,
15+
.bit_width = 0x20U,
16+
.bit_offset = 0U,
17+
.access_size = 3U,
18+
.address = 0x400UL
19+
},
20+
.pm1b_evt = {
21+
.space_id = SPACE_SYSTEM_IO,
22+
.bit_width = 0U,
23+
.bit_offset = 0U,
24+
.access_size = 0U,
25+
.address = 0UL
26+
},
27+
.pm1a_cnt = {
28+
.space_id = SPACE_SYSTEM_IO,
29+
.bit_width = 0x10U,
30+
.bit_offset = 0U,
31+
.access_size = 2U,
32+
.address = 0x404UL
33+
},
34+
.pm1b_cnt = {
35+
.space_id = SPACE_SYSTEM_IO,
36+
.bit_width = 0U,
37+
.bit_offset = 0U,
38+
.access_size = 0U,
39+
.address = 0UL
40+
},
41+
.s3_pkg = {
42+
.val_pm1a = 0x05U,
43+
.val_pm1b = 0U,
44+
.reserved = 0U
45+
},
46+
.s5_pkg = {
47+
.val_pm1a = 0x07U,
48+
.val_pm1b = 0U,
49+
.reserved = 0U
50+
},
51+
.wake_vector_32 = (uint32_t *)0x7A86BC9CUL,
52+
.wake_vector_64 = (uint64_t *)0x7A86BCA8UL
2153
}
2254
};

0 commit comments

Comments
 (0)