Skip to content

Commit eb39b29

Browse files
author
wayne ren
committed
doc: update secureshield related docs and comments
1 parent eb7d2b6 commit eb39b29

File tree

4 files changed

+28
-7
lines changed

4 files changed

+28
-7
lines changed

doc/documents/example/example_compatibility_matrix_emsk22.doc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The first column is the project name. The second column is the project path. The
4949
| freertos_iot_lwm2m_iot_demo | example/freertos/iot/lwm2m/iot_demo | Os,O0,O1,O2,O3 | xx | Os,O0,O1,O2,O3 |
5050
| baremetal_secureshield_secret_secure_sid | example/baremetal/secureshield/secret_secure_sid | xx | xx | xx |
5151
| baremetal_cxx | example/baremetal/cxx | Os,O0,O1,O2,O3 | Os,O0,O1,O2,O3 | Os,O0,O1,O2,O3 |
52-
| baremetal_secureshield_secret | example/baremetal/secureshield/secret | xx | xx | xx |
52+
| baremetal_secureshield_secret_secure | example/baremetal/secureshield/secret_secure | xx | xx | xx |
5353
| freertos_net_ntshell | example/freertos/net/ntshell | Os,O0,O1,O2,O3 | xx | Os,O0,O1,O2,O3 |
5454
| freertos_sec_mbedtls_dtls_server | example/freertos/sec/mbedtls/dtls/server | Os,O0,O1,O2,O3 | xx | Os,O0,O1,O2,O3 |
5555
| contiki_xively_mqtt | example/contiki/xively_mqtt | Os,O0,O1,O2,O3 | Os,O0,O1,O2,O3 | Os,O0,O1,O2,O3 |
@@ -101,7 +101,7 @@ The first column is the project name. The second column is the project path. The
101101
| freertos_iot_lwm2m_iot_demo | example/freertos/iot/lwm2m/iot_demo | Os,O0,O1,O2,O3 | xx | Os,O0,O1,O2,O3 |
102102
| baremetal_secureshield_secret_secure_sid | example/baremetal/secureshield/secret_secure_sid | xx | xx | xx |
103103
| baremetal_cxx | example/baremetal/cxx | Os,O0,O1,O2,O3 | Os,O0,O1,O2,O3 | Os,O0,O1,O2,O3 |
104-
| baremetal_secureshield_secret | example/baremetal/secureshield/secret | xx | xx | xx |
104+
| baremetal_secureshield_secret_secure | example/baremetal/secureshield/secret_secure | xx | xx | xx |
105105
| freertos_net_ntshell | example/freertos/net/ntshell | Os,O0,O1,O2,O3 | xx | Os,O0,O1,O2,O3 |
106106
| freertos_sec_mbedtls_dtls_server | example/freertos/sec/mbedtls/dtls/server | Os,O0,O1,O2,O3 | xx | Os,O0,O1,O2,O3 |
107107
| contiki_xively_mqtt | example/contiki/xively_mqtt | Os,O0,O1,O2,O3 | Os,O0,O1,O2,O3 | Os,O0,O1,O2,O3 |

doc/documents/lib/lib_description.doc

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ According to this access control table, the container is allocated the periphera
108108
The resource type describes the kind of resource, such as interrupt, register, or memory. The access-control attribute describes how it is accessed: secure or normal, read/write/execute. The detailed definitions of resource type and access-control attribute can be found in secureshield_vmpu_exports.h.
109109

110110
## Secure Call
111-
In SecureShield, a secure call is implemented as a section of assembly code and invoked as a normal function call. The secure call is the only communication interface for a container to call secure functions. The following SecureShield runtime services are provided:
111+
In SecureShield, a secure call is implemented as a section of assembly code and invoked as a normal function call. The secure call is the only communication interface for a container to call the SecureShield runtime services. The following SecureShield runtime services are provided:
112112
- container call: call the services provided by other containers
113113
- interrupt management: see secureshield_int_exports.h
114114
- auxiliary-register access and benchmark function: see secureshield_sys_ops_exports.h
@@ -139,8 +139,13 @@ In SecureShield, a secure call is implemented as a section of assembly code and
139139
})
140140
\endcode
141141

