* remotes/msm-4.9/tmp-39dae59:
Linux 4.14-rc8
x86/module: Detect and skip invalid relocations
objtool: Prevent GCC from merging annotate_unreachable(), take 2
Revert "x86/mm: Stop calling leave_mm() in idle code"
Documentation: Add Frank Rowand to list of enforcement statement endorsers
doc: add Willy Tarreau to the list of enforcement statement endorsers
tools/headers: Synchronize kernel ABI headers
objtool: Resync objtool's instruction decoder source code copy with the kernel's latest version
Input: sparse-keymap - send sync event for KE_SW/KE_VSW
Input: ar1021_i2c - set INPUT_PROP_DIRECT
arch/tile: Implement ->set_state_oneshot_stopped()
Update MIPS email addresses
x86: CPU: Fix up "cpu MHz" in /proc/cpuinfo
mm, swap: fix race between swap count continuation operations
mm/huge_memory.c: deposit page table when copying a PMD migration entry
initramfs: fix initramfs rebuilds w/ compression after disabling
fs/hugetlbfs/inode.c: fix hwpoison reserve accounting
ocfs2: fstrim: Fix start offset of first cluster group during fstrim
mm, /proc/pid/pagemap: fix soft dirty marking for PMD migration entry
userfaultfd: hugetlbfs: prevent UFFDIO_COPY to fill beyond the end of i_size
Documentation: Add Tim Bird to list of enforcement statement endorsers
net: systemport: Correct IPG length settings
tcp: do not mangle skb->cb[] in tcp_make_synack()
fib: fib_dump_info can no longer use __in_dev_get_rtnl
stmmac: use of_property_read_u32 instead of read_u8
net_sched: hold netns refcnt for each action
net_sched: acquire RTNL in tc_action_net_exit()
powerpc/perf: Fix core-imc hotplug callback failure during imc initialization
Kbuild: don't pass "-C" to preprocessor when processing linker scripts
Revert "x86: do not use cpufreq_quick_get() for /proc/cpuinfo "cpu MHz""
arm64: ensure __dump_instr() checks addr_limit
KVM: x86: Update APICv on APIC reset
KVM: VMX: Do not fully reset PI descriptor on vCPU reset
kvm: Return -ENODEV from update_persistent_clock
futex: futex_wake_op, do not fail on invalid op
MIPS: Update email address for Marcin Nowakowski
License cleanup: add SPDX license identifier to uapi header files with a license
License cleanup: add SPDX license identifier to uapi header files with no license
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
KEYS: fix out-of-bounds read during ASN.1 parsing
KEYS: trusted: fix writing past end of buffer in trusted_read()
KEYS: return full count in keyring_read() if buffer is too small
net: vrf: correct FRA_L3MDEV encode type
tcp_nv: fix division by zero in tcpnv_acked()
drm/amdgpu: allow harvesting check for Polaris VCE
drm/amdgpu: return -ENOENT from uvd 6.0 early init for harvesting
ARM: add debug ".edata_real" symbol
MIPS: smp-cmp: Fix vpe_id build error
MAINTAINERS: Update Pistachio platform maintainers
MIPS: smp-cmp: Use right include for task_struct
signal: Fix name of SIGEMT in #if defined() check
MIPS: Update Goldfish RTC driver maintainer email address
MIPS: Update RINT emulation maintainer email address
MIPS: CPS: Fix use of current_cpu_data in preemptible code
x86/mcelog: Get rid of RCU remnants
watchdog/hardlockup/perf: Use atomics to track in-use cpu counter
watchdog/harclockup/perf: Revert a33d44843d ("watchdog/hardlockup/perf: Simplify deferred event destroy")
ARM: 8716/1: pass endianness info to sparse
drm/i915: Check incoming alignment for unfenced buffers (on i915gm)
x86/mm: fix use-after-free of vma during userfaultfd fault
ide:ide-cd: fix kernel panic resulting from missing scsi_req_init
mmc: dw_mmc: Fix the DTO timeout calculation
tcp: fix tcp_mtu_probe() vs highest_sack
ipv6: addrconf: increment ifp refcount before ipv6_del_addr()
tun/tap: sanitize TUNSETSNDBUF input
mlxsw: i2c: Fix buffer increment counter for write transaction
netfilter: nf_reject_ipv4: Fix use-after-free in send_reset
futex: Fix more put_pi_state() vs. exit_pi_state_list() races
powerpc/kprobes: Dereference function pointers only if the address does not belong to kernel text
Revert "powerpc64/elfv1: Only dereference function descriptor for non-text symbols"
mlxsw: reg: Add high and low temperature thresholds
MAINTAINERS: Remove Yotam from mlxfw
MAINTAINERS: Update Yotam's E-mail
net: hns: set correct return value
net: lapbether: fix double free
bpf: remove SK_REDIRECT from UAPI
net: phy: marvell: Only configure RGMII delays when using RGMII
MIPS: SMP: Fix deadlock & online race
MIPS: bpf: Fix a typo in build_one_insn()
MIPS: microMIPS: Fix incorrect mask in insn_table_MM
MIPS: Fix CM region target definitions
MIPS: generic: Fix compilation error from include asm/mips-cpc.h
MIPS: Fix exception entry when CONFIG_EVA enabled
irqchip/irq-mvebu-gicp: Add missing spin_lock init
drm/nouveau/kms/nv50: use the correct state for base channel notifier setup
MIPS: generic: Fix NI 169445 its build
Update MIPS email addresses
tile: pass machine size to sparse
selftests: lib.mk: print individual test results to console by default
RDMA/nldev: Enforce device index check for port callback
Revert "PM / QoS: Fix device resume latency PM QoS"
Revert "PM / QoS: Fix default runtime_pm device resume latency"
scsi: qla2xxx: Fix oops in qla2x00_probe_one error path
xfrm: Fix GSO for IPsec with GRE tunnel.
ALSA: seq: Fix nested rwsem annotation for lockdep splat
ALSA: timer: Add missing mutex lock for compat ioctls
tc-testing: fix arg to ip command: -s -> -n
net_sched: remove tcf_block_put_deferred()
l2tp: hold tunnel in pppol2tp_connect()
drm/i915: Hold rcu_read_lock when iterating over the radixtree (vma idr)
drm/i915: Hold rcu_read_lock when iterating over the radixtree (objects)
drm/i915/edp: read edp display control registers unconditionally
drm/i915: Do not rely on wm preservation for ILK watermarks
drm/i915: Cancel the modeset retry work during modeset cleanup
Mark 'ioremap_page_range()' as possibly sleeping
nvme: Fix setting logical block format when revalidating
mmc: dw_mmc: Add locking to the CTO timer
mmc: dw_mmc: Fix the CTO timeout calculation
mmc: dw_mmc: cancel the CTO timer after a voltage switch
perf/cgroup: Fix perf cgroup hierarchy support
PM / QoS: Fix default runtime_pm device resume latency
Revert "ath10k: fix napi_poll budget overflow"
ath10k: rebuild crypto header in rx data frames
cifs: check MaxPathNameComponentLength != 0 before using it
KVM: arm/arm64: vgic-its: Check GITS_BASER Valid bit before saving tables
KVM: arm/arm64: vgic-its: Check CBASER/BASER validity before enabling the ITS
KVM: arm/arm64: vgic-its: Fix vgic_its_restore_collection_table returned value
KVM: arm/arm64: vgic-its: Fix return value for device table restore
efi/libstub: arm: omit sorting of the UEFI memory map
perf tools: Unwind properly location after REJECT
virtio_blk: Fix an SG_IO regression
wcn36xx: Remove unnecessary rcu_read_unlock in wcn36xx_bss_info_changed
ARM: dts: mvebu: pl310-cache disable double-linefill
xfrm: Clear sk_dst_cache when applying per-socket policy.
perf symbols: Fix memory corruption because of zero length symbols
powerpc/64s/radix: Fix preempt imbalance in TLB flush
netfilter: nft_set_hash: disable fast_ops for 2-len keys
powerpc: Fix check for copy/paste instructions in alignment handler
powerpc/perf: Fix IMC allocation routine
xfrm: Fix xfrm_dst_cache memleak
ARM: 8715/1: add a private asm/unaligned.h
clk: uniphier: fix clock data for PXs3
Documentation: Add my name to kernel enforcement statement
nvme-rdma: fix possible hang when issuing commands during ctrl removal
arm/arm64: kvm: Disable branch profiling in HYP code
arm/arm64: kvm: Move initialization completion message
arm/arm64: KVM: set right LR register value for 32 bit guest when inject abort
Documentation: kernel-enforcement-statement.rst: proper sort names
ASoC: rt5616: fix 0x91 default value
Documentation: Add Arm Ltd to kernel-enforcement-statement.rst
arm64: dts: uniphier: add STDMAC clock to EHCI nodes
ARM: dts: uniphier: add STDMAC clock to EHCI nodes
mmc: renesas_sdhi: fix kernel panic in _internal_dmac.c
mmc: tmio: fix swiotlb buffer is full
Documentation: kernel-enforcement-statement.rst: Remove Red Hat markings
Documentation: Add myself to the enforcement statement list
Documentation: Sign kernel enforcement statement
Add ack for Trond Myklebust to the enforcement statement
Documentation: update kernel enforcement support list
Documentation: add my name to supporters
ASoC: rt5659: connect LOUT Amp with Charge Pump
ASoC: rt5659: register power bit of LOUT Amp
KVM: arm64: its: Fix missing dynamic allocation check in scan_its_table
crypto: x86/chacha20 - satisfy stack validation 2.0
ASoC: rt5663: Change the dev getting function in rt5663_irq
ASoC: rt5514: Revert Hotword Model control
ASoC: topology: Fix a potential memory leak in 'soc_tplg_dapm_widget_denum_create()'
ASoC: topology: Fix a potential NULL pointer dereference in 'soc_tplg_dapm_widget_denum_create()'
ASoC: rt5514-spi: check irq status to schedule data copy
ASoC: adau17x1: Workaround for noise bug in ADC
Conflicts:
drivers/gpu/drm/msm/Makefile
drivers/soc/qcom/Makefile
drivers/staging/android/ion/Makefile
include/linux/coresight-stm.h
include/trace/events/kmem.h
Change-Id: I01f1779762b652b9213924caa3d54f29cf03d285
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
515 lines
15 KiB
C
515 lines
15 KiB
C
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
|
/*
|
|
* Copyright (C) 2008 Google, Inc.
|
|
*
|
|
* Based on, but no longer compatible with, the original
|
|
* OpenBinder.org binder driver interface, which is:
|
|
*
|
|
* Copyright (c) 2005 Palmsource, Inc.
|
|
*
|
|
* This software is licensed under the terms of the GNU General Public
|
|
* License version 2, as published by the Free Software Foundation, and
|
|
* may be copied, distributed, and modified under those terms.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
*/
|
|
|
|
#ifndef _UAPI_LINUX_BINDER_H
|
|
#define _UAPI_LINUX_BINDER_H
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/ioctl.h>
|
|
|
|
#define B_PACK_CHARS(c1, c2, c3, c4) \
|
|
((((c1)<<24)) | (((c2)<<16)) | (((c3)<<8)) | (c4))
|
|
#define B_TYPE_LARGE 0x85
|
|
|
|
enum {
|
|
BINDER_TYPE_BINDER = B_PACK_CHARS('s', 'b', '*', B_TYPE_LARGE),
|
|
BINDER_TYPE_WEAK_BINDER = B_PACK_CHARS('w', 'b', '*', B_TYPE_LARGE),
|
|
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 flat_binder_object_shifts: shift values for flat_binder_object_flags
|
|
* @FLAT_BINDER_FLAG_SCHED_POLICY_SHIFT: shift for getting scheduler policy.
|
|
*
|
|
*/
|
|
enum flat_binder_object_shifts {
|
|
FLAT_BINDER_FLAG_SCHED_POLICY_SHIFT = 9,
|
|
};
|
|
|
|
/**
|
|
* enum flat_binder_object_flags - flags for use in flat_binder_object.flags
|
|
*/
|
|
enum flat_binder_object_flags {
|
|
/**
|
|
* @FLAT_BINDER_FLAG_PRIORITY_MASK: bit-mask for min scheduler priority
|
|
*
|
|
* These bits can be used to set the minimum scheduler priority
|
|
* at which transactions into this node should run. Valid values
|
|
* in these bits depend on the scheduler policy encoded in
|
|
* @FLAT_BINDER_FLAG_SCHED_POLICY_MASK.
|
|
*
|
|
* For SCHED_NORMAL/SCHED_BATCH, the valid range is between [-20..19]
|
|
* For SCHED_FIFO/SCHED_RR, the value can run between [1..99]
|
|
*/
|
|
FLAT_BINDER_FLAG_PRIORITY_MASK = 0xff,
|
|
/**
|
|
* @FLAT_BINDER_FLAG_ACCEPTS_FDS: whether the node accepts fds.
|
|
*/
|
|
FLAT_BINDER_FLAG_ACCEPTS_FDS = 0x100,
|
|
/**
|
|
* @FLAT_BINDER_FLAG_SCHED_POLICY_MASK: bit-mask for scheduling policy
|
|
*
|
|
* These two bits can be used to set the min scheduling policy at which
|
|
* transactions on this node should run. These match the UAPI
|
|
* scheduler policy values, eg:
|
|
* 00b: SCHED_NORMAL
|
|
* 01b: SCHED_FIFO
|
|
* 10b: SCHED_RR
|
|
* 11b: SCHED_BATCH
|
|
*/
|
|
FLAT_BINDER_FLAG_SCHED_POLICY_MASK =
|
|
3U << FLAT_BINDER_FLAG_SCHED_POLICY_SHIFT,
|
|
|
|
/**
|
|
* @FLAT_BINDER_FLAG_INHERIT_RT: whether the node inherits RT policy
|
|
*
|
|
* Only when set, calls into this node will inherit a real-time
|
|
* scheduling policy from the caller (for synchronous transactions).
|
|
*/
|
|
FLAT_BINDER_FLAG_INHERIT_RT = 0x800,
|
|
};
|
|
|
|
#ifdef BINDER_IPC_32BIT
|
|
typedef __u32 binder_size_t;
|
|
typedef __u32 binder_uintptr_t;
|
|
#else
|
|
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
|
|
* contains offsets into the data where these structures occur. The Binder
|
|
* driver takes care of re-writing the structure type and data as it moves
|
|
* between processes.
|
|
*/
|
|
struct flat_binder_object {
|
|
struct binder_object_header hdr;
|
|
__u32 flags;
|
|
|
|
/* 8 bytes of data. */
|
|
union {
|
|
binder_uintptr_t binder; /* local object */
|
|
__u32 handle; /* remote object */
|
|
};
|
|
|
|
/* extra data associated with local 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
|
|
* @pad: padding to ensure correct alignment
|
|
* @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;
|
|
__u32 pad;
|
|
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.
|
|
*/
|
|
|
|
struct binder_write_read {
|
|
binder_size_t write_size; /* bytes to write */
|
|
binder_size_t write_consumed; /* bytes consumed by driver */
|
|
binder_uintptr_t write_buffer;
|
|
binder_size_t read_size; /* bytes to read */
|
|
binder_size_t read_consumed; /* bytes consumed by driver */
|
|
binder_uintptr_t read_buffer;
|
|
};
|
|
|
|
/* Use with BINDER_VERSION, driver fills in fields. */
|
|
struct binder_version {
|
|
/* driver protocol version -- increment with incompatible change */
|
|
__s32 protocol_version;
|
|
};
|
|
|
|
/* This is the current protocol version. */
|
|
#ifdef BINDER_IPC_32BIT
|
|
#define BINDER_CURRENT_PROTOCOL_VERSION 7
|
|
#else
|
|
#define BINDER_CURRENT_PROTOCOL_VERSION 8
|
|
#endif
|
|
|
|
/*
|
|
* Use with BINDER_GET_NODE_DEBUG_INFO, driver reads ptr, writes to all fields.
|
|
* Set ptr to NULL for the first call to get the info for the first node, and
|
|
* then repeat the call passing the previously returned value to get the next
|
|
* nodes. ptr will be 0 when there are no more nodes.
|
|
*/
|
|
struct binder_node_debug_info {
|
|
binder_uintptr_t ptr;
|
|
binder_uintptr_t cookie;
|
|
__u32 has_strong_ref;
|
|
__u32 has_weak_ref;
|
|
};
|
|
|
|
#define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
|
|
#define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64)
|
|
#define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)
|
|
#define BINDER_SET_IDLE_PRIORITY _IOW('b', 6, __s32)
|
|
#define BINDER_SET_CONTEXT_MGR _IOW('b', 7, __s32)
|
|
#define BINDER_THREAD_EXIT _IOW('b', 8, __s32)
|
|
#define BINDER_VERSION _IOWR('b', 9, struct binder_version)
|
|
#define BINDER_GET_NODE_DEBUG_INFO _IOWR('b', 11, struct binder_node_debug_info)
|
|
|
|
/*
|
|
* NOTE: Two special error codes you should check for when calling
|
|
* in to the driver are:
|
|
*
|
|
* EINTR -- The operation has been interupted. This should be
|
|
* handled by retrying the ioctl() until a different error code
|
|
* is returned.
|
|
*
|
|
* ECONNREFUSED -- The driver is no longer accepting operations
|
|
* from your process. That is, the process is being destroyed.
|
|
* You should handle this by exiting from your process. Note
|
|
* that once this error code is returned, all further calls to
|
|
* the driver from any thread will return this same code.
|
|
*/
|
|
|
|
enum transaction_flags {
|
|
TF_ONE_WAY = 0x01, /* this is a one-way call: async, no return */
|
|
TF_ROOT_OBJECT = 0x04, /* contents are the component's root object */
|
|
TF_STATUS_CODE = 0x08, /* contents are a 32-bit status code */
|
|
TF_ACCEPT_FDS = 0x10, /* allow replies with file descriptors */
|
|
};
|
|
|
|
struct binder_transaction_data {
|
|
/* The first two are only used for bcTRANSACTION and brTRANSACTION,
|
|
* identifying the target and contents of the transaction.
|
|
*/
|
|
union {
|
|
/* target descriptor of command transaction */
|
|
__u32 handle;
|
|
/* target descriptor of return transaction */
|
|
binder_uintptr_t ptr;
|
|
} target;
|
|
binder_uintptr_t cookie; /* target object cookie */
|
|
__u32 code; /* transaction command */
|
|
|
|
/* General information about the transaction. */
|
|
__u32 flags;
|
|
pid_t sender_pid;
|
|
uid_t sender_euid;
|
|
binder_size_t data_size; /* number of bytes of data */
|
|
binder_size_t offsets_size; /* number of bytes of offsets */
|
|
|
|
/* If this transaction is inline, the data immediately
|
|
* follows here; otherwise, it ends with a pointer to
|
|
* the data buffer.
|
|
*/
|
|
union {
|
|
struct {
|
|
/* transaction data */
|
|
binder_uintptr_t buffer;
|
|
/* offsets from buffer to flat_binder_object structs */
|
|
binder_uintptr_t offsets;
|
|
} ptr;
|
|
__u8 buf[8];
|
|
} 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;
|
|
};
|
|
|
|
struct binder_handle_cookie {
|
|
__u32 handle;
|
|
binder_uintptr_t cookie;
|
|
} __packed;
|
|
|
|
struct binder_pri_desc {
|
|
__s32 priority;
|
|
__u32 desc;
|
|
};
|
|
|
|
struct binder_pri_ptr_cookie {
|
|
__s32 priority;
|
|
binder_uintptr_t ptr;
|
|
binder_uintptr_t cookie;
|
|
};
|
|
|
|
enum binder_driver_return_protocol {
|
|
BR_ERROR = _IOR('r', 0, __s32),
|
|
/*
|
|
* int: error code
|
|
*/
|
|
|
|
BR_OK = _IO('r', 1),
|
|
/* No parameters! */
|
|
|
|
BR_TRANSACTION = _IOR('r', 2, struct binder_transaction_data),
|
|
BR_REPLY = _IOR('r', 3, struct binder_transaction_data),
|
|
/*
|
|
* binder_transaction_data: the received command.
|
|
*/
|
|
|
|
BR_ACQUIRE_RESULT = _IOR('r', 4, __s32),
|
|
/*
|
|
* not currently supported
|
|
* int: 0 if the last bcATTEMPT_ACQUIRE was not successful.
|
|
* Else the remote object has acquired a primary reference.
|
|
*/
|
|
|
|
BR_DEAD_REPLY = _IO('r', 5),
|
|
/*
|
|
* The target of the last transaction (either a bcTRANSACTION or
|
|
* a bcATTEMPT_ACQUIRE) is no longer with us. No parameters.
|
|
*/
|
|
|
|
BR_TRANSACTION_COMPLETE = _IO('r', 6),
|
|
/*
|
|
* No parameters... always refers to the last transaction requested
|
|
* (including replies). Note that this will be sent even for
|
|
* asynchronous transactions.
|
|
*/
|
|
|
|
BR_INCREFS = _IOR('r', 7, struct binder_ptr_cookie),
|
|
BR_ACQUIRE = _IOR('r', 8, struct binder_ptr_cookie),
|
|
BR_RELEASE = _IOR('r', 9, struct binder_ptr_cookie),
|
|
BR_DECREFS = _IOR('r', 10, struct binder_ptr_cookie),
|
|
/*
|
|
* void *: ptr to binder
|
|
* void *: cookie for binder
|
|
*/
|
|
|
|
BR_ATTEMPT_ACQUIRE = _IOR('r', 11, struct binder_pri_ptr_cookie),
|
|
/*
|
|
* not currently supported
|
|
* int: priority
|
|
* void *: ptr to binder
|
|
* void *: cookie for binder
|
|
*/
|
|
|
|
BR_NOOP = _IO('r', 12),
|
|
/*
|
|
* No parameters. Do nothing and examine the next command. It exists
|
|
* primarily so that we can replace it with a BR_SPAWN_LOOPER command.
|
|
*/
|
|
|
|
BR_SPAWN_LOOPER = _IO('r', 13),
|
|
/*
|
|
* No parameters. The driver has determined that a process has no
|
|
* threads waiting to service incoming transactions. When a process
|
|
* receives this command, it must spawn a new service thread and
|
|
* register it via bcENTER_LOOPER.
|
|
*/
|
|
|
|
BR_FINISHED = _IO('r', 14),
|
|
/*
|
|
* not currently supported
|
|
* stop threadpool thread
|
|
*/
|
|
|
|
BR_DEAD_BINDER = _IOR('r', 15, binder_uintptr_t),
|
|
/*
|
|
* void *: cookie
|
|
*/
|
|
BR_CLEAR_DEATH_NOTIFICATION_DONE = _IOR('r', 16, binder_uintptr_t),
|
|
/*
|
|
* void *: cookie
|
|
*/
|
|
|
|
BR_FAILED_REPLY = _IO('r', 17),
|
|
/*
|
|
* The the last transaction (either a bcTRANSACTION or
|
|
* a bcATTEMPT_ACQUIRE) failed (e.g. out of memory). No parameters.
|
|
*/
|
|
};
|
|
|
|
enum binder_driver_command_protocol {
|
|
BC_TRANSACTION = _IOW('c', 0, struct binder_transaction_data),
|
|
BC_REPLY = _IOW('c', 1, struct binder_transaction_data),
|
|
/*
|
|
* binder_transaction_data: the sent command.
|
|
*/
|
|
|
|
BC_ACQUIRE_RESULT = _IOW('c', 2, __s32),
|
|
/*
|
|
* not currently supported
|
|
* int: 0 if the last BR_ATTEMPT_ACQUIRE was not successful.
|
|
* Else you have acquired a primary reference on the object.
|
|
*/
|
|
|
|
BC_FREE_BUFFER = _IOW('c', 3, binder_uintptr_t),
|
|
/*
|
|
* void *: ptr to transaction data received on a read
|
|
*/
|
|
|
|
BC_INCREFS = _IOW('c', 4, __u32),
|
|
BC_ACQUIRE = _IOW('c', 5, __u32),
|
|
BC_RELEASE = _IOW('c', 6, __u32),
|
|
BC_DECREFS = _IOW('c', 7, __u32),
|
|
/*
|
|
* int: descriptor
|
|
*/
|
|
|
|
BC_INCREFS_DONE = _IOW('c', 8, struct binder_ptr_cookie),
|
|
BC_ACQUIRE_DONE = _IOW('c', 9, struct binder_ptr_cookie),
|
|
/*
|
|
* void *: ptr to binder
|
|
* void *: cookie for binder
|
|
*/
|
|
|
|
BC_ATTEMPT_ACQUIRE = _IOW('c', 10, struct binder_pri_desc),
|
|
/*
|
|
* not currently supported
|
|
* int: priority
|
|
* int: descriptor
|
|
*/
|
|
|
|
BC_REGISTER_LOOPER = _IO('c', 11),
|
|
/*
|
|
* No parameters.
|
|
* Register a spawned looper thread with the device.
|
|
*/
|
|
|
|
BC_ENTER_LOOPER = _IO('c', 12),
|
|
BC_EXIT_LOOPER = _IO('c', 13),
|
|
/*
|
|
* No parameters.
|
|
* These two commands are sent as an application-level thread
|
|
* enters and exits the binder loop, respectively. They are
|
|
* used so the binder can have an accurate count of the number
|
|
* of looping threads it has available.
|
|
*/
|
|
|
|
BC_REQUEST_DEATH_NOTIFICATION = _IOW('c', 14,
|
|
struct binder_handle_cookie),
|
|
/*
|
|
* int: handle
|
|
* void *: cookie
|
|
*/
|
|
|
|
BC_CLEAR_DEATH_NOTIFICATION = _IOW('c', 15,
|
|
struct binder_handle_cookie),
|
|
/*
|
|
* int: handle
|
|
* void *: cookie
|
|
*/
|
|
|
|
BC_DEAD_BINDER_DONE = _IOW('c', 16, binder_uintptr_t),
|
|
/*
|
|
* 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 /* _UAPI_LINUX_BINDER_H */
|
|
|