Browse Source

aarch64-prep: Dummy auxv.h

For AArch64, the ring crate depends on the presence of this header and a definition
of getauxval.
Robin Randhawa 6 years ago
parent
commit
f9f752d74c
3 changed files with 18 additions and 0 deletions
  1. 1 0
      src/header/mod.rs
  2. 6 0
      src/header/sys_auxv/cbindgen.toml
  3. 11 0
      src/header/sys_auxv/mod.rs

+ 1 - 0
src/header/mod.rs

@@ -30,6 +30,7 @@ pub mod stdio;
 pub mod stdlib;
 pub mod string;
 pub mod strings;
+pub mod sys_auxv;
 pub mod sys_file;
 pub mod sys_ioctl;
 pub mod sys_mman;

+ 6 - 0
src/header/sys_auxv/cbindgen.toml

@@ -0,0 +1,6 @@
+include_guard = "_SYS_AUXV_H"
+language = "C"
+style = "Tag"
+
+[enum]
+prefix_with_name = true

+ 11 - 0
src/header/sys_auxv/mod.rs

@@ -0,0 +1,11 @@
+//! sys/auxv.h implementation
+
+use platform::types::*;
+use platform::{Pal, Sys};
+
+pub const AT_HWCAP: usize = 16;
+
+#[no_mangle]
+pub extern "C" fn getauxval(_t: c_ulong) -> c_ulong {
+    0
+}