mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-06 17:35:20 +02:00
UPSTREAM: binder: use enum for binder ioctls
All of the other constants in this file are defined using enums, so make
the constants more consistent by defining the ioctls in an enum as well.
This is necessary for Rust Binder since the _IO macros are too
complicated for bindgen to see that they expand to integer constants.
Replacing the #defines with an enum forces bindgen to evaluate them
properly, which allows us to access them from Rust.
I originally intended to include this change in the first patch of the
Rust Binder patchset [1], but at plumbers Carlos Llamas told me that
this change has been discussed previously [2] and suggested that I send
it upstream separately.
Link: https://lore.kernel.org/rust-for-linux/20231101-rust-binder-v1-1-08ba9197f637@google.com/ [1]
Link: https://lore.kernel.org/all/YoIK2l6xbQMPGZHy@kroah.com/ [2]
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20231208152801.3425772-1-aliceryhl@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Upstream commit 3634783be1
]
Change-Id: I17fa6248f72332e348d6c19aa4764c420c83ecd6
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
This commit is contained in:
parent
fbb9dbf62c
commit
4c5e3e9f01
|
@ -299,20 +299,22 @@ struct binder_extended_error {
|
||||||
__s32 param;
|
__s32 param;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
|
enum {
|
||||||
#define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64)
|
BINDER_WRITE_READ = _IOWR('b', 1, struct binder_write_read),
|
||||||
#define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)
|
BINDER_SET_IDLE_TIMEOUT = _IOW('b', 3, __s64),
|
||||||
#define BINDER_SET_IDLE_PRIORITY _IOW('b', 6, __s32)
|
BINDER_SET_MAX_THREADS = _IOW('b', 5, __u32),
|
||||||
#define BINDER_SET_CONTEXT_MGR _IOW('b', 7, __s32)
|
BINDER_SET_IDLE_PRIORITY = _IOW('b', 6, __s32),
|
||||||
#define BINDER_THREAD_EXIT _IOW('b', 8, __s32)
|
BINDER_SET_CONTEXT_MGR = _IOW('b', 7, __s32),
|
||||||
#define BINDER_VERSION _IOWR('b', 9, struct binder_version)
|
BINDER_THREAD_EXIT = _IOW('b', 8, __s32),
|
||||||
#define BINDER_GET_NODE_DEBUG_INFO _IOWR('b', 11, struct binder_node_debug_info)
|
BINDER_VERSION = _IOWR('b', 9, struct binder_version),
|
||||||
#define BINDER_GET_NODE_INFO_FOR_REF _IOWR('b', 12, struct binder_node_info_for_ref)
|
BINDER_GET_NODE_DEBUG_INFO = _IOWR('b', 11, struct binder_node_debug_info),
|
||||||
#define BINDER_SET_CONTEXT_MGR_EXT _IOW('b', 13, struct flat_binder_object)
|
BINDER_GET_NODE_INFO_FOR_REF = _IOWR('b', 12, struct binder_node_info_for_ref),
|
||||||
#define BINDER_FREEZE _IOW('b', 14, struct binder_freeze_info)
|
BINDER_SET_CONTEXT_MGR_EXT = _IOW('b', 13, struct flat_binder_object),
|
||||||
#define BINDER_GET_FROZEN_INFO _IOWR('b', 15, struct binder_frozen_status_info)
|
BINDER_FREEZE = _IOW('b', 14, struct binder_freeze_info),
|
||||||
#define BINDER_ENABLE_ONEWAY_SPAM_DETECTION _IOW('b', 16, __u32)
|
BINDER_GET_FROZEN_INFO = _IOWR('b', 15, struct binder_frozen_status_info),
|
||||||
#define BINDER_GET_EXTENDED_ERROR _IOWR('b', 17, struct binder_extended_error)
|
BINDER_ENABLE_ONEWAY_SPAM_DETECTION = _IOW('b', 16, __u32),
|
||||||
|
BINDER_GET_EXTENDED_ERROR = _IOWR('b', 17, struct binder_extended_error),
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NOTE: Two special error codes you should check for when calling
|
* NOTE: Two special error codes you should check for when calling
|
||||||
|
|
Loading…
Reference in New Issue
Block a user