Skip to content

Add PSA code generation check in travis #8889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,9 @@ matrix:
- echo 'Checking that there is no GPL licence text in code'
- ! git grep -q --ignore-case "gnu general public";
- ! git grep -q --ignore-case "gnu library general public";
- env:
- NAME=psa-autogen
script:
# Run SPM code generator and check that changes are not needed
- python tools/spm/generate_partition_code.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What this supposed to be doing ? Checking unstaged files (means the files have changed?) A comment here might help (also this will need docs PR - there're travi sjobs described)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment
Basically it runs the code generation tool and checks if changes are required

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making sure, does this tool work in Python 2 and Python 3?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested on 2.7 and 3.7

- git diff --exit-code
83 changes: 83 additions & 0 deletions TESTS/psa/crypto_init/COMPONENT_SPE/psa_setup.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/* Copyright (c) 2017-2018 ARM Limited
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/***********************************************************************************************************************
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* THIS FILE IS AN AUTO-GENERATED FILE - DO NOT MODIFY IT.
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Template Version 1.0
* Generated by tools/spm/generate_partition_code.py Version 1.0
**********************************************************************************************************************/

#include "spm_panic.h"
#include "spm_internal.h"
#include "handles_manager.h"
#include "cmsis.h"
#include "psa_psa_f_partition.h"
#include "psa_its_partition.h"

extern const uint32_t psa_f_external_sids[4];

spm_partition_t g_partitions[2] = {
{
.partition_id = PSA_F_ID,
.thread_id = 0,
.flags_rot_srv = PSA_F_WAIT_ANY_SID_MSK,
.flags_interrupts = 0,
.rot_services = NULL,
.rot_services_count = PSA_F_ROT_SRV_COUNT,
.extern_sids = psa_f_external_sids,
.extern_sids_count = PSA_F_EXT_ROT_SRV_COUNT,
.irq_mapper = NULL,
},
{
.partition_id = ITS_ID,
.thread_id = 0,
.flags_rot_srv = ITS_WAIT_ANY_SID_MSK,
.flags_interrupts = 0,
.rot_services = NULL,
.rot_services_count = ITS_ROT_SRV_COUNT,
.extern_sids = NULL,
.extern_sids_count = ITS_EXT_ROT_SRV_COUNT,
.irq_mapper = NULL,
},
};

/* Check all the defined memory regions for overlapping. */

/* A list of all the memory regions. */
const mem_region_t *mem_regions = NULL;

const uint32_t mem_region_count = 0;

// forward declaration of partition initializers
void psa_f_init(spm_partition_t *partition);
void its_init(spm_partition_t *partition);

uint32_t init_partitions(spm_partition_t **partitions)
{
if (NULL == partitions) {
SPM_PANIC("partitions is NULL!\n");
}

psa_f_init(&(g_partitions[0]));
its_init(&(g_partitions[1]));

*partitions = g_partitions;
return 2;
}

30 changes: 16 additions & 14 deletions TESTS/psa/entropy_inject/COMPONENT_SPE/psa_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* THIS FILE IS AN AUTO-GENERATED FILE - DO NOT MODIFY IT.
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Template Version 1.0
* Generated by tools/spm/generate_partition_code.py Version 1.0
**********************************************************************************************************************/

#include "spm_panic.h"
#include "spm_internal.h"
#include "handles_manager.h"
#include "cmsis.h"
#include "psa_test_its_reset_partition.h"
#include "psa_its_partition.h"
#include "psa_psa_f_partition.h"
#include "psa_its_partition.h"

extern const uint32_t psa_f_external_sids[4];

Expand All @@ -44,25 +46,25 @@ spm_partition_t g_partitions[3] = {
.irq_mapper = NULL,
},
{
.partition_id = ITS_ID,
.partition_id = PSA_F_ID,
.thread_id = 0,
.flags_rot_srv = ITS_WAIT_ANY_SID_MSK,
.flags_rot_srv = PSA_F_WAIT_ANY_SID_MSK,
.flags_interrupts = 0,
.rot_services = NULL,
.rot_services_count = ITS_ROT_SRV_COUNT,
.extern_sids = NULL,
.extern_sids_count = ITS_EXT_ROT_SRV_COUNT,
.rot_services_count = PSA_F_ROT_SRV_COUNT,
.extern_sids = psa_f_external_sids,
.extern_sids_count = PSA_F_EXT_ROT_SRV_COUNT,
.irq_mapper = NULL,
},
{
.partition_id = PSA_F_ID,
.partition_id = ITS_ID,
.thread_id = 0,
.flags_rot_srv = PSA_F_WAIT_ANY_SID_MSK,
.flags_rot_srv = ITS_WAIT_ANY_SID_MSK,
.flags_interrupts = 0,
.rot_services = NULL,
.rot_services_count = PSA_F_ROT_SRV_COUNT,
.extern_sids = psa_f_external_sids,
.extern_sids_count = PSA_F_EXT_ROT_SRV_COUNT,
.rot_services_count = ITS_ROT_SRV_COUNT,
.extern_sids = NULL,
.extern_sids_count = ITS_EXT_ROT_SRV_COUNT,
.irq_mapper = NULL,
},
};
Expand All @@ -76,8 +78,8 @@ const uint32_t mem_region_count = 0;

