From ad3037d0f6bdf06314103650532e015b7506614c Mon Sep 17 00:00:00 2001 From: occheung Date: Fri, 6 Aug 2021 10:51:13 +0800 Subject: [PATCH] libc: add minimal C types --- artiq/firmware/libc/Cargo.toml | 5 +++++ artiq/firmware/libc/src/lib.rs | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 artiq/firmware/libc/Cargo.toml create mode 100644 artiq/firmware/libc/src/lib.rs diff --git a/artiq/firmware/libc/Cargo.toml b/artiq/firmware/libc/Cargo.toml new file mode 100644 index 000000000..7231c77c4 --- /dev/null +++ b/artiq/firmware/libc/Cargo.toml @@ -0,0 +1,5 @@ +[package] +name = "libc" +version = "0.1.0" +authors = ["M-Labs"] +edition = "2018" diff --git a/artiq/firmware/libc/src/lib.rs b/artiq/firmware/libc/src/lib.rs new file mode 100644 index 000000000..e5eb97a23 --- /dev/null +++ b/artiq/firmware/libc/src/lib.rs @@ -0,0 +1,8 @@ +// Helper crate for dealing with c ffi +#![allow(non_camel_case_types)] +#![no_std] +pub type c_char = i8; +pub type c_int = i32; +pub type size_t = usize; +pub type uintptr_t = usize; +pub type c_void = core::ffi::c_void;