|
| 1 | +// Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +// or more contributor license agreements. See the NOTICE file |
| 3 | +// distributed with this work for additional information |
| 4 | +// regarding copyright ownership. The ASF licenses this file |
| 5 | +// to you under the Apache License, Version 2.0 (the |
| 6 | +// "License"); you may not use this file except in compliance |
| 7 | +// with the License. You may obtain a copy of the License at |
| 8 | +// |
| 9 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +// |
| 11 | +// Unless required by applicable law or agreed to in writing, |
| 12 | +// software distributed under the License is distributed on an |
| 13 | +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +// KIND, either express or implied. See the License for the |
| 15 | +// specific language governing permissions and limitations |
| 16 | +// under the License. |
| 17 | + |
| 18 | +#![no_std] |
| 19 | +use num_enum::{FromPrimitive, IntoPrimitive}; |
| 20 | + |
| 21 | +// For CA-TA invocation: |
| 22 | +#[derive(FromPrimitive, IntoPrimitive)] |
| 23 | +#[repr(u32)] |
| 24 | +pub enum Command { |
| 25 | + Test, |
| 26 | + #[default] |
| 27 | + Unknown, |
| 28 | +} |
| 29 | + |
| 30 | +// If Uuid::parse_str() returns an InvalidLength error, there may be an extra |
| 31 | +// newline in your uuid.txt file. You can remove it by running |
| 32 | +// `truncate -s 36 uuid.txt`. |
| 33 | +pub const UUID: &str = &include_str!("../../uuid.txt"); |
| 34 | + |
| 35 | +// For TA-TA invocation testcases: |
| 36 | +#[derive(FromPrimitive, IntoPrimitive)] |
| 37 | +#[repr(u32)] |
| 38 | +pub enum SystemPtaCommand { |
| 39 | + AddRngEntropy, |
| 40 | + DeriveTaUniqueKey, |
| 41 | + // We omit other commands here. |
| 42 | + // Full definitions can be found in optee_os system_pta.h. |
| 43 | + #[default] |
| 44 | + Unknown, |
| 45 | +} |
| 46 | + |
| 47 | +#[derive(FromPrimitive, IntoPrimitive)] |
| 48 | +#[repr(u32)] |
| 49 | +pub enum HelloWorldTaCommand { |
| 50 | + IncValue, |
| 51 | + DecValue, |
| 52 | + #[default] |
| 53 | + Unknown, |
| 54 | +} |
| 55 | + |
| 56 | +pub const SYSTEM_PTA_UUID: &str = "3a2f8978-5dc0-11e8-9c2d-fa7ae01bbebc"; |
| 57 | +pub const HELLO_WORLD_USER_TA_UUID: &str = "133af0ca-bdab-11eb-9130-43bf7873bf67"; |
0 commit comments