142+
If SECURESHIELD_VERSION == 1, SECURE_INSTN is **trap_s**; If SECURESHIELD_VERSION == 2, SECURE_INSTN is **sjli**.
143+
144+
142145
### Container Call
143-
Although containers are isolated from each other, a container can provide services to other containers through container calls. This function or service must first be registered in an access control table. The background container has no interface.
146+
Although containers are isolated from each other, a container can provide services to other containers through container interface. The container interface must first be registered in the access control table. The background container has no interface as its resources are shared to all other containers.
147+
148+
To call a container interface, container all is required. The following is an example.
144149

145150
\code{.unparsed}
146151

@@ -162,6 +167,19 @@ ret = container_call(container1, tst_func2, 1, 2);
162167

163168
1 and 2 are arguments passed to tst_fun2, ret is the return value of tst_func.
164169

170+
The **container_call** will be expanded into the following assembly.
171+
172+
\code{.unparsed}
173+
mov r0, 1
174+
mov r1, 2
175+
SECURE_INSTN SECURESHIELD_SECURE_CALL_CONTAINER_IN
176+
b skip_args1
177+
.long SECURESHIELD_CONTAINER_CALL_MAGIC
178+
.long tst_func2
179+
.long container1_cfg_prt
180+
skip_args1:
181+
\endcode
182+
165183
Container calls can be nested, i.e., in a container interface, another container call can be made.
166184

167185
\htmlonly
@@ -174,6 +192,9 @@ Container calls can be nested, i.e., in a container interface, another container
174192
\endhtmlonly
175193
\image latex pic/secureshield_container_call.jpg "Container call" width=12cm
176194

195+
It should be noted that container call should not be made in the interrupt and exception handler.
196+
Because SecureShield runtime is not integrated with OS, in the container call which will cause container switch, task scheduler should be disabled to avoid task switch.
197+
177198

178199
## Memory Map
179200

@@ -329,7 +350,7 @@ Upon compiling and linking, the following files will be generated:
329350
\subsection sect_lib_secureshield_application SecureShield Application Examples
330351
There are several SecureShield application examples include in the embARC OSP distribution.
331352
- [baremetal/secureshield/test_case](\ref EMBARC_APP_BAREMETAL_SECURESHIELD_TEST_CASE) demonstrates and tests the features of SecureShield.
332-
- [baremetal/secureshield/secret](\ref EMBARC_APP_BAREMETAL_SECURESHIELD_SECRET) and its derived example [baremetal/secureshield/secret2](\ref EMBARC_APP_BAREMETAL_SECURESHIELD_SECRET2) shows examples of a secret being protected by a password.
353+
- [baremetal/secureshield/secret_secure](\ref EMBARC_APP_BAREMETAL_SECURESHIELD_SECRET_SECURE) and its derived example [baremetal/secureshield/secret_normal](\ref EMBARC_APP_BAREMETAL_SECURESHIELD_SECRET_NORMAL) [baremetal/secureshield/secret_secure_sid](\ref EMBARC_APP_BAREMETAL_SECURESHIELD_SECRET_SECURE_SID)shows examples of a secret being protected by a password.
333354
- [contiki/secureshield/dtls_client_ipv4](\ref EMBARC_APP_CONTIKI_SECURESHIELD_DTLS_CLIENT_IPV4) demonstrates how to integrate SecureShield in a full fledged application.
334355

335356
\subsubsection subsect_lib_secureshield_application_feature_app SecureShield Feature Example

example/baremetal/secureshield/secret_secure_sid/container2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
--------------------------------------------- */
3333
/**
3434
* \file
35-
* \ingroup EMBARC_APP_BAREMETAL_SECURESHIELD_SECRET_V2_SID
35+
* \ingroup EMBARC_APP_BAREMETAL_SECURESHIELD_SECRET_SECURE_SID
3636
* \brief secureshield container 2 implementation
3737
*/
3838
#ifndef CONTAINER2_H

example/baremetal/secureshield/test_case/container3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/**
3535
* \file
3636
* \ingroup EMBARC_APP_BAREMETAL_SECURESHIELD_TEST_CASE
37-
* \brief secureshield test example container3 source file
37+
* \brief secureshield test case example container3 source file
3838
*/
3939

4040
#include "embARC.h"

0 commit comments

Comments
 (0)