chore: add vendor dependencies for kauma build
This commit is contained in:
parent
7c94e5d8fb
commit
067ef6141c
1758 changed files with 398473 additions and 0 deletions
220
vendor/libc/src/unix/solarish/compat.rs
vendored
Normal file
220
vendor/libc/src/unix/solarish/compat.rs
vendored
Normal file
|
|
@ -0,0 +1,220 @@
|
|||
// Common functions that are unfortunately missing on illumos and
|
||||
// Solaris, but often needed by other crates.
|
||||
|
||||
use core::cmp::min;
|
||||
use unix::solarish::*;
|
||||
|
||||
const PTEM: &[u8] = b"ptem\0";
|
||||
const LDTERM: &[u8] = b"ldterm\0";
|
||||
|
||||
pub unsafe fn cfmakeraw(termios: *mut ::termios) {
|
||||
(*termios).c_iflag &=
|
||||
!(IMAXBEL | IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);
|
||||
(*termios).c_oflag &= !OPOST;
|
||||
(*termios).c_lflag &= !(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
|
||||
(*termios).c_cflag &= !(CSIZE | PARENB);
|
||||
(*termios).c_cflag |= CS8;
|
||||
|
||||
// By default, most software expects a pending read to block until at
|
||||
// least one byte becomes available. As per termio(7I), this requires
|
||||
// setting the MIN and TIME parameters appropriately.
|
||||
//
|
||||
// As a somewhat unfortunate artefact of history, the MIN and TIME slots
|
||||
// in the control character array overlap with the EOF and EOL slots used
|
||||
// for canonical mode processing. Because the EOF character needs to be
|
||||
// the ASCII EOT value (aka Control-D), it has the byte value 4. When
|
||||
// switching to raw mode, this is interpreted as a MIN value of 4; i.e.,
|
||||
// reads will block until at least four bytes have been input.
|
||||
//
|
||||
// Other platforms with a distinct MIN slot like Linux and FreeBSD appear
|
||||
// to default to a MIN value of 1, so we'll force that value here:
|
||||
(*termios).c_cc[VMIN] = 1;
|
||||
(*termios).c_cc[VTIME] = 0;
|
||||
}
|
||||
|
||||
pub unsafe fn cfsetspeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int {
|
||||
// Neither of these functions on illumos or Solaris actually ever
|
||||
// return an error
|
||||
::cfsetispeed(termios, speed);
|
||||
::cfsetospeed(termios, speed);
|
||||
0
|
||||
}
|
||||
|
||||
unsafe fn bail(fdm: ::c_int, fds: ::c_int) -> ::c_int {
|
||||
let e = *___errno();
|
||||
if fds >= 0 {
|
||||
::close(fds);
|
||||
}
|
||||
if fdm >= 0 {
|
||||
::close(fdm);
|
||||
}
|
||||
*___errno() = e;
|
||||
return -1;
|
||||
}
|
||||
|
||||
pub unsafe fn openpty(
|
||||
amain: *mut ::c_int,
|
||||
asubord: *mut ::c_int,
|
||||
name: *mut ::c_char,
|
||||
termp: *const termios,
|
||||
winp: *const ::winsize,
|
||||
) -> ::c_int {
|
||||
// Open the main pseudo-terminal device, making sure not to set it as the
|
||||
// controlling terminal for this process:
|
||||
let fdm = ::posix_openpt(O_RDWR | O_NOCTTY);
|
||||
if fdm < 0 {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Set permissions and ownership on the subordinate device and unlock it:
|
||||
if ::grantpt(fdm) < 0 || ::unlockpt(fdm) < 0 {
|
||||
return bail(fdm, -1);
|
||||
}
|
||||
|
||||
// Get the path name of the subordinate device:
|
||||
let subordpath = ::ptsname(fdm);
|
||||
if subordpath.is_null() {
|
||||
return bail(fdm, -1);
|
||||
}
|
||||
|
||||
// Open the subordinate device without setting it as the controlling
|
||||
// terminal for this process:
|
||||
let fds = ::open(subordpath, O_RDWR | O_NOCTTY);
|
||||
if fds < 0 {
|
||||
return bail(fdm, -1);
|
||||
}
|
||||
|
||||
// Check if the STREAMS modules are already pushed:
|
||||
let setup = ::ioctl(fds, I_FIND, LDTERM.as_ptr());
|
||||
if setup < 0 {
|
||||
return bail(fdm, fds);
|
||||
} else if setup == 0 {
|
||||
// The line discipline is not present, so push the appropriate STREAMS
|
||||
// modules for the subordinate device:
|
||||
if ::ioctl(fds, I_PUSH, PTEM.as_ptr()) < 0 || ::ioctl(fds, I_PUSH, LDTERM.as_ptr()) < 0 {
|
||||
return bail(fdm, fds);
|
||||
}
|
||||
}
|
||||
|
||||
// If provided, set the terminal parameters:
|
||||
if !termp.is_null() && ::tcsetattr(fds, TCSAFLUSH, termp) != 0 {
|
||||
return bail(fdm, fds);
|
||||
}
|
||||
|
||||
// If provided, set the window size:
|
||||
if !winp.is_null() && ::ioctl(fds, TIOCSWINSZ, winp) < 0 {
|
||||
return bail(fdm, fds);
|
||||
}
|
||||
|
||||
// If the caller wants the name of the subordinate device, copy it out.
|
||||
//
|
||||
// Note that this is a terrible interface: there appears to be no standard
|
||||
// upper bound on the copy length for this pointer. Nobody should pass
|
||||
// anything but NULL here, preferring instead to use ptsname(3C) directly.
|
||||
if !name.is_null() {
|
||||
::strcpy(name, subordpath);
|
||||
}
|
||||
|
||||
*amain = fdm;
|
||||
*asubord = fds;
|
||||
0
|
||||
}
|
||||
|
||||
pub unsafe fn forkpty(
|
||||
amain: *mut ::c_int,
|
||||
name: *mut ::c_char,
|
||||
termp: *const termios,
|
||||
winp: *const ::winsize,
|
||||
) -> ::pid_t {
|
||||
let mut fds = -1;
|
||||
|
||||
if openpty(amain, &mut fds, name, termp, winp) != 0 {
|
||||
return -1;
|
||||
}
|
||||
|
||||
let pid = ::fork();
|
||||
if pid < 0 {
|
||||
return bail(*amain, fds);
|
||||
} else if pid > 0 {
|
||||
// In the parent process, we close the subordinate device and return the
|
||||
// process ID of the new child:
|
||||
::close(fds);
|
||||
return pid;
|
||||
}
|
||||
|
||||
// The rest of this function executes in the child process.
|
||||
|
||||
// Close the main side of the pseudo-terminal pair:
|
||||
::close(*amain);
|
||||
|
||||
// Use TIOCSCTTY to set the subordinate device as our controlling
|
||||
// terminal. This will fail (with ENOTTY) if we are not the leader in
|
||||
// our own session, so we call setsid() first. Finally, arrange for
|
||||
// the pseudo-terminal to occupy the standard I/O descriptors.
|
||||
if ::setsid() < 0
|
||||
|| ::ioctl(fds, TIOCSCTTY, 0) < 0
|
||||
|| ::dup2(fds, 0) < 0
|
||||
|| ::dup2(fds, 1) < 0
|
||||
|| ::dup2(fds, 2) < 0
|
||||
{
|
||||
// At this stage there are no particularly good ways to handle failure.
|
||||
// Exit as abruptly as possible, using _exit() to avoid messing with any
|
||||
// state still shared with the parent process.
|
||||
::_exit(EXIT_FAILURE);
|
||||
}
|
||||
// Close the inherited descriptor, taking care to avoid closing the standard
|
||||
// descriptors by mistake:
|
||||
if fds > 2 {
|
||||
::close(fds);
|
||||
}
|
||||
|
||||
0
|
||||
}
|
||||
|
||||
pub unsafe fn getpwent_r(
|
||||
pwd: *mut passwd,
|
||||
buf: *mut ::c_char,
|
||||
buflen: ::size_t,
|
||||
result: *mut *mut passwd,
|
||||
) -> ::c_int {
|
||||
let old_errno = *::___errno();
|
||||
*::___errno() = 0;
|
||||
*result = native_getpwent_r(
|
||||
pwd,
|
||||
buf,
|
||||
min(buflen, ::c_int::max_value() as ::size_t) as ::c_int,
|
||||
);
|
||||
|
||||
let ret = if (*result).is_null() {
|
||||
*::___errno()
|
||||
} else {
|
||||
0
|
||||
};
|
||||
*::___errno() = old_errno;
|
||||
|
||||
ret
|
||||
}
|
||||
|
||||
pub unsafe fn getgrent_r(
|
||||
grp: *mut ::group,
|
||||
buf: *mut ::c_char,
|
||||
buflen: ::size_t,
|
||||
result: *mut *mut ::group,
|
||||
) -> ::c_int {
|
||||
let old_errno = *::___errno();
|
||||
*::___errno() = 0;
|
||||
*result = native_getgrent_r(
|
||||
grp,
|
||||
buf,
|
||||
min(buflen, ::c_int::max_value() as ::size_t) as ::c_int,
|
||||
);
|
||||
|
||||
let ret = if (*result).is_null() {
|
||||
*::___errno()
|
||||
} else {
|
||||
0
|
||||
};
|
||||
*::___errno() = old_errno;
|
||||
|
||||
ret
|
||||
}
|
||||
115
vendor/libc/src/unix/solarish/illumos.rs
vendored
Normal file
115
vendor/libc/src/unix/solarish/illumos.rs
vendored
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
s! {
|
||||
pub struct shmid_ds {
|
||||
pub shm_perm: ::ipc_perm,
|
||||
pub shm_segsz: ::size_t,
|
||||
pub shm_amp: *mut ::c_void,
|
||||
pub shm_lkcnt: ::c_ushort,
|
||||
pub shm_lpid: ::pid_t,
|
||||
pub shm_cpid: ::pid_t,
|
||||
pub shm_nattch: ::shmatt_t,
|
||||
pub shm_cnattch: ::c_ulong,
|
||||
pub shm_atime: ::time_t,
|
||||
pub shm_dtime: ::time_t,
|
||||
pub shm_ctime: ::time_t,
|
||||
pub shm_pad4: [i64; 4],
|
||||
}
|
||||
|
||||
pub struct fil_info {
|
||||
pub fi_flags: ::c_int,
|
||||
pub fi_pos: ::c_int,
|
||||
pub fi_name: [::c_char; ::FILNAME_MAX as usize],
|
||||
}
|
||||
}
|
||||
|
||||
pub const AF_LOCAL: ::c_int = 1; // AF_UNIX
|
||||
pub const AF_FILE: ::c_int = 1; // AF_UNIX
|
||||
|
||||
pub const EFD_SEMAPHORE: ::c_int = 0x1;
|
||||
pub const EFD_NONBLOCK: ::c_int = 0x800;
|
||||
pub const EFD_CLOEXEC: ::c_int = 0x80000;
|
||||
|
||||
pub const POLLRDHUP: ::c_short = 0x4000;
|
||||
|
||||
pub const TCP_KEEPIDLE: ::c_int = 34;
|
||||
pub const TCP_KEEPCNT: ::c_int = 35;
|
||||
pub const TCP_KEEPINTVL: ::c_int = 36;
|
||||
pub const TCP_CONGESTION: ::c_int = 37;
|
||||
|
||||
// These constants are correct for 64-bit programs or 32-bit programs that are
|
||||
// not using large-file mode. If Rust ever supports anything other than 64-bit
|
||||
// compilation on illumos, this may require adjustment:
|
||||
pub const F_OFD_GETLK: ::c_int = 47;
|
||||
pub const F_OFD_SETLK: ::c_int = 48;
|
||||
pub const F_OFD_SETLKW: ::c_int = 49;
|
||||
pub const F_FLOCK: ::c_int = 53;
|
||||
pub const F_FLOCKW: ::c_int = 54;
|
||||
|
||||
pub const F_DUPFD_CLOEXEC: ::c_int = 37;
|
||||
pub const F_DUP2FD_CLOEXEC: ::c_int = 36;
|
||||
|
||||
pub const FIL_ATTACH: ::c_int = 0x1;
|
||||
pub const FIL_DETACH: ::c_int = 0x2;
|
||||
pub const FIL_LIST: ::c_int = 0x3;
|
||||
pub const FILNAME_MAX: ::c_int = 32;
|
||||
pub const FILF_PROG: ::c_int = 0x1;
|
||||
pub const FILF_AUTO: ::c_int = 0x2;
|
||||
pub const FILF_BYPASS: ::c_int = 0x4;
|
||||
pub const SOL_FILTER: ::c_int = 0xfffc;
|
||||
|
||||
pub const MADV_PURGE: ::c_int = 9;
|
||||
|
||||
pub const POSIX_FADV_NORMAL: ::c_int = 0;
|
||||
pub const POSIX_FADV_RANDOM: ::c_int = 1;
|
||||
pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
|
||||
pub const POSIX_FADV_WILLNEED: ::c_int = 3;
|
||||
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
|
||||
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
|
||||
|
||||
pub const B1000000: ::speed_t = 24;
|
||||
pub const B1152000: ::speed_t = 25;
|
||||
pub const B1500000: ::speed_t = 26;
|
||||
pub const B2000000: ::speed_t = 27;
|
||||
pub const B2500000: ::speed_t = 28;
|
||||
pub const B3000000: ::speed_t = 29;
|
||||
pub const B3500000: ::speed_t = 30;
|
||||
pub const B4000000: ::speed_t = 31;
|
||||
|
||||
// sys/systeminfo.h
|
||||
pub const SI_ADDRESS_WIDTH: ::c_int = 520;
|
||||
|
||||
extern "C" {
|
||||
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
|
||||
|
||||
pub fn mincore(addr: ::caddr_t, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
|
||||
|
||||
pub fn pset_bind_lwp(
|
||||
pset: ::psetid_t,
|
||||
id: ::id_t,
|
||||
pid: ::pid_t,
|
||||
opset: *mut ::psetid_t,
|
||||
) -> ::c_int;
|
||||
pub fn pset_getloadavg(pset: ::psetid_t, load: *mut ::c_double, num: ::c_int) -> ::c_int;
|
||||
|
||||
pub fn pthread_attr_get_np(thread: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
|
||||
pub fn pthread_attr_getstackaddr(
|
||||
attr: *const ::pthread_attr_t,
|
||||
stackaddr: *mut *mut ::c_void,
|
||||
) -> ::c_int;
|
||||
pub fn pthread_attr_setstack(
|
||||
attr: *mut ::pthread_attr_t,
|
||||
stackaddr: *mut ::c_void,
|
||||
stacksize: ::size_t,
|
||||
) -> ::c_int;
|
||||
pub fn pthread_attr_setstackaddr(
|
||||
attr: *mut ::pthread_attr_t,
|
||||
stackaddr: *mut ::c_void,
|
||||
) -> ::c_int;
|
||||
|
||||
pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advice: ::c_int) -> ::c_int;
|
||||
pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
|
||||
pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
|
||||
-> ::ssize_t;
|
||||
pub fn getpagesizes2(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int;
|
||||
|
||||
pub fn ptsname_r(fildes: ::c_int, name: *mut ::c_char, namelen: ::size_t) -> ::c_int;
|
||||
}
|
||||
3331
vendor/libc/src/unix/solarish/mod.rs
vendored
Normal file
3331
vendor/libc/src/unix/solarish/mod.rs
vendored
Normal file
File diff suppressed because it is too large
Load diff
101
vendor/libc/src/unix/solarish/solaris.rs
vendored
Normal file
101
vendor/libc/src/unix/solarish/solaris.rs
vendored
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
pub type door_attr_t = ::c_uint;
|
||||
pub type door_id_t = ::c_ulonglong;
|
||||
|
||||
s! {
|
||||
pub struct shmid_ds {
|
||||
pub shm_perm: ::ipc_perm,
|
||||
pub shm_segsz: ::size_t,
|
||||
pub shm_flags: ::uintptr_t,
|
||||
pub shm_lkcnt: ::c_ushort,
|
||||
pub shm_lpid: ::pid_t,
|
||||
pub shm_cpid: ::pid_t,
|
||||
pub shm_nattch: ::shmatt_t,
|
||||
pub shm_cnattch: ::c_ulong,
|
||||
pub shm_atime: ::time_t,
|
||||
pub shm_dtime: ::time_t,
|
||||
pub shm_ctime: ::time_t,
|
||||
pub shm_amp: *mut ::c_void,
|
||||
pub shm_gransize: u64,
|
||||
pub shm_allocated: u64,
|
||||
pub shm_pad4: [i64; 1],
|
||||
}
|
||||
|
||||
pub struct door_desc_t__d_data__d_desc {
|
||||
pub d_descriptor: ::c_int,
|
||||
pub d_id: ::door_id_t
|
||||
}
|
||||
}
|
||||
|
||||
s_no_extra_traits! {
|
||||
#[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
|
||||
pub union door_desc_t__d_data {
|
||||
pub d_desc: door_desc_t__d_data__d_desc,
|
||||
d_resv: [::c_int; 5], /* Check out /usr/include/sys/door.h */
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
|
||||
pub struct door_desc_t {
|
||||
pub d_attributes: door_attr_t,
|
||||
pub d_data: door_desc_t__d_data,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
|
||||
pub struct door_arg_t {
|
||||
pub data_ptr: *const ::c_char,
|
||||
pub data_size: ::size_t,
|
||||
pub desc_ptr: *const door_desc_t,
|
||||
pub dec_num: ::c_uint,
|
||||
pub rbuf: *const ::c_char,
|
||||
pub rsize: ::size_t,
|
||||
}
|
||||
}
|
||||
|
||||
pub const PORT_SOURCE_POSTWAIT: ::c_int = 8;
|
||||
pub const PORT_SOURCE_SIGNAL: ::c_int = 9;
|
||||
|
||||
pub const AF_LOCAL: ::c_int = 0;
|
||||
pub const AF_FILE: ::c_int = 0;
|
||||
|
||||
pub const TCP_KEEPIDLE: ::c_int = 0x1d;
|
||||
pub const TCP_KEEPINTVL: ::c_int = 0x1e;
|
||||
pub const TCP_KEEPCNT: ::c_int = 0x1f;
|
||||
|
||||
pub const F_DUPFD_CLOEXEC: ::c_int = 47;
|
||||
pub const F_DUPFD_CLOFORK: ::c_int = 49;
|
||||
pub const F_DUP2FD_CLOEXEC: ::c_int = 48;
|
||||
pub const F_DUP2FD_CLOFORK: ::c_int = 50;
|
||||
|
||||
extern "C" {
|
||||
pub fn fexecve(
|
||||
fd: ::c_int,
|
||||
argv: *const *const ::c_char,
|
||||
envp: *const *const ::c_char,
|
||||
) -> ::c_int;
|
||||
|
||||
pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
|
||||
|
||||
pub fn door_call(d: ::c_int, params: *const door_arg_t) -> ::c_int;
|
||||
pub fn door_return(
|
||||
data_ptr: *const ::c_char,
|
||||
data_size: ::size_t,
|
||||
desc_ptr: *const door_desc_t,
|
||||
num_desc: ::c_uint,
|
||||
);
|
||||
pub fn door_create(
|
||||
server_procedure: extern "C" fn(
|
||||
cookie: *const ::c_void,
|
||||
argp: *const ::c_char,
|
||||
arg_size: ::size_t,
|
||||
dp: *const door_desc_t,
|
||||
n_desc: ::c_uint,
|
||||
),
|
||||
cookie: *const ::c_void,
|
||||
attributes: door_attr_t,
|
||||
) -> ::c_int;
|
||||
|
||||
pub fn fattach(fildes: ::c_int, path: *const ::c_char) -> ::c_int;
|
||||
|
||||
pub fn pthread_getattr_np(thread: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
|
||||
|
||||
pub fn euidaccess(path: *const ::c_char, amode: ::c_int) -> ::c_int;
|
||||
}
|
||||
29
vendor/libc/src/unix/solarish/x86.rs
vendored
Normal file
29
vendor/libc/src/unix/solarish/x86.rs
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
pub type Elf32_Addr = ::c_ulong;
|
||||
pub type Elf32_Half = ::c_ushort;
|
||||
pub type Elf32_Off = ::c_ulong;
|
||||
pub type Elf32_Sword = ::c_long;
|
||||
pub type Elf32_Word = ::c_ulong;
|
||||
pub type Elf32_Lword = ::c_ulonglong;
|
||||
pub type Elf32_Phdr = __c_anonymous_Elf32_Phdr;
|
||||
|
||||
s! {
|
||||
pub struct __c_anonymous_Elf32_Phdr {
|
||||
pub p_type: ::Elf32_Word,
|
||||
pub p_offset: ::Elf32_Off,
|
||||
pub p_vaddr: ::Elf32_Addr,
|
||||
pub p_paddr: ::Elf32_Addr,
|
||||
pub p_filesz: ::Elf32_Word,
|
||||
pub p_memsz: ::Elf32_Word,
|
||||
pub p_flags: ::Elf32_Word,
|
||||
pub p_align: ::Elf32_Word,
|
||||
}
|
||||
|
||||
pub struct dl_phdr_info {
|
||||
pub dlpi_addr: ::Elf32_Addr,
|
||||
pub dlpi_name: *const ::c_char,
|
||||
pub dlpi_phdr: *const ::Elf32_Phdr,
|
||||
pub dlpi_phnum: ::Elf32_Half,
|
||||
pub dlpi_adds: ::c_ulonglong,
|
||||
pub dlpi_subs: ::c_ulonglong,
|
||||
}
|
||||
}
|
||||
190
vendor/libc/src/unix/solarish/x86_64.rs
vendored
Normal file
190
vendor/libc/src/unix/solarish/x86_64.rs
vendored
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
pub type greg_t = ::c_long;
|
||||
|
||||
pub type Elf64_Addr = ::c_ulong;
|
||||
pub type Elf64_Half = ::c_ushort;
|
||||
pub type Elf64_Off = ::c_ulong;
|
||||
pub type Elf64_Sword = ::c_int;
|
||||
pub type Elf64_Sxword = ::c_long;
|
||||
pub type Elf64_Word = ::c_uint;
|
||||
pub type Elf64_Xword = ::c_ulong;
|
||||
pub type Elf64_Lword = ::c_ulong;
|
||||
pub type Elf64_Phdr = __c_anonymous_Elf64_Phdr;
|
||||
|
||||
s! {
|
||||
pub struct __c_anonymous_fpchip_state {
|
||||
pub cw: u16,
|
||||
pub sw: u16,
|
||||
pub fctw: u8,
|
||||
pub __fx_rsvd: u8,
|
||||
pub fop: u16,
|
||||
pub rip: u64,
|
||||
pub rdp: u64,
|
||||
pub mxcsr: u32,
|
||||
pub mxcsr_mask: u32,
|
||||
pub st: [::upad128_t; 8],
|
||||
pub xmm: [::upad128_t; 16],
|
||||
pub __fx_ign: [::upad128_t; 6],
|
||||
pub status: u32,
|
||||
pub xstatus: u32,
|
||||
}
|
||||
|
||||
pub struct __c_anonymous_Elf64_Phdr {
|
||||
pub p_type: ::Elf64_Word,
|
||||
pub p_flags: ::Elf64_Word,
|
||||
pub p_offset: ::Elf64_Off,
|
||||
pub p_vaddr: ::Elf64_Addr,
|
||||
pub p_paddr: ::Elf64_Addr,
|
||||
pub p_filesz: ::Elf64_Xword,
|
||||
pub p_memsz: ::Elf64_Xword,
|
||||
pub p_align: ::Elf64_Xword,
|
||||
}
|
||||
|
||||
pub struct dl_phdr_info {
|
||||
pub dlpi_addr: ::Elf64_Addr,
|
||||
pub dlpi_name: *const ::c_char,
|
||||
pub dlpi_phdr: *const ::Elf64_Phdr,
|
||||
pub dlpi_phnum: ::Elf64_Half,
|
||||
pub dlpi_adds: ::c_ulonglong,
|
||||
pub dlpi_subs: ::c_ulonglong,
|
||||
}
|
||||
}
|
||||
|
||||
s_no_extra_traits! {
|
||||
#[cfg(libc_union)]
|
||||
pub union __c_anonymous_fp_reg_set {
|
||||
pub fpchip_state: __c_anonymous_fpchip_state,
|
||||
pub f_fpregs: [[u32; 13]; 10],
|
||||
}
|
||||
|
||||
pub struct fpregset_t {
|
||||
pub fp_reg_set: __c_anonymous_fp_reg_set,
|
||||
}
|
||||
|
||||
pub struct mcontext_t {
|
||||
pub gregs: [::greg_t; 28],
|
||||
pub fpregs: fpregset_t,
|
||||
}
|
||||
|
||||
pub struct ucontext_t {
|
||||
pub uc_flags: ::c_ulong,
|
||||
pub uc_link: *mut ucontext_t,
|
||||
pub uc_sigmask: ::sigset_t,
|
||||
pub uc_stack: ::stack_t,
|
||||
pub uc_mcontext: mcontext_t,
|
||||
pub uc_filler: [::c_long; 5],
|
||||
}
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
if #[cfg(feature = "extra_traits")] {
|
||||
#[cfg(libc_union)]
|
||||
impl PartialEq for __c_anonymous_fp_reg_set {
|
||||
fn eq(&self, other: &__c_anonymous_fp_reg_set) -> bool {
|
||||
unsafe {
|
||||
self.fpchip_state == other.fpchip_state ||
|
||||
self.
|
||||
f_fpregs.
|
||||
iter().
|
||||
zip(other.f_fpregs.iter()).
|
||||
all(|(a, b)| a == b)
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(libc_union)]
|
||||
impl Eq for __c_anonymous_fp_reg_set {}
|
||||
#[cfg(libc_union)]
|
||||
impl ::fmt::Debug for __c_anonymous_fp_reg_set {
|
||||
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
|
||||
unsafe {
|
||||
f.debug_struct("__c_anonymous_fp_reg_set")
|
||||
.field("fpchip_state", &{self.fpchip_state})
|
||||
.field("f_fpregs", &{self.f_fpregs})
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
impl PartialEq for fpregset_t {
|
||||
fn eq(&self, other: &fpregset_t) -> bool {
|
||||
self.fp_reg_set == other.fp_reg_set
|
||||
}
|
||||
}
|
||||
impl Eq for fpregset_t {}
|
||||
impl ::fmt::Debug for fpregset_t {
|
||||
fn fmt(&self, f:&mut ::fmt::Formatter) -> ::fmt::Result {
|
||||
f.debug_struct("fpregset_t")
|
||||
.field("fp_reg_set", &self.fp_reg_set)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
impl PartialEq for mcontext_t {
|
||||
fn eq(&self, other: &mcontext_t) -> bool {
|
||||
self.gregs == other.gregs &&
|
||||
self.fpregs == other.fpregs
|
||||
}
|
||||
}
|
||||
impl Eq for mcontext_t {}
|
||||
impl ::fmt::Debug for mcontext_t {
|
||||
fn fmt(&self, f:&mut ::fmt::Formatter) -> ::fmt::Result {
|
||||
f.debug_struct("mcontext_t")
|
||||
.field("gregs", &self.gregs)
|
||||
.field("fpregs", &self.fpregs)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
impl PartialEq for ucontext_t {
|
||||
fn eq(&self, other: &ucontext_t) -> bool {
|
||||
self.uc_flags == other.uc_flags
|
||||
&& self.uc_link == other.uc_link
|
||||
&& self.uc_sigmask == other.uc_sigmask
|
||||
&& self.uc_stack == other.uc_stack
|
||||
&& self.uc_mcontext == other.uc_mcontext
|
||||
&& self.uc_filler == other.uc_filler
|
||||
}
|
||||
}
|
||||
impl Eq for ucontext_t {}
|
||||
impl ::fmt::Debug for ucontext_t {
|
||||
fn fmt(&self, f:&mut ::fmt::Formatter) -> ::fmt::Result {
|
||||
f.debug_struct("ucontext_t")
|
||||
.field("uc_flags", &self.uc_flags)
|
||||
.field("uc_link", &self.uc_link)
|
||||
.field("uc_sigmask", &self.uc_sigmask)
|
||||
.field("uc_stack", &self.uc_stack)
|
||||
.field("uc_mcontext", &self.uc_mcontext)
|
||||
.field("uc_filler", &self.uc_filler)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// sys/regset.h
|
||||
|
||||
pub const REG_GSBASE: ::c_int = 27;
|
||||
pub const REG_FSBASE: ::c_int = 26;
|
||||
pub const REG_DS: ::c_int = 25;
|
||||
pub const REG_ES: ::c_int = 24;
|
||||
pub const REG_GS: ::c_int = 23;
|
||||
pub const REG_FS: ::c_int = 22;
|
||||
pub const REG_SS: ::c_int = 21;
|
||||
pub const REG_RSP: ::c_int = 20;
|
||||
pub const REG_RFL: ::c_int = 19;
|
||||
pub const REG_CS: ::c_int = 18;
|
||||
pub const REG_RIP: ::c_int = 17;
|
||||
pub const REG_ERR: ::c_int = 16;
|
||||
pub const REG_TRAPNO: ::c_int = 15;
|
||||
pub const REG_RAX: ::c_int = 14;
|
||||
pub const REG_RCX: ::c_int = 13;
|
||||
pub const REG_RDX: ::c_int = 12;
|
||||
pub const REG_RBX: ::c_int = 11;
|
||||
pub const REG_RBP: ::c_int = 10;
|
||||
pub const REG_RSI: ::c_int = 9;
|
||||
pub const REG_RDI: ::c_int = 8;
|
||||
pub const REG_R8: ::c_int = 7;
|
||||
pub const REG_R9: ::c_int = 6;
|
||||
pub const REG_R10: ::c_int = 5;
|
||||
pub const REG_R11: ::c_int = 4;
|
||||
pub const REG_R12: ::c_int = 3;
|
||||
pub const REG_R13: ::c_int = 2;
|
||||
pub const REG_R14: ::c_int = 1;
|
||||
pub const REG_R15: ::c_int = 0;
|
||||
65
vendor/libc/src/unix/solarish/x86_common.rs
vendored
Normal file
65
vendor/libc/src/unix/solarish/x86_common.rs
vendored
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
// AT_SUN_HWCAP
|
||||
pub const AV_386_FPU: u32 = 0x00001;
|
||||
pub const AV_386_TSC: u32 = 0x00002;
|
||||
pub const AV_386_CX8: u32 = 0x00004;
|
||||
pub const AV_386_SEP: u32 = 0x00008;
|
||||
pub const AV_386_AMD_SYSC: u32 = 0x00010;
|
||||
pub const AV_386_CMOV: u32 = 0x00020;
|
||||
pub const AV_386_MMX: u32 = 0x00040;
|
||||
pub const AV_386_AMD_MMX: u32 = 0x00080;
|
||||
pub const AV_386_AMD_3DNow: u32 = 0x00100;
|
||||
pub const AV_386_AMD_3DNowx: u32 = 0x00200;
|
||||
pub const AV_386_FXSR: u32 = 0x00400;
|
||||
pub const AV_386_SSE: u32 = 0x00800;
|
||||
pub const AV_386_SSE2: u32 = 0x01000;
|
||||
pub const AV_386_CX16: u32 = 0x10000;
|
||||
pub const AV_386_AHF: u32 = 0x20000;
|
||||
pub const AV_386_TSCP: u32 = 0x40000;
|
||||
pub const AV_386_AMD_SSE4A: u32 = 0x80000;
|
||||
pub const AV_386_POPCNT: u32 = 0x100000;
|
||||
pub const AV_386_AMD_LZCNT: u32 = 0x200000;
|
||||
pub const AV_386_SSSE3: u32 = 0x400000;
|
||||
pub const AV_386_SSE4_1: u32 = 0x800000;
|
||||
pub const AV_386_SSE4_2: u32 = 0x1000000;
|
||||
pub const AV_386_MOVBE: u32 = 0x2000000;
|
||||
pub const AV_386_AES: u32 = 0x4000000;
|
||||
pub const AV_386_PCLMULQDQ: u32 = 0x8000000;
|
||||
pub const AV_386_XSAVE: u32 = 0x10000000;
|
||||
pub const AV_386_AVX: u32 = 0x20000000;
|
||||
pub const AV_386_VMX: u32 = 0x40000000;
|
||||
pub const AV_386_AMD_SVM: u32 = 0x80000000;
|
||||
// AT_SUN_HWCAP2
|
||||
pub const AV_386_2_F16C: u32 = 0x00000001;
|
||||
pub const AV_386_2_RDRAND: u32 = 0x00000002;
|
||||
pub const AV_386_2_BMI1: u32 = 0x00000004;
|
||||
pub const AV_386_2_BMI2: u32 = 0x00000008;
|
||||
pub const AV_386_2_FMA: u32 = 0x00000010;
|
||||
pub const AV_386_2_AVX2: u32 = 0x00000020;
|
||||
pub const AV_386_2_ADX: u32 = 0x00000040;
|
||||
pub const AV_386_2_RDSEED: u32 = 0x00000080;
|
||||
pub const AV_386_2_AVX512F: u32 = 0x00000100;
|
||||
pub const AV_386_2_AVX512DQ: u32 = 0x00000200;
|
||||
pub const AV_386_2_AVX512IFMA: u32 = 0x00000400;
|
||||
pub const AV_386_2_AVX512PF: u32 = 0x00000800;
|
||||
pub const AV_386_2_AVX512ER: u32 = 0x00001000;
|
||||
pub const AV_386_2_AVX512CD: u32 = 0x00002000;
|
||||
pub const AV_386_2_AVX512BW: u32 = 0x00004000;
|
||||
pub const AV_386_2_AVX512VL: u32 = 0x00008000;
|
||||
pub const AV_386_2_AVX512VBMI: u32 = 0x00010000;
|
||||
pub const AV_386_2_AVX512VPOPCDQ: u32 = 0x00020000;
|
||||
pub const AV_386_2_AVX512_4NNIW: u32 = 0x00040000;
|
||||
pub const AV_386_2_AVX512_4FMAPS: u32 = 0x00080000;
|
||||
pub const AV_386_2_SHA: u32 = 0x00100000;
|
||||
pub const AV_386_2_FSGSBASE: u32 = 0x00200000;
|
||||
pub const AV_386_2_CLFLUSHOPT: u32 = 0x00400000;
|
||||
pub const AV_386_2_CLWB: u32 = 0x00800000;
|
||||
pub const AV_386_2_MONITORX: u32 = 0x01000000;
|
||||
pub const AV_386_2_CLZERO: u32 = 0x02000000;
|
||||
pub const AV_386_2_AVX512_VNNI: u32 = 0x04000000;
|
||||
pub const AV_386_2_VPCLMULQDQ: u32 = 0x08000000;
|
||||
pub const AV_386_2_VAES: u32 = 0x10000000;
|
||||
// AT_SUN_FPTYPE
|
||||
pub const AT_386_FPINFO_NONE: u32 = 0;
|
||||
pub const AT_386_FPINFO_FXSAVE: u32 = 1;
|
||||
pub const AT_386_FPINFO_XSAVE: u32 = 2;
|
||||
pub const AT_386_FPINFO_XSAVE_AMD: u32 = 3;
|
||||
Loading…
Add table
Add a link
Reference in a new issue