Skip to content

Commit 5047ea4

Browse files
author
Cruz Monrreal
authored
Merge pull request #8889 from kfnta/psa_travis_check
Add PSA code generation check in travis
2 parents d6b2a1a + dcba1e7 commit 5047ea4

File tree

15 files changed

+237
-128
lines changed

15 files changed

+237
-128
lines changed

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,9 @@ matrix:
280280
- echo 'Checking that there is no GPL licence text in code'
281281
- ! git grep -q --ignore-case "gnu general public";
282282
- ! git grep -q --ignore-case "gnu library general public";
283+
- env:
284+
- NAME=psa-autogen
285+
script:
286+
# Run SPM code generator and check that changes are not needed
287+
- python tools/spm/generate_partition_code.py
288+
- git diff --exit-code
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/* Copyright (c) 2017-2018 ARM Limited
2+
*
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+
18+
/***********************************************************************************************************************
19+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
20+
* THIS FILE IS AN AUTO-GENERATED FILE - DO NOT MODIFY IT.
21+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
22+
* Template Version 1.0
23+
* Generated by tools/spm/generate_partition_code.py Version 1.0
24+
**********************************************************************************************************************/
25+
26+
#include "spm_panic.h"
27+
#include "spm_internal.h"
28+
#include "handles_manager.h"
29+
#include "cmsis.h"
30+
#include "psa_psa_f_partition.h"
31+
#include "psa_its_partition.h"
32+
33+
extern const uint32_t psa_f_external_sids[4];
34+
35+
spm_partition_t g_partitions[2] = {
36+
{
37+
.partition_id = PSA_F_ID,
38+
.thread_id = 0,
39+
.flags_rot_srv = PSA_F_WAIT_ANY_SID_MSK,
40+
.flags_interrupts = 0,
41+
.rot_services = NULL,
42+
.rot_services_count = PSA_F_ROT_SRV_COUNT,
43+
.extern_sids = psa_f_external_sids,
44+
.extern_sids_count = PSA_F_EXT_ROT_SRV_COUNT,
45+
.irq_mapper = NULL,
46+
},
47+
{
48+
.partition_id = ITS_ID,
49+
.thread_id = 0,
50+
.flags_rot_srv = ITS_WAIT_ANY_SID_MSK,
51+
.flags_interrupts = 0,
52+
.rot_services = NULL,
53+
.rot_services_count = ITS_ROT_SRV_COUNT,
54+
.extern_sids = NULL,
55+
.extern_sids_count = ITS_EXT_ROT_SRV_COUNT,
56+
.irq_mapper = NULL,
57+
},
58+
};
59+
60+
/* Check all the defined memory regions for overlapping. */
61+
62+
/* A list of all the memory regions. */
63+
const mem_region_t *mem_regions = NULL;
64+
65+
const uint32_t mem_region_count = 0;
66+
67+
// forward declaration of partition initializers
68+
void psa_f_init(spm_partition_t *partition);
69+
void its_init(spm_partition_t *partition);
70+
71+
uint32_t init_partitions(spm_partition_t **partitions)
72+
{
73+
if (NULL == partitions) {
74+
SPM_PANIC("partitions is NULL!\n");
75+
}
76+
77+
psa_f_init(&(g_partitions[0]));
78+
its_init(&(g_partitions[1]));
79+
80+
*partitions = g_partitions;
81+
return 2;
82+
}
83+

TESTS/psa/entropy_inject/COMPONENT_SPE/psa_setup.c

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@
1919
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2020
* THIS FILE IS AN AUTO-GENERATED FILE - DO NOT MODIFY IT.
2121
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
22+
* Template Version 1.0
23+
* Generated by tools/spm/generate_partition_code.py Version 1.0
2224
**********************************************************************************************************************/
2325

2426
#include "spm_panic.h"
2527
#include "spm_internal.h"
2628
#include "handles_manager.h"
2729
#include "cmsis.h"
2830
#include "psa_test_its_reset_partition.h"
29-
#include "psa_its_partition.h"
3031
#include "psa_psa_f_partition.h"
32+
#include "psa_its_partition.h"
3133

3234
extern const uint32_t psa_f_external_sids[4];
3335

