Skip to content

Commit ec25c68

Browse files
SapthagiriPprashymh
authored andcommitted
feat: Move test status to header file.
- make the test status shareable in both VAL and PAL layer - Added new file to hold shared data between VAL and PAL - Remove pal_common_intf.h Signed-off-by: sapthagiri padmanabhan <sapthagiri.padmanabhan@arm.com> Change-Id: Ia7f8b7f498ae3da2d4b7d24b48468fd2e667c8a0
1 parent 0eb26b6 commit ec25c68

16 files changed

Lines changed: 125 additions & 94 deletions

File tree

apps/baremetal/acs_globals.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ uint32_t g_bsa_sw_view_mask = 0;
5656
* Global counters for rule/test outcomes.
5757
* Updated in val/src/rule_based_execution_helpers.c::print_rule_test_status().
5858
*/
59-
acs_test_status_counters_t g_rule_test_stats = {0};
6059

6160
/* ***Note***: few globals are defined in pal/baremetal/target/../src/platform_cfg_fvp.c
62-
for partners to furnish */
61+
for partners to furnish */

apps/uefi/acs_globals.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,3 @@ BOOLEAN g_invalid_arg_seen = FALSE;
8080
* Global counters for rule/test outcomes.
8181
* Updated in val/src/rule_based_execution_helpers.c::print_rule_test_status().
8282
*/
83-
acs_test_status_counters_t g_rule_test_stats = {0};

pal/baremetal/pal.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ target_include_directories(${PAL_LIB} PRIVATE
3535
${ROOT_DIR}/pal/include/
3636
${ROOT_DIR}/pal/baremetal/base/include/
3737
${ROOT_DIR}/pal/baremetal/base/src/AArch64/
38+
${ROOT_DIR}/val/include/
3839
${ROOT_DIR}/pal/baremetal/target/${TARGET}/include/
3940
${ROOT_DIR}/pal/include/
4041
)

pal/baremetal/target/RDN2/src/pal_bsa.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "platform_override_struct.h"
2323
#include "platform_override_fvp.h"
2424
#include "pal_pl011_uart.h"
25+
#include "acs_interface.h"
2526

2627
/**
2728
Conduits for service calls (SMC vs HVC).

pal/baremetal/target/RDV3/src/pal_bsa.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "platform_override_struct.h"
2323
#include "platform_override_fvp.h"
2424
#include "pal_pl011_uart.h"
25+
#include "acs_interface.h"
2526

2627
/**
2728
Conduits for service calls (SMC vs HVC).

pal/baremetal/target/RDV3CFG1/src/pal_bsa.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "platform_override_struct.h"
2323
#include "platform_override_fvp.h"
2424
#include "pal_pl011_uart.h"
25+
#include "acs_interface.h"
2526

2627
/**
2728
Conduits for service calls (SMC vs HVC).

val/include/acs_interface.h

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/** @file
2+
* Copyright (c) 2026, Arm Limited or its affiliates. All rights reserved.
3+
* SPDX-License-Identifier : Apache-2.0
4+
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
**/
17+
/* These APIs and definitions can be used throughout ACS*/
18+
#ifndef __ACS_INTERFACE_H__
19+
#define __ACS_INTERFACE_H__
20+
21+
#ifdef TARGET_UEFI
22+
typedef UINT32 acs_uint32_t;
23+
#else
24+
typedef uint32_t acs_uint32_t;
25+
#endif
26+
27+
/* Test status counters visible across ACS */
28+
typedef struct {
29+
acs_uint32_t total_rules_run; /* Total rules/tests that reported a status */
30+
acs_uint32_t passed; /* Count of TEST_PASS */
31+
acs_uint32_t partial_coverage; /* Count of TEST_PARTIAL_COV */
32+
acs_uint32_t warnings; /* Count of TEST_WARN */
33+
acs_uint32_t skipped; /* Count of TEST_SKIP */
34+
acs_uint32_t failed; /* Count of TEST_FAIL */
35+
acs_uint32_t not_implemented; /* Count of TEST_NO_IMP */
36+
acs_uint32_t pal_not_supported; /* Count of TEST_PAL_NS */
37+
} acs_test_status_counters_t;
38+
39+
acs_test_status_counters_t *acs_get_test_status(void);
40+
void acs_reset_test_status(void);
41+
42+
#endif /* __ACS_INTERFACE_H__ */

val/include/pal_common_intf.h

Lines changed: 0 additions & 39 deletions
This file was deleted.

val/include/pal_interface.h

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@
1717

