mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-29 22:20:30 +00:00
Support psa-crypto repo in psa_storage.py
Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
parent
1d09184291
commit
42f42f4394
@ -27,6 +27,7 @@ from typing import Dict, List, Optional, Set, Union
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from . import c_build_helper
|
from . import c_build_helper
|
||||||
|
from . import build_tree
|
||||||
|
|
||||||
|
|
||||||
class Expr:
|
class Expr:
|
||||||
@ -51,13 +52,16 @@ class Expr:
|
|||||||
def update_cache(self) -> None:
|
def update_cache(self) -> None:
|
||||||
"""Update `value_cache` for expressions registered in `unknown_values`."""
|
"""Update `value_cache` for expressions registered in `unknown_values`."""
|
||||||
expressions = sorted(self.unknown_values)
|
expressions = sorted(self.unknown_values)
|
||||||
|
includes = ['include']
|
||||||
|
if build_tree.looks_like_psa_crypto_root('.'):
|
||||||
|
includes.append('drivers/builtin/include')
|
||||||
values = c_build_helper.get_c_expression_values(
|
values = c_build_helper.get_c_expression_values(
|
||||||
'unsigned long', '%lu',
|
'unsigned long', '%lu',
|
||||||
expressions,
|
expressions,
|
||||||
header="""
|
header="""
|
||||||
#include <psa/crypto.h>
|
#include <psa/crypto.h>
|
||||||
""",
|
""",
|
||||||
include_path=['include']) #type: List[str]
|
include_path=includes) #type: List[str]
|
||||||
for e, v in zip(expressions, values):
|
for e, v in zip(expressions, values):
|
||||||
self.value_cache[e] = int(v, 0)
|
self.value_cache[e] = int(v, 0)
|
||||||
self.unknown_values.clear()
|
self.unknown_values.clear()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user