1 /* 2 * Copyright (C) 2021 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 //! Trusty syscall wrappers. 18 //! 19 //! Provides an unsafe Rust interface to the Trusty OS syscalls without 20 //! requiring libc. 21 22 #![no_std] 23 #![allow(non_camel_case_types)] 24 25 mod err; 26 mod syscalls; 27 mod types; 28 29 mod sys { 30 use crate as trusty_sys; 31 32 include!(env!("BINDGEN_INC_FILE")); 33 34 impl uevent { 35 pub const ALL_EVENTS: u32 = u32::MAX; 36 } 37 } 38 39 pub use err::*; 40 pub use syscalls::*; 41 pub use types::*; 42 43 pub const STDOUT_FILENO: u32 = 1; 44 pub const STDERR_FILENO: u32 = 2; 45 46 pub use sys::{ 47 dma_pmem, handle_t, iovec, ipc_msg, ipc_msg_info, uevent, uuid, IPC_CONNECT_ASYNC, 48 IPC_CONNECT_WAIT_FOR_PORT, MMAP_FLAG_IO_HANDLE, MMAP_FLAG_PROT_READ, MMAP_FLAG_PROT_WRITE, 49 }; 50