diff options
| author | Palmer Dabbelt <palmer@dabbelt.com> | 2017-08-21 17:03:59 -0700 |
|---|---|---|
| committer | Palmer Dabbelt <palmer@dabbelt.com> | 2017-08-21 17:03:59 -0700 |
| commit | bff4ec01e9f54c4ad35871c5063eb4f0ba2ff7a1 (patch) | |
| tree | 05b06231a5ae17d94f5da94a8a0c5e13dea12e1b /linux-headers/include/linux/android | |
| parent | e88aaa6f564dc6aefa409c9fc9d4bb3f8e55199f (diff) | |
| download | riscv-gnu-toolchain-bff4ec01e9f54c4ad35871c5063eb4f0ba2ff7a1.tar.gz riscv-gnu-toolchain-bff4ec01e9f54c4ad35871c5063eb4f0ba2ff7a1.tar.bz2 riscv-gnu-toolchain-bff4ec01e9f54c4ad35871c5063eb4f0ba2ff7a1.zip | |
Move to glibc-2.26, and the latest Linux headers (riscv-for-submission-v7)
I'm trying to get all our ports up to date with the latest stable
versions, just for my own sanity. This handles glibc, but pushes Linux
a bit past what's currently stable.
Diffstat (limited to 'linux-headers/include/linux/android')
| -rw-r--r-- | linux-headers/include/linux/android/..install.cmd | 1 | ||||
| -rw-r--r-- | linux-headers/include/linux/android/.install | 0 | ||||
| -rw-r--r-- | linux-headers/include/linux/android/binder.h | 104 |
3 files changed, 102 insertions, 3 deletions
diff --git a/linux-headers/include/linux/android/..install.cmd b/linux-headers/include/linux/android/..install.cmd new file mode 100644 index 00000000..97505fd1 --- /dev/null +++ b/linux-headers/include/linux/android/..install.cmd @@ -0,0 +1 @@ +cmd_/scratch/palmer/work/20170821-glibc/riscv-gnu-toolchain/linux-headers/include/linux/android/.install := /bin/sh scripts/headers_install.sh /scratch/palmer/work/20170821-glibc/riscv-gnu-toolchain/linux-headers/include/linux/android ./include/uapi/linux/android binder.h; /bin/sh scripts/headers_install.sh /scratch/palmer/work/20170821-glibc/riscv-gnu-toolchain/linux-headers/include/linux/android ./include/generated/uapi/linux/android ; touch /scratch/palmer/work/20170821-glibc/riscv-gnu-toolchain/linux-headers/include/linux/android/.install diff --git a/linux-headers/include/linux/android/.install b/linux-headers/include/linux/android/.install new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/linux-headers/include/linux/android/.install diff --git a/linux-headers/include/linux/android/binder.h b/linux-headers/include/linux/android/binder.h index bef9fd61..f8c25139 100644 --- a/linux-headers/include/linux/android/binder.h +++ b/linux-headers/include/linux/android/binder.h @@ -33,6 +33,8 @@ enum { BINDER_TYPE_HANDLE = B_PACK_CHARS('s', 'h', '*', B_TYPE_LARGE), BINDER_TYPE_WEAK_HANDLE = B_PACK_CHARS('w', 'h', '*', B_TYPE_LARGE), BINDER_TYPE_FD = B_PACK_CHARS('f', 'd', '*', B_TYPE_LARGE), + BINDER_TYPE_FDA = B_PACK_CHARS('f', 'd', 'a', B_TYPE_LARGE), + BINDER_TYPE_PTR = B_PACK_CHARS('p', 't', '*', B_TYPE_LARGE), }; enum { @@ -48,6 +50,14 @@ typedef __u64 binder_size_t; typedef __u64 binder_uintptr_t; #endif +/** + * struct binder_object_header - header shared by all binder metadata objects. + * @type: type of the object + */ +struct binder_object_header { + __u32 type; +}; + /* * This is the flattened representation of a Binder object for transfer * between processes. The 'offsets' supplied as part of a binder transaction @@ -56,9 +66,8 @@ typedef __u64 binder_uintptr_t; * between processes. */ struct flat_binder_object { - /* 8 bytes for large_flat_header. */ - __u32 type; - __u32 flags; + struct binder_object_header hdr; + __u32 flags; /* 8 bytes of data. */ union { @@ -70,6 +79,84 @@ struct flat_binder_object { binder_uintptr_t cookie; }; +/** + * struct binder_fd_object - describes a filedescriptor to be fixed up. + * @hdr: common header structure + * @pad_flags: padding to remain compatible with old userspace code + * @pad_binder: padding to remain compatible with old userspace code + * @fd: file descriptor + * @cookie: opaque data, used by user-space + */ +struct binder_fd_object { + struct binder_object_header hdr; + __u32 pad_flags; + union { + binder_uintptr_t pad_binder; + __u32 fd; + }; + + binder_uintptr_t cookie; +}; + +/* struct binder_buffer_object - object describing a userspace buffer + * @hdr: common header structure + * @flags: one or more BINDER_BUFFER_* flags + * @buffer: address of the buffer + * @length: length of the buffer + * @parent: index in offset array pointing to parent buffer + * @parent_offset: offset in @parent pointing to this buffer + * + * A binder_buffer object represents an object that the + * binder kernel driver can copy verbatim to the target + * address space. A buffer itself may be pointed to from + * within another buffer, meaning that the pointer inside + * that other buffer needs to be fixed up as well. This + * can be done by setting the BINDER_BUFFER_FLAG_HAS_PARENT + * flag in @flags, by setting @parent buffer to the index + * in the offset array pointing to the parent binder_buffer_object, + * and by setting @parent_offset to the offset in the parent buffer + * at which the pointer to this buffer is located. + */ +struct binder_buffer_object { + struct binder_object_header hdr; + __u32 flags; + binder_uintptr_t buffer; + binder_size_t length; + binder_size_t parent; + binder_size_t parent_offset; +}; + +enum { + BINDER_BUFFER_FLAG_HAS_PARENT = 0x01, +}; + +/* struct binder_fd_array_object - object describing an array of fds in a buffer + * @hdr: common header structure + * @num_fds: number of file descriptors in the buffer + * @parent: index in offset array to buffer holding the fd array + * @parent_offset: start offset of fd array in the buffer + * + * A binder_fd_array object represents an array of file + * descriptors embedded in a binder_buffer_object. It is + * different from a regular binder_buffer_object because it + * describes a list of file descriptors to fix up, not an opaque + * blob of memory, and hence the kernel needs to treat it differently. + * + * An example of how this would be used is with Android's + * native_handle_t object, which is a struct with a list of integers + * and a list of file descriptors. The native_handle_t struct itself + * will be represented by a struct binder_buffer_objct, whereas the + * embedded list of file descriptors is represented by a + * struct binder_fd_array_object with that binder_buffer_object as + * a parent. + */ +struct binder_fd_array_object { + struct binder_object_header hdr; + binder_size_t num_fds; + binder_size_t parent; + binder_size_t parent_offset; +}; + /* * On 64-bit platforms where user code may run in 32-bits the driver must * translate the buffer (and local binder) addresses appropriately. @@ -162,6 +249,11 @@ struct binder_transaction_data { } data; }; +struct binder_transaction_data_sg { + struct binder_transaction_data transaction_data; + binder_size_t buffers_size; +}; + struct binder_ptr_cookie { binder_uintptr_t ptr; binder_uintptr_t cookie; @@ -346,6 +438,12 @@ enum binder_driver_command_protocol { /* * void *: cookie */ + + BC_TRANSACTION_SG = _IOW('c', 17, struct binder_transaction_data_sg), + BC_REPLY_SG = _IOW('c', 18, struct binder_transaction_data_sg), + /* + * binder_transaction_data_sg: the sent command. + */ }; #endif /* _LINUX_BINDER_H */ |
