Skip to content

Commit ef76ec8

Browse files
Michael SchwarczOren Cohen
authored andcommitted
Generate psa_manifest/sid.h
1 parent 798e3c3 commit ef76ec8

File tree

18 files changed

+206
-22
lines changed

18 files changed

+206
-22
lines changed

TESTS/psa/spm_client/COMPONENT_NSPE/main.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@
2424
#include "unity.h"
2525
#include "utest.h"
2626
#include "psa/client.h"
27-
#include "psa_client_tests_part1_ifs.h"
27+
28+
#ifndef USE_PSA_TEST_PARTITIONS
29+
#define USE_PSA_TEST_PARTITIONS
30+
#endif
31+
#ifndef USE_CLIENT_TESTS_PART1
32+
#define USE_CLIENT_TESTS_PART1
33+
#endif
34+
#include "psa_manifest/sid.h"
2835

2936
#if defined(TARGET_TFM)
3037
#include "psa/service.h"

TESTS/psa/spm_client/TARGET_MBED_SPM/COMPONENT_SPE/psa_client_tests_part1_partition.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@
2929
#include "spm_panic.h"
3030
#include "spm_internal.h"
3131
#include "psa_client_tests_part1_partition.h"
32-
#include "psa_client_tests_part1_ifs.h"
32+
33+
#ifndef USE_PSA_TEST_PARTITIONS
34+
#define USE_PSA_TEST_PARTITIONS
35+
#endif
36+
#ifndef USE_CLIENT_TESTS_PART1
37+
#define USE_CLIENT_TESTS_PART1
38+
#endif
39+
#include "psa_manifest/sid.h"
3340

3441

3542
/* Threads stacks */

TESTS/psa/spm_server/COMPONENT_NSPE/main.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,19 @@
2424
#include "unity.h"
2525
#include "utest.h"
2626
#include "psa/client.h"
27-
#include "psa_server_tests_part1_ifs.h"
2827
#include "server_tests.h"
2928

29+
#ifndef USE_PSA_TEST_PARTITIONS
30+
#define USE_PSA_TEST_PARTITIONS
31+
#endif
32+
#ifndef USE_SERVER_TESTS_PART1
33+
#define USE_SERVER_TESTS_PART1
34+
#endif
35+
#ifndef USE_SERVER_TESTS_PART2
36+
#define USE_SERVER_TESTS_PART2
37+
#endif
38+
#include "psa_manifest/sid.h"
39+
3040
#if defined(TARGET_TFM)
3141
#include "psa/service.h"
3242
#endif

TESTS/psa/spm_server/COMPONENT_SPE/tests.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,19 @@
1919
#include "psa/client.h"
2020
#include "psa/service.h"
2121
#include "psa_server_tests_part1_partition.h"
22-
#include "psa_server_tests_part2_ifs.h"
2322
#include "server_tests.h"
2423

24+
#ifndef USE_PSA_TEST_PARTITIONS
25+
#define USE_PSA_TEST_PARTITIONS
26+
#endif
27+
#ifndef USE_SERVER_TESTS_PART1
28+
#define USE_SERVER_TESTS_PART1
29+
#endif
30+
#ifndef USE_SERVER_TESTS_PART2
31+
#define USE_SERVER_TESTS_PART2
32+
#endif
33+
#include "psa_manifest/sid.h"
34+
2535
/**
2636
* Process a generic connect message to TEST ROT_SRV.
2737
* @return PSA_SUCCESS or negative error code if failed.

TESTS/psa/spm_server/TARGET_MBED_SPM/COMPONENT_SPE/psa_server_tests_part1_partition.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,17 @@
2929
#include "spm_panic.h"
3030
#include "spm_internal.h"
3131
#include "psa_server_tests_part1_partition.h"
32-
#include "psa_server_tests_part1_ifs.h"
33-
#include "psa_server_tests_part2_ifs.h"
32+
33+
#ifndef USE_PSA_TEST_PARTITIONS
34+
#define USE_PSA_TEST_PARTITIONS
35+
#endif
36+
#ifndef USE_SERVER_TESTS_PART1
37+
#define USE_SERVER_TESTS_PART1
38+
#endif
39+
#ifndef USE_SERVER_TESTS_PART2
40+
#define USE_SERVER_TESTS_PART2
41+
#endif
42+
#include "psa_manifest/sid.h"
3443

3544

3645
/* Threads stacks */