// forward declaration of partition initializers
void test_its_reset_init(spm_partition_t *partition);
void its_init(spm_partition_t *partition);
void psa_f_init(spm_partition_t *partition);
void its_init(spm_partition_t *partition);

uint32_t init_partitions(spm_partition_t **partitions)
{
Expand All @@ -86,8 +88,8 @@ uint32_t init_partitions(spm_partition_t **partitions)
}

test_its_reset_init(&(g_partitions[0]));
its_init(&(g_partitions[1]));
psa_f_init(&(g_partitions[2]));
psa_f_init(&(g_partitions[1]));
its_init(&(g_partitions[2]));

*partitions = g_partitions;
return 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* THIS FILE IS AN AUTO-GENERATED FILE - DO NOT MODIFY IT.
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Template Version 1.0
* Generated by tools/spm/generate_partition_code.py Version 1.0
**********************************************************************************************************************/

#include "cmsis.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* THIS FILE IS AN AUTO-GENERATED FILE - DO NOT MODIFY IT.
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Template Version 1.0
* Generated by tools/spm/generate_partition_code.py Version 1.0
**********************************************************************************************************************/

#ifndef PSA_TEST_ITS_RESET_PARTITION_H
Expand All @@ -44,11 +46,5 @@
#define TEST_ITS_RESET_WAIT_ANY_SID_MSK (\
TEST_PSA_ITS_RESET_MSK)

/*
#define TEST_ITS_RESET_WAIT_ANY_MSK (\
TEST_ITS_RESET_WAIT_ANY_SID_MSK) | \
PSA_DOORBELL)
*/


#endif // PSA_TEST_ITS_RESET_PARTITION_H
2 changes: 2 additions & 0 deletions TESTS/psa/entropy_inject/its_reset/psa_test_its_reset_ifs.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* THIS FILE IS AN AUTO-GENERATED FILE - DO NOT MODIFY IT.
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* Template Version 1.0
* Generated by tools/spm/generate_partition_code.py Version 1.0
**********************************************************************************************************************/

#ifndef PSA_TEST_ITS_RESET_PARTITION_ROT_SERVICES_H
Expand Down
28 changes: 14 additions & 14 deletions TESTS/psa/prot_internal_storage/COMPONENT_SPE/psa_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include "handles_manager.h"
#include "cmsis.h"
#include "psa_test_its_reset_partition.h"
#include "psa_its_partition.h"
#include "psa_psa_f_partition.h"
#include "psa_its_partition.h"

extern const uint32_t psa_f_external_sids[4];

Expand All @@ -46,25 +46,25 @@ spm_partition_t g_partitions[3] = {
.irq_mapper = NULL,
},
{
.partition_id = ITS_ID,
.partition_id = PSA_F_ID,
.thread_id = 0,
.flags_rot_srv = ITS_WAIT_ANY_SID_MSK,
.flags_rot_srv = PSA_F_WAIT_ANY_SID_MSK,
.flags_interrupts = 0,
.rot_services = NULL,
.rot_services_count = ITS_ROT_SRV_COUNT,
.extern_sids = NULL,
.extern_sids_count = ITS_EXT_ROT_SRV_COUNT,
.rot_services_count = PSA_F_ROT_SRV_COUNT,
.extern_sids = psa_f_external_sids,
.extern_sids_count = PSA_F_EXT_ROT_SRV_COUNT,
.irq_mapper = NULL,
},
{
.partition_id = PSA_F_ID,
.partition_id = ITS_ID,
.thread_id = 0,
.flags_rot_srv = PSA_F_WAIT_ANY_SID_MSK,
.flags_rot_srv = ITS_WAIT_ANY_SID_MSK,
.flags_interrupts = 0,
.rot_services = NULL,
.rot_services_count = PSA_F_ROT_SRV_COUNT,
.extern_sids = psa_f_external_sids,
.extern_sids_count = PSA_F_EXT_ROT_SRV_COUNT,
.rot_services_count = ITS_ROT_SRV_COUNT,
.extern_sids = NULL,
.extern_sids_count = ITS_EXT_ROT_SRV_COUNT,
.irq_mapper = NULL,
},
};
Expand All @@ -78,8 +78,8 @@ const uint32_t mem_region_count = 0;

