mirror of
https://github.com/openharmony/tee_tee_dev_kit.git
synced 2026-08-25 09:09:44 -04:00
no message
Match-id-c60f09f89d8d272f104870cfa2c9211cced1dc62
This commit is contained in:
@@ -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
|
||||
;;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user