TESTS/psa/spm_server/TARGET_MBED_SPM/COMPONENT_SPE/psa_server_tests_part2_partition.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,17 @@
2929
#include "spm_panic.h"
3030
#include "spm_internal.h"
3131
#include "psa_server_tests_part2_partition.h"
32-
#include "psa_server_tests_part2_ifs.h"
32+
33+
#ifndef USE_PSA_TEST_PARTITIONS
34+
#define USE_PSA_TEST_PARTITIONS
35+
#endif
36+
#ifndef USE_SERVER_TESTS_PART1
37+
#define USE_SERVER_TESTS_PART1
38+
#endif
39+
#ifndef USE_SERVER_TESTS_PART2
40+
#define USE_SERVER_TESTS_PART2
41+
#endif
42+
#include "psa_manifest/sid.h"
3343

3444

3545
/* Threads stacks */

TESTS/psa/spm_smoke/COMPONENT_NSPE/main.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@
2626
#include "unity.h"
2727
#include "utest.h"
2828
#include "psa/client.h"
29-
#include "psa_smoke_tests_part1_ifs.h"
29+
30+
#ifndef USE_PSA_TEST_PARTITIONS
31+
#define USE_PSA_TEST_PARTITIONS
32+
#endif
33+
#ifndef USE_SMOKE_TESTS_PART1
34+
#define USE_SMOKE_TESTS_PART1
35+
#endif
36+
#include "psa_manifest/sid.h"
3037

3138
#if defined(TARGET_TFM)
3239
#include "psa/service.h"

TESTS/psa/spm_smoke/TARGET_MBED_SPM/COMPONENT_SPE/psa_smoke_tests_part1_partition.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@
2929
#include "spm_panic.h"
3030
#include "spm_internal.h"
3131
#include "psa_smoke_tests_part1_partition.h"
32-
#include "psa_smoke_tests_part1_ifs.h"
32+
33+
#ifndef USE_PSA_TEST_PARTITIONS
34+
#define USE_PSA_TEST_PARTITIONS
35+
#endif
36+
#ifndef USE_SMOKE_TESTS_PART1
37+
#define USE_SMOKE_TESTS_PART1
38+
#endif
39+
#include "psa_manifest/sid.h"
3340

3441

3542
/* Threads stacks */
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/* Copyright (c) 2019 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+
/*********** WARNING: This is an auto-generated file. Do not edit! ***********/
19+
20+
#ifndef SID_H
21+
#define SID_H
22+
23+
/*************************** Service Partitions ******************************/
24+
25+
#define PSA_ITS_GET 0x00011A00
26+
#define PSA_ITS_SET 0x00011A01
27+
#define PSA_ITS_INFO 0x00011A02
28+
#define PSA_ITS_REMOVE 0x00011A03
29+
#define PSA_ITS_RESET 0x00011A04
30+
#define PSA_PLATFORM_LC_GET 0x00011000
31+
#define PSA_PLATFORM_LC_SET 0x00011001
32+
#define PSA_PLATFORM_SYSTEM_RESET 0x00011002
33+
#define PSA_CRYPTO_INIT_ID 0x00000F00
34+
#define PSA_MAC_ID 0x00000F01
35+
#define PSA_HASH_ID 0x00000F02
36+
#define PSA_ASYMMETRIC_ID 0x00000F03
37+
#define PSA_SYMMETRIC_ID 0x00000F04
38+
#define PSA_AEAD_ID 0x00000F05
39+
#define PSA_KEY_MNG_ID 0x00000F06
40+
#define PSA_RNG_ID 0x00000F07
41+
#define PSA_CRYPTO_FREE_ID 0x00000F08
42+
#define PSA_GENERATOR_ID 0x00000F09
43+
#define PSA_ENTROPY_ID 0x00000F0A
44+
45+
/*************************** Test Partitions *********************************/
46+
47+
#ifdef USE_PSA_TEST_PARTITIONS
48+
49+
#ifdef USE_CLIENT_TESTS_PART1
50+
#define PART1_ROT_SRV1 0x00001A05
51+
#define DROP_CONN 0x00001A06
52+
#define SECURE_CLIENTS_ONLY 0x00001A07
53+
#endif
54+
55+
#ifdef USE_SERVER_TESTS_PART1
56+
#define CONTROL 0x00001A01
57+
#define TEST 0x00001A02
58+
#endif
59+
60+
#ifdef USE_SERVER_TESTS_PART2
61+
#define ROT_SRV_REVERSE 0x00001A03
62+
#define ROT_SRV_DB_TST 0x00001A04
63+
#endif
64+
65+
#ifdef USE_SMOKE_TESTS_PART1
66+
#define ROT_SRV1 0x00001A00
67+
#endif
68+
69+
#endif // USE_PSA_TEST_PARTITIONS
70+
71+
#endif // SID_H

components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/psa_crypto_spm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <stdlib.h>
2525
#include <string.h>
2626