@@ -44,25 +46,25 @@ spm_partition_t g_partitions[3] = {
4446
.irq_mapper = NULL,
4547
},
4648
{
47-
.partition_id = ITS_ID,
49+
.partition_id = PSA_F_ID,
4850
.thread_id = 0,
49-
.flags_rot_srv = ITS_WAIT_ANY_SID_MSK,
51+
.flags_rot_srv = PSA_F_WAIT_ANY_SID_MSK,
5052
.flags_interrupts = 0,
5153
.rot_services = NULL,
52-
.rot_services_count = ITS_ROT_SRV_COUNT,
53-
.extern_sids = NULL,
54-
.extern_sids_count = ITS_EXT_ROT_SRV_COUNT,
54+
.rot_services_count = PSA_F_ROT_SRV_COUNT,
55+
.extern_sids = psa_f_external_sids,
56+
.extern_sids_count = PSA_F_EXT_ROT_SRV_COUNT,
5557
.irq_mapper = NULL,
5658
},
5759
{
58-
.partition_id = PSA_F_ID,
60+
.partition_id = ITS_ID,
5961
.thread_id = 0,
60-
.flags_rot_srv = PSA_F_WAIT_ANY_SID_MSK,
62+
.flags_rot_srv = ITS_WAIT_ANY_SID_MSK,
6163
.flags_interrupts = 0,
6264
.rot_services = NULL,
63-
.rot_services_count = PSA_F_ROT_SRV_COUNT,
64-
.extern_sids = psa_f_external_sids,
65-
.extern_sids_count = PSA_F_EXT_ROT_SRV_COUNT,
65+
.rot_services_count = ITS_ROT_SRV_COUNT,
66+
.extern_sids = NULL,
67+
.extern_sids_count = ITS_EXT_ROT_SRV_COUNT,
6668
.irq_mapper = NULL,
6769
},
6870
};
@@ -76,8 +78,8 @@ const uint32_t mem_region_count = 0;
7678

7779
// forward declaration of partition initializers
7880
void test_its_reset_init(spm_partition_t *partition);
79-
void its_init(spm_partition_t *partition);
8081
void psa_f_init(spm_partition_t *partition);
82+
void its_init(spm_partition_t *partition);
8183

8284
uint32_t init_partitions(spm_partition_t **partitions)
8385
{
@@ -86,8 +88,8 @@ uint32_t init_partitions(spm_partition_t **partitions)
8688
}
8789

8890
test_its_reset_init(&(g_partitions[0]));
89-
its_init(&(g_partitions[1]));
90-
psa_f_init(&(g_partitions[2]));
91+
psa_f_init(&(g_partitions[1]));
92+
its_init(&(g_partitions[2]));
9193

9294
*partitions = g_partitions;
9395
return 3;

TESTS/psa/entropy_inject/its_reset/COMPONENT_SPE/psa_test_its_reset_partition.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2020
* THIS FILE IS AN AUTO-GENERATED FILE - DO NOT MODIFY IT.
2121
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
22+
* Template Version 1.0
23+
* Generated by tools/spm/generate_partition_code.py Version 1.0
2224
**********************************************************************************************************************/
2325

2426
#include "cmsis.h"

TESTS/psa/entropy_inject/its_reset/COMPONENT_SPE/psa_test_its_reset_partition.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2020
* THIS FILE IS AN AUTO-GENERATED FILE - DO NOT MODIFY IT.
2121
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
22+
* Template Version 1.0
23+
* Generated by tools/spm/generate_partition_code.py Version 1.0
2224
**********************************************************************************************************************/
2325

2426
#ifndef PSA_TEST_ITS_RESET_PARTITION_H
@@ -44,11 +46,5 @@
4446
#define TEST_ITS_RESET_WAIT_ANY_SID_MSK (\
4547
TEST_PSA_ITS_RESET_MSK)
4648

47-
/*
48-
#define TEST_ITS_RESET_WAIT_ANY_MSK (\
49-
TEST_ITS_RESET_WAIT_ANY_SID_MSK) | \
50-
PSA_DOORBELL)
51-
*/
52-
5349

5450
#endif // PSA_TEST_ITS_RESET_PARTITION_H

TESTS/psa/entropy_inject/its_reset/psa_test_its_reset_ifs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2020
* THIS FILE IS AN AUTO-GENERATED FILE - DO NOT MODIFY IT.
2121
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
22+
* Template Version 1.0
23+
* Generated by tools/spm/generate_partition_code.py Version 1.0
2224
**********************************************************************************************************************/
2325

2426
#ifndef PSA_TEST_ITS_RESET_PARTITION_ROT_SERVICES_H

TESTS/psa/prot_internal_storage/COMPONENT_SPE/psa_setup.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
#include "handles_manager.h"
2929
#include "cmsis.h"
3030
#include "psa_test_its_reset_partition.h"
31-
#include "psa_its_partition.h"
3231
#include "psa_psa_f_partition.h"
32+
#include "psa_its_partition.h"
3333

3434
extern const uint32_t psa_f_external_sids[4];
3535

