Skip to content

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//! Directory: `bionic/libc/kernel/uapi/linux/`
2+
//!
3+
//! <https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/kernel/uapi/linux/>
4+
5+
pub(crate) mod types;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//! * Header: `bionic/libc/kernel/uapi/linux/types.h`
2+
//! * Header: `bionic/libc/kernel/uapi/asm-generic/int-ll64.h`
3+
4+
use crate::prelude::*;
5+
6+
/* Definitions from `asm/types.h` -> `asm-generic/types.h` -> `asm-generic/int-ll64.h` */
7+
8+
pub type __u8 = c_uchar;
9+
10+
pub type __u16 = c_ushort;
11+
pub type __s16 = c_short;
12+
13+
pub type __u32 = c_uint;
14+
pub type __s32 = c_int;
15+
16+
pub type __s64 = c_longlong;
17+
pub type __u64 = c_ulonglong;
18+
19+
/* From `uapi/linux/types.h` */
20+
21+
pub type __be16 = __u16;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//! Directory: `bionic/libc/kernel/uapi`
2+
3+
pub(crate) mod linux;

src/new/bionic_libc/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
//! This directory maps to `bionic/libc/include` in the Android source.
1+
//! This directory maps to `bionic/libc/include` in the Android source. `bionic/libc/kernel` is
2+
//! the source of UAPI definitions, which are a cleaned form of the default Linux headers.
23
//!
3-
//! <https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/include/>
4+
//! <https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/include/>,
5+
//! <https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/kernel/uapi/>
46
7+
pub(crate) mod kernel_uapi;
58
pub(crate) mod pthread;
69
pub(crate) mod sys;
710
pub(crate) mod unistd;

src/new/linux_uapi/linux/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ pub(crate) mod membarrier;
1111
pub(crate) mod mount;
1212
pub(crate) mod netlink;
1313
pub(crate) mod pidfd;
14+
pub(crate) mod types;

src/new/linux_uapi/linux/types.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//! * Header: `uapi/linux/types.h`
2+
//! * Header: `uapi/asm-generic/int-ll64.h`
3+
4+
use crate::prelude::*;
5+
6+
/* Definitions from `asm/types.h` -> `asm-generic/types.h` -> `asm-generic/int-ll64.h` */
7+
8+
pub type __u8 = c_uchar;
9+
10+
pub type __u16 = c_ushort;
11+
pub type __s16 = c_short;
12+
13+
pub type __u32 = c_uint;
14+
pub type __s32 = c_int;
15+
16+
pub type __s64 = c_longlong;
17+
pub type __u64 = c_ulonglong;

src/new/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ cfg_if! {
173173
// Per-OS headers we export
174174
cfg_if! {
175175
if #[cfg(target_os = "android")] {
176+
use bionic_libc::kernel_uapi::linux;
177+
pub use linux::types::*;
176178
pub use sys::socket::*;
177179
} else if #[cfg(target_os = "linux")] {
178180
pub use linux::can::bcm::*;
@@ -188,6 +190,7 @@ cfg_if! {
188190
pub use linux::mount::*;
189191
pub use linux::netlink::*;
190192
pub use linux::pidfd::*;
193+
pub use linux::types::*;
191194
#[cfg(target_env = "gnu")]
192195
pub use net::route::*;
193196
} else if #[cfg(target_vendor = "apple")] {

src/unix/linux_like/android/b32/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ pub type off64_t = c_longlong;
88
pub type sigset_t = c_ulong;
99
pub type socklen_t = i32;
1010
pub type time64_t = i64;
11-
pub type __u64 = c_ulonglong;
12-
pub type __s64 = c_longlong;
1311

1412
s! {
1513
// FIXME(1.0): This should not implement `PartialEq`

src/unix/linux_like/android/b64/aarch64/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ use crate::off64_t;
22
use crate::prelude::*;
33

44
pub type wchar_t = u32;
5-
pub type __u64 = c_ulonglong;
6-
pub type __s64 = c_longlong;
75

86
s! {
97
pub struct stat {

src/unix/linux_like/android/b64/riscv64/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ use crate::prelude::*;
33

44
pub type wchar_t = u32;
55
pub type greg_t = i64;
6-
pub type __u64 = c_ulonglong;
7-
pub type __s64 = c_longlong;
86

97
s! {
108
pub struct stat {

0 commit comments

Comments
 (0)