// forward declaration of partition initializers
void test_its_reset_init(spm_partition_t *partition);
void its_init(spm_partition_t *partition);
void psa_f_init(spm_partition_t *partition);
void its_init(spm_partition_t *partition);

uint32_t init_partitions(spm_partition_t **partitions)
{
Expand All @@ -88,8 +88,8 @@ uint32_t init_partitions(spm_partition_t **partitions)
}

test_its_reset_init(&(g_partitions[0]));
its_init(&(g_partitions[1]));
psa_f_init(&(g_partitions[2]));
psa_f_init(&(g_partitions[1]));
its_init(&(g_partitions[2]));

*partitions = g_partitions;
return 3;
Expand Down
28 changes: 14 additions & 14 deletions TESTS/psa/spm_client/COMPONENT_SPE/psa_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include "handles_manager.h"
#include "cmsis.h"
#include "psa_client_tests_part1_partition.h"
#include "psa_its_partition.h"
#include "psa_psa_f_partition.h"
#include "psa_its_partition.h"

extern const uint32_t psa_f_external_sids[4];

Expand All @@ -46,25 +46,25 @@ spm_partition_t g_partitions[3] = {
.irq_mapper = NULL,
},
{
.partition_id = ITS_ID,
.partition_id = PSA_F_ID,
.thread_id = 0,
.flags_rot_srv = ITS_WAIT_ANY_SID_MSK,
.flags_rot_srv = PSA_F_WAIT_ANY_SID_MSK,
.flags_interrupts = 0,
.rot_services = NULL,
.rot_services_count = ITS_ROT_SRV_COUNT,
.extern_sids = NULL,
.extern_sids_count = ITS_EXT_ROT_SRV_COUNT,
.rot_services_count = PSA_F_ROT_SRV_COUNT,
.extern_sids = psa_f_external_sids,
.extern_sids_count = PSA_F_EXT_ROT_SRV_COUNT,
.irq_mapper = NULL,
},
{
.partition_id = PSA_F_ID,
.partition_id = ITS_ID,
.thread_id = 0,
.flags_rot_srv = PSA_F_WAIT_ANY_SID_MSK,
.flags_rot_srv = ITS_WAIT_ANY_SID_MSK,
.flags_interrupts = 0,
.rot_services = NULL,
.rot_services_count = PSA_F_ROT_SRV_COUNT,
.extern_sids = psa_f_external_sids,
.extern_sids_count = PSA_F_EXT_ROT_SRV_COUNT,
.rot_services_count = ITS_ROT_SRV_COUNT,
.extern_sids = NULL,
.extern_sids_count = ITS_EXT_ROT_SRV_COUNT,
.irq_mapper = NULL,
},
};
Expand All @@ -78,8 +78,8 @@ const uint32_t mem_region_count = 0;

// forward declaration of partition initializers
void client_tests_part1_init(spm_partition_t *partition);
void its_init(spm_partition_t *partition);
void psa_f_init(spm_partition_t *partition);
void its_init(spm_partition_t *partition);

uint32_t init_partitions(spm_partition_t **partitions)
{
Expand All @@ -88,8 +88,8 @@ uint32_t init_partitions(spm_partition_t **partitions)
}

client_tests_part1_init(&(g_partitions[0]));
its_init(&(g_partitions[1]));
psa_f_init(&(g_partitions[2]));
psa_f_init(&(g_partitions[1]));
its_init(&(g_partitions[2]));

*partitions = g_partitions;
return 3;
Expand Down
Loading