27-
#include "psa_crypto_srv_ifs.h"
27+
#include "psa_manifest/sid.h"
2828
#include "psa/client.h"
2929
#include "crypto.h"
3030
#include "crypto_platform_spe.h"

components/TARGET_PSA/services/crypto/TARGET_MBED_SPM/COMPONENT_SPE/psa_crypto_srv_partition.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
#include "spm_panic.h"
3030
#include "spm_internal.h"
3131
#include "psa_crypto_srv_partition.h"
32-
#include "psa_crypto_srv_ifs.h"
33-
#include "psa_its_ifs.h"
32+
#include "psa_manifest/sid.h"
3433

3534

3635
/* Threads stacks */

components/TARGET_PSA/services/platform/COMPONENT_PSA_SRV_IPC/platform_ipc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
#include "psa_platform_ifs.h"
18+
#include "psa_manifest/sid.h"
1919
#include "psa/lifecycle.h"
2020
#include "psa/client.h"
2121
#include "mbed_toolchain.h"

components/TARGET_PSA/services/platform/TARGET_MBED_SPM/COMPONENT_SPE/psa_platform_partition.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
#include "spm_panic.h"
3030
#include "spm_internal.h"
3131
#include "psa_platform_partition.h"
32-
#include "psa_platform_ifs.h"
33-
#include "psa_its_ifs.h"
32+
#include "psa_manifest/sid.h"
3433

3534

3635
/* Threads stacks */

components/TARGET_PSA/services/storage/its/COMPONENT_PSA_SRV_IPC/psa_prot_internal_storage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "psa/client.h"
1919
#include "psa/storage_common.h"
2020
#include "psa/internal_trusted_storage.h"
21-
#include "psa_its_ifs.h"
21+
#include "psa_manifest/sid.h"
2222

2323
psa_status_t psa_its_set(psa_storage_uid_t uid, uint32_t data_length, const void *p_data, psa_storage_create_flags_t create_flags)
2424
{

components/TARGET_PSA/services/storage/its/TARGET_MBED_SPM/COMPONENT_SPE/psa_its_partition.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "spm_panic.h"
3030
#include "spm_internal.h"
3131
#include "psa_its_partition.h"
32-
#include "psa_its_ifs.h"
32+
#include "psa_manifest/sid.h"
3333

3434

3535
/* Threads stacks */

tools/psa/mbed_spm/templates/TARGET_MBED_SPM/COMPONENT_SPE/psa_NAME_partition.c.tpl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@
2929
#include "spm_panic.h"
3030
#include "spm_internal.h"
3131
#include "psa_{{partition.name|lower}}_partition.h"
32-
#include "psa_{{partition.name|lower}}_ifs.h"
33-
{% for partition in dependent_partitions %}
34-
#include "psa_{{partition|lower}}_ifs.h"
35-
{% endfor %}
32+
#include "psa_manifest/sid.h"
3633

3734

3835
/* Threads stacks */

tools/psa/tfm/templates/sid.h.tpl

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/* Copyright (c) 2019 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+
/*********** WARNING: This is an auto-generated file. Do not edit! ***********/
19+
20+
#ifndef SID_H
21+
#define SID_H
22+
23+
/*************************** Service Partitions ******************************/
24+
25+
{% for partition in service_partitions %}
26+
{% for rot_srv in partition.rot_services %}
27+
#define {{rot_srv.name|upper}} {{rot_srv.id}}
28+
{% endfor %}
29+
{% endfor %}
30+
31+
/*************************** Test Partitions *********************************/
32+
33+
#ifdef USE_PSA_TEST_PARTITIONS
34+
35+
{% for partition in test_partitions %}
36+
#ifdef USE_{{partition.name|upper}}
37+
{% for rot_srv in partition.rot_services %}
38+
#define {{rot_srv.name|upper}} {{rot_srv.id}}
39+
{% endfor %}
40+
#endif
41+
42+
{% endfor %}
43+
#endif // USE_PSA_TEST_PARTITIONS
44+
45+
#endif // SID_H
46+
{# End of file #}

tools/psa/tfm/tfm_generated_file_list.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@
1515
"output": "components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/autogen/tfm_service_list.inc"
1616
},
1717
{
18-
"name": "Secure Service siganls list",
18+
"name": "Secure Service signals list",
1919
"template": "tools/psa/tfm/templates/tfm_spm_signal_defs.h.tpl",
2020
"output": "components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/autogen/tfm_spm_signal_defs.h"
21+
},
22+
{
23+
"name": "Mappings from RoT Service names to SIDs",
24+
"template": "tools/psa/tfm/templates/sid.h.tpl",
25+
"output": "components/TARGET_PSA/inc/psa_manifest/sid.h"
2126
}
2227
]

0 commit comments

Comments
 (0)