no message

Match-id-c60f09f89d8d272f104870cfa2c9211cced1dc62
This commit is contained in:
xxx
2023-03-06 22:07:50 +08:00
committed by xxx
5 changed files with 46 additions and 3 deletions
+2 -2
View File
@@ -24,7 +24,7 @@ cur_dir=$(cd "$(dirname "$0")"; pwd)
echo "build_rust_drv.sh is at dir: $cur_dir"
name=$1
std=$2
features=$4
features=$3
function clean() {
rm -rf ./target
@@ -44,7 +44,7 @@ function build_rust_drv() {
rust_so="$release_path/lib$name.so"
combile_so="$release_path/libcombine.so"
case "$std" in
"core") cargo +$os build $features -Z build-std=core --target=$target --release
"core") cargo +$os build $features --target=$target --release
;;
"std") cargo +$os build $features --target=$target --release
;;
+1
View File
@@ -19,6 +19,7 @@ pub mod hwi_api;
pub mod io_api;
pub mod map_api;
pub mod mem_copy_api;
pub mod reg_api;
pub mod share_mem_api;
pub use framework::tee_defines::TeeResult;
+20
View File
@@ -0,0 +1,20 @@
// Copyright (C) 2023 Huawei Technologies Co., Ltd.
// Licensed under the Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan
// PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
// KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
mod reg_api_ffi;
#[repr(C)]
pub struct RegApi {}
impl RegApi {
pub fn read_mpidr_el1() -> i64 {
unsafe { reg_api_ffi::drv_read_mpidr_el1() }
}
}
@@ -0,0 +1,22 @@
// Copyright (C) 2023 Huawei Technologies Co., Ltd.
// Licensed under the Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan
// PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
// KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
extern "C" {
///
/// read mpidr el1 for cpu
///
/// # Parameters
/// None
///
/// # Return
/// mpidr el1
pub fn drv_read_mpidr_el1() -> i64;
}
+1 -1
View File
@@ -46,7 +46,7 @@ function build_rust_ta() {
rust_so="$release_path/lib$name.so"
combile_so="$release_path/libcombine.so"
case "$std" in
"core") cargo +$os build $features -Z build-std=core --target=$target --release
"core") cargo +$os build $features --target=$target --release
;;
"std") cargo +$os build $features --target=$target --release
;;