1818
#ifndef __PAL_INTERFACE_H__
1919
#define __PAL_INTERFACE_H__
20-
2120
#ifdef TARGET_BAREMETAL
2221
#include <stdlib.h>
2322
#include <stdint.h>
23+
#include <stdarg.h>
2424
#include <stddef.h>
2525
#include <stdbool.h>
2626
#include "platform_override_fvp.h"
27+
#include "acs_interface.h"
2728

2829
typedef uint64_t addr_t;
2930
typedef char char8_t;
@@ -68,8 +69,12 @@
6869
#endif // TARGET_BAREMETAL
6970

7071
#ifdef TARGET_LINUX
72+
#include <linux/stdarg.h>
73+
#include <linux/stddef.h>
74+
#include <linux/types.h>
75+
#include <linux/slab.h>
76+
#include "acs_interface.h"
7177

72-
#include <linux/slab.h>
7378
typedef char char8_t;
7479
typedef long long int addr_t;
7580

@@ -90,8 +95,13 @@
9095
#endif //TARGET_LINUX
9196

9297
#ifdef TARGET_UEFI
98+
#include <stdarg.h>
99+
#include <stdbool.h>
100+
#include <stddef.h>
93101
#include <Base.h>
94102
#include "platform_override.h"
103+
#include "acs_interface.h"
104+
95105
typedef INT8 int8_t;
96106
typedef INT16 int16_t;
97107
typedef INT32 int32_t;
@@ -109,10 +119,11 @@
109119
typedef CHAR8 char8_t;
110120
typedef CHAR16 char16_t;
111121

112-
#if defined __STDC_VERSION__ && __STDC_VERSION__ > 201710L
113-
/* bool is a keyword */
114-
#else
115-
typedef BOOLEAN bool;
122+
/* Avoid redefining bool when the language or headers already provide it. */
123+
#if !defined(__cplusplus) && \
124+
!(defined(__STDC_VERSION__) && __STDC_VERSION__ > 201710L) && \
125+
!defined(__bool_true_false_are_defined)
126+
typedef BOOLEAN bool;
116127
#endif
117128

118129
#define MAX_SID 32
@@ -153,8 +164,6 @@
153164
int32_t pal_psci_get_conduit(void);
154165
void pal_dump_dtb(void);
155166
uint32_t pal_target_is_dt(void);
156-
157-
158167
/**
159168
@brief number of PEs discovered
160169
**/
@@ -800,6 +809,7 @@ uint32_t pal_mem_set_wb_executable(void *addr, uint32_t size);
800809
void pal_print(uint64_t data);
801810
void pal_uart_print(int log, const char *fmt, ...);
802811
void pal_print_raw(uint64_t addr, char8_t *string, uint64_t data);
812+
void pal_uart_putc(char c);
803813
uint32_t pal_strncmp(char8_t *str1, char8_t *str2, uint32_t len);
804814
void pal_mmu_add_mmap(void);
805815
void *pal_mmu_get_mmap_list(void);
@@ -1463,3 +1473,8 @@ void pal_pfdi_verify_regs(ARM_SMC_ARGS *ArmSmcArgs, int32_t Conduit,
14631473
uint64_t PreSmcRegs[REG_COUNT_X5_X17],
14641474
uint64_t PostSmcRegs[REG_COUNT_X5_X17]);
14651475
#endif
1476+
1477+
#define LOG_BUFFER_SIZE 8192
1478+
#ifndef static_assert
1479+
#define static_assert _Static_assert
1480+
#endif

val/include/val_interface.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,6 @@ extern uint32_t g_print_level;
6565
#define EL1SKIPTRAP_CNTPCT (1u << 1)
6666
#define EL1SKIPTRAP_DEVMEM (1u << 2)
6767

68-
/* Test status counters visible across ACS */
69-
typedef struct {
70-
uint32_t total_rules_run; /* Total rules/tests that reported a status */
71-
uint32_t passed; /* Count of TEST_PASS */
72-
uint32_t partial_coverage; /* Count of TEST_PARTIAL_COV */
73-
uint32_t warnings; /* Count of TEST_WARN */
74-
uint32_t skipped; /* Count of TEST_SKIP */
75-
uint32_t failed; /* Count of TEST_FAIL */
76-
uint32_t not_implemented; /* Count of TEST_NO_IMP */
77-
uint32_t pal_not_supported; /* Count of TEST_PAL_NS */
78-
} acs_test_status_counters_t;
79-
80-
extern acs_test_status_counters_t g_rule_test_stats;
81-
8268
/* Module init operation type enum */
8369
typedef enum {
8470
INIT_OP_INIT,

0 commit comments

Comments
 (0)