66 Commits

Author SHA1 Message Date
Dan Gohman 5d99fbd896 Add x32 support. (#36)
Add x32 support, by adding special cases for it in the generator.
2022-11-22 13:52:42 -08:00
nivkner 927ddccf10 add flags for the splice syscalls (#35)
* add splice flags

* autogenerate bindings

Co-authored-by: nivkner <nivkner@users.noreply.github.com>
2022-10-03 10:59:33 -07:00
carbotaniuman 28df18a399 Add sysinfo bindings 2022-07-11 14:59:20 -07:00
carbotaniuman af1c0c1dd4 Add inotify bindings 2022-07-11 08:01:52 -07:00
Dan Gohman 8e21bcef57 Update to Linux 5.17. 2022-04-19 14:47:30 -07:00
Dan Gohman 010ec215a0 Add the io-uring APIs. 2022-04-19 11:59:06 -07:00
Dan Gohman ee19b8a9bb Define TCSANOW et al for MIPS.
Define `TCSANOW`, `TCSADRAIN`, and `TCSAFLUSH` for MIPS, since MIPS
defines these differently from all other architectures, and in a way
that bindgen doesn't support.
2022-04-08 15:07:30 -07:00
Dan Gohman 5a175efc5b Fix the definition of POLLWRNORM on mips. 2022-02-11 12:32:06 -08:00
Dan Gohman b295dce82c rustfmt the gen directory. 2022-02-10 16:09:14 -08:00
Dan Gohman ad0803ceb6 Add mips and mips64 ioctl support. 2022-02-10 16:03:44 -08:00
Dan Gohman c48bcf646b Use the correct preprocessor macro for detecting riscv64.
Use a preprocessor macro which is defined by the compiler for detecting
riscv64.
2022-01-27 14:23:55 -08:00
Dan Gohman 0b8f6b69a1 Exclude ioctls from the general module.
Ioctl codes are provided in the `ioctl` module, so blocklist them from the
`general` module to avoid duplication.
2022-01-27 11:50:05 -08:00
Dan Gohman 3673970e70 Simplify the bindings by using only a single kernel version. (#20)
Originally, the idea of having multiple versions was to attempt to
support writing code that was strictly compatible with old versions.
However, my experience with linux-raw-sys so far as been that that's
not as useful as it seemed like it would be, and versioning all the
imports means having multiple versions of all the types, which gets
awkward.

So instead, switch to having just a single Linux version, 5.11 for
now, which is mostly a superset of the other versions.

This also helps reduce compile times, as there aren't multiple
versions of everything to parse.
2022-01-27 07:43:31 -08:00
Dan Gohman 7b371ee0d8 Define several macros used in the userfaultfd API.
Define the `UFFDIO_REGISTER_MODE_*`, `UFFDIO_COPY_MODE_*`, `UFFDIO_ZEROPAGE_MODE_*`,
and `UFFD_API` macros.
2022-01-26 18:23:42 -08:00
Dan Gohman 9ea366f5d4 Add a new ioctl module, and populate it with lots of ioctl codes. (#18)
We've been collecting manual definitions of ioctl codes for a while, and
it looks like we're going to be collecting more over time, so start trying
a different strategy: use a script and a C program to extract ioctl values
from the headers semi-automatically.

The script itself isn't very easy to run, and I'm open to ideas for how
to do it better. However, this should cover most of Linux's existing ioctls,
so hopefully we won't need to run it very often.
2022-01-26 11:35:51 -08:00
Dan Gohman 39534e6677 Update to bindgen 0.59.2. 2022-01-25 12:00:58 -08:00
Dan Gohman 7ed63a24c8 Define TIOCGWINSZ, FIONBIO, FIONREAD, and TCGETS on powerpc64le.
Linux's macro definitions for these are too complex for bindgen, so
define these manually.
2022-01-25 11:52:57 -08:00
Dan Gohman 657f24330d Add bindings for linux/userfaultfd.h. 2022-01-25 11:50:14 -08:00
Dan Gohman f3a1d49170 Document the purpose of the code in gen/modules/general.h.
Code in general.h should contain just what's needed for interoperability
with the Linux kernel ABI. Add a comment explaining this, and tidy up
a few parts of the code to follow this advice.
2022-01-10 12:17:09 -08:00
Friedel Ziegelmayer f913f2ceb2 feat: add msghdr (#13)
* feat: add msghdr

* regen

* add ip.h and ipv6.h

* include more from socket.h

* cleanup

* cleanup types and add mmsghdr
2022-01-10 12:16:43 -08:00
Mek101 279e8c04f5 Pin bindgen patch version 2022-01-03 12:58:22 -06:00
Mek101 ee0ab18f98 Fix BLKSSZGET and BLKPBSZGET for mips and powerpc 2022-01-03 12:58:22 -06:00
Dan Gohman 2f00e54a01 rustfmt 2021-11-05 06:09:54 -07:00
Dan Gohman a782f144f4 Rename rustc-std-workspace-core to core in Cargo.toml instead of lib.rs. 2021-11-04 08:37:34 -07:00
Dan Gohman a54935c9e0 Use rustc-std-workspace-core like libc does. 2021-11-03 16:03:54 -07:00
Dan Gohman c667510274 Add a compiler_builtins dependency in rustc-dep-of-std mode. 2021-11-03 14:37:50 -07:00
Dan Gohman cee7ab90b9 Name the rustc-std-workspace-core dependency 'core'. 2021-11-03 14:25:44 -07:00
Dan Gohman 951eae2802 Fix the auto-generated rustc-dep-of-std to depend on no_std. 2021-11-03 13:55:52 -07:00
Dan Gohman e16e143b1c Add rustc-dep-of-std support. 2021-11-03 13:48:17 -07:00
Dan Gohman 28f73e9cc8 Define ctypes manually instead of depending on cty.
In `no_std` builds, define `ctypes` types manually instead of depending
on the `cty` crate. These types are straightforward to define for all
Linux targets.
2021-11-03 13:44:08 -07:00
Mek101 7e84e621ca Add BLKSSZGET and BLKPBSZGET ioctl arguments (#8)
* Add BLKPBSZGET for x86_64

* Add BLKPBSZGET for everyone but sparc

* Add BLKSSZGET for everyone but sparc

* Update reference bindings

* Fix BLKSSZGET and BLKPBSZGET included in sparc bindings

* Add BLKSSZGET and BLKPBSZGET to sparc
2021-11-02 07:19:02 -07:00
Dan Gohman bb4f3f3b9c Add <linux/sched.h>. 2021-10-04 06:09:02 -07:00
Dan Gohman eb27d30ad4 Define ARCH_SET_FS for x86 and x86_64. 2021-09-20 05:51:48 -07:00
Dan Gohman b9a73148b4 Define the user_desc struct. 2021-09-20 05:20:29 -07:00
Dan Gohman 53337176d3 Define struct linger. 2021-09-18 07:07:43 -07:00
Dan Gohman e077e6072a Add <linux/tcp.h>. 2021-09-18 05:16:05 -07:00
Dan Gohman 472b66818e Add the membarrier constants. 2021-09-16 08:06:42 -07:00
Dan Gohman 0fd4139b03 Add the Linux uname types. 2021-09-01 11:18:11 -07:00
Dan Gohman 244ed8f93e Add the Linux auxval constants. 2021-09-01 08:23:25 -07:00
Dan Gohman dce54115af Add a "std" feature to be friendlier for cargo nono. 2021-08-25 10:37:48 -07:00
bjorn3 b110a1900a Use cty instead of libc for c types 2021-08-23 04:31:59 -07:00
bjorn3 963b82965b Add #![no_std] support 2021-08-23 04:31:59 -07:00
bjorn3 ac00127984 Use #[cfg(any())] in lib.rs 2021-08-23 04:31:59 -07:00
bjorn3 181585dc3a Add CI (#3)
* Do a partial clone of linux

This saves a lot of disk space. The git dir for the partial clone after
all relevant versions have been checked out is 1.7GB.

* Do a sparse checkout of linux

This saves a lot of disk space. The git dir for the partial clone after all relevant versions have been checked out is <800MB.

* Fix typo

* Fix checkout on CI

* Add CI

* Make generation deterministic

Directory iteration order is non-deterministic. In practice it depends
on the exact order in which dir entries have been created. Sort the
output of fs::read_dir to ensure that generation is deterministic across
systems.

* Check for linux/.git

* Build generator in release mode

* Switch to cargo check
2021-08-22 07:47:08 -07:00
Dan Gohman 13a9b81c9c Update to bindgen 0.59. 2021-08-10 17:29:07 -07:00
Dan Gohman df8888be8b Add defines for use with timerfd_create. 2021-07-30 13:55:02 -05:00
Dan Gohman 306d936d0f Define EPOLLET and EPOLLONESHOT. 2021-07-19 09:44:20 -07:00
Dan Gohman d78c7ace07 Define EPOLLEXCLUSIVE and EPOLLWAKEUP. 2021-07-12 14:18:44 -07:00
Dan Gohman 74da544831 Add the EPOLL event flag constants. 2021-07-12 13:47:16 -07:00
Dan Gohman 1a943d273f Add eventfd defines to the general module. 2021-07-12 12:09:40 -07:00