@@ -46,25 +46,25 @@ spm_partition_t g_partitions[3] = {
4646
.irq_mapper = NULL,
4747
},
4848
{
49-
.partition_id = ITS_ID,
49+
.partition_id = PSA_F_ID,
5050
.thread_id = 0,
51-
.flags_rot_srv = ITS_WAIT_ANY_SID_MSK,
51+
.flags_rot_srv = PSA_F_WAIT_ANY_SID_MSK,
5252
.flags_interrupts = 0,
5353
.rot_services = NULL,
54-
.rot_services_count = ITS_ROT_SRV_COUNT,
55-
.extern_sids = NULL,
56-
.extern_sids_count = ITS_EXT_ROT_SRV_COUNT,
54+
.rot_services_count = PSA_F_ROT_SRV_COUNT,
55+
.extern_sids = psa_f_external_sids,
56+
.extern_sids_count = PSA_F_EXT_ROT_SRV_COUNT,
5757
.irq_mapper = NULL,
5858
},
5959
{
60-
.partition_id = PSA_F_ID,
60+
.partition_id = ITS_ID,
6161
.thread_id = 0,
62-
.flags_rot_srv = PSA_F_WAIT_ANY_SID_MSK,
62+
.flags_rot_srv = ITS_WAIT_ANY_SID_MSK,
6363
.flags_interrupts = 0,
6464
.rot_services = NULL,
65-
.rot_services_count = PSA_F_ROT_SRV_COUNT,
66-
.extern_sids = psa_f_external_sids,
67-
.extern_sids_count = PSA_F_EXT_ROT_SRV_COUNT,
65+
.rot_services_count = ITS_ROT_SRV_COUNT,
66+
.extern_sids = NULL,
67+
.extern_sids_count = ITS_EXT_ROT_SRV_COUNT,
6868
.irq_mapper = NULL,
6969
},
7070
};
@@ -78,8 +78,8 @@ const uint32_t mem_region_count = 0;
7878

7979
// forward declaration of partition initializers
8080
void test_its_reset_init(spm_partition_t *partition);
81-
void its_init(spm_partition_t *partition);
8281
void psa_f_init(spm_partition_t *partition);
82+
void its_init(spm_partition_t *partition);
8383

8484
uint32_t init_partitions(spm_partition_t **partitions)
8585
{
@@ -88,8 +88,8 @@ uint32_t init_partitions(spm_partition_t **partitions)
8888
}
8989

9090
test_its_reset_init(&(g_partitions[0]));
91-
its_init(&(g_partitions[1]));
92-
psa_f_init(&(g_partitions[2]));
91+
psa_f_init(&(g_partitions[1]));
92+
its_init(&(g_partitions[2]));
9393

9494
*partitions = g_partitions;
9595
return 3;

TESTS/psa/spm_client/COMPONENT_SPE/psa_setup.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
#include "handles_manager.h"
2929
#include "cmsis.h"
3030
#include "psa_client_tests_part1_partition.h"
31-
#include "psa_its_partition.h"
3231
#include "psa_psa_f_partition.h"
32+
#include "psa_its_partition.h"
3333

3434
extern const uint32_t psa_f_external_sids[4];
3535

@@ -46,25 +46,25 @@ spm_partition_t g_partitions[3] = {
4646
.irq_mapper = NULL,
4747
},
4848
{
49-
.partition_id = ITS_ID,
49+
.partition_id = PSA_F_ID,
5050
.thread_id = 0,
51-
.flags_rot_srv = ITS_WAIT_ANY_SID_MSK,
51+
.flags_rot_srv = PSA_F_WAIT_ANY_SID_MSK,
5252
.flags_interrupts = 0,
5353
.rot_services = NULL,
54-
.rot_services_count = ITS_ROT_SRV_COUNT,
55-
.extern_sids = NULL,
56-
.extern_sids_count = ITS_EXT_ROT_SRV_COUNT,
54+
.rot_services_count = PSA_F_ROT_SRV_COUNT,
55+
.extern_sids = psa_f_external_sids,
56+
.extern_sids_count = PSA_F_EXT_ROT_SRV_COUNT,
5757
.irq_mapper = NULL,
5858
},
5959
{
60-
.partition_id = PSA_F_ID,
60+
.partition_id = ITS_ID,
6161
.thread_id = 0,
62-
.flags_rot_srv = PSA_F_WAIT_ANY_SID_MSK,
62+
.flags_rot_srv = ITS_WAIT_ANY_SID_MSK,
6363
.flags_interrupts = 0,
6464
.rot_services = NULL,
65-
.rot_services_count = PSA_F_ROT_SRV_COUNT,
66-
.extern_sids = psa_f_external_sids,
67-
.extern_sids_count = PSA_F_EXT_ROT_SRV_COUNT,
65+
.rot_services_count = ITS_ROT_SRV_COUNT,
66+
.extern_sids = NULL,
67+
.extern_sids_count = ITS_EXT_ROT_SRV_COUNT,
6868
.irq_mapper = NULL,
6969
},
7070
};
@@ -78,8 +78,8 @@ const uint32_t mem_region_count = 0;
7878

7979
// forward declaration of partition initializers
8080
void client_tests_part1_init(spm_partition_t *partition);
81-
void its_init(spm_partition_t *partition);
8281
void psa_f_init(spm_partition_t *partition);
82+
void its_init(spm_partition_t *partition);
8383

8484
uint32_t init_partitions(spm_partition_t **partitions)
8585
{
@@ -88,8 +88,8 @@ uint32_t init_partitions(spm_partition_t **partitions)
8888
}
8989

9090
client_tests_part1_init(&(g_partitions[0]));
91-
its_init(&(g_partitions[1]));
92-
psa_f_init(&(g_partitions[2]));
91+
psa_f_init(&(g_partitions[1]));
92+
its_init(&(g_partitions[2]));
9393

9494
*partitions = g_partitions;
9595
return 3;

0 commit comments

Comments
 (0)