hc
2024-09-20 a36159eec6ca17402b0e146b86efaf76568dc353
kernel/include/uapi/linux/android/binder.h
....@@ -67,6 +67,7 @@
6767 * @FLAT_BINDER_FLAG_ACCEPTS_FDS: whether the node accepts fds.
6868 */
6969 FLAT_BINDER_FLAG_ACCEPTS_FDS = 0x100,
70
+
7071 /**
7172 * @FLAT_BINDER_FLAG_SCHED_POLICY_MASK: bit-mask for scheduling policy
7273 *
....@@ -264,6 +265,25 @@
264265 __u32 reserved3;
265266 };
266267
268
+struct binder_freeze_info {
269
+ __u32 pid;
270
+ __u32 enable;
271
+ __u32 timeout_ms;
272
+};
273
+
274
+struct binder_frozen_status_info {
275
+ __u32 pid;
276
+
277
+ /* process received sync transactions since last frozen
278
+ * bit 0: received sync transaction after being frozen
279
+ * bit 1: new pending sync transaction during freezing
280
+ */
281
+ __u32 sync_recv;
282
+
283
+ /* process received async transactions since last frozen */
284
+ __u32 async_recv;
285
+};
286
+
267287 #define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
268288 #define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64)
269289 #define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)
....@@ -274,6 +294,9 @@
274294 #define BINDER_GET_NODE_DEBUG_INFO _IOWR('b', 11, struct binder_node_debug_info)
275295 #define BINDER_GET_NODE_INFO_FOR_REF _IOWR('b', 12, struct binder_node_info_for_ref)
276296 #define BINDER_SET_CONTEXT_MGR_EXT _IOW('b', 13, struct flat_binder_object)
297
+#define BINDER_FREEZE _IOW('b', 14, struct binder_freeze_info)
298
+#define BINDER_GET_FROZEN_INFO _IOWR('b', 15, struct binder_frozen_status_info)
299
+#define BINDER_ENABLE_ONEWAY_SPAM_DETECTION _IOW('b', 16, __u32)
277300
278301 /*
279302 * NOTE: Two special error codes you should check for when calling
....@@ -295,6 +318,8 @@
295318 TF_ROOT_OBJECT = 0x04, /* contents are the component's root object */
296319 TF_STATUS_CODE = 0x08, /* contents are a 32-bit status code */
297320 TF_ACCEPT_FDS = 0x10, /* allow replies with file descriptors */
321
+ TF_CLEAR_BUF = 0x20, /* clear buffer on txn complete */
322
+ TF_UPDATE_TXN = 0x40, /* update the outdated pending async txn */
298323 };
299324
300325 struct binder_transaction_data {
....@@ -451,9 +476,22 @@
451476
452477 BR_FAILED_REPLY = _IO('r', 17),
453478 /*
454
- * The the last transaction (either a bcTRANSACTION or
479
+ * The last transaction (either a bcTRANSACTION or
455480 * a bcATTEMPT_ACQUIRE) failed (e.g. out of memory). No parameters.
456481 */
482
+
483
+ BR_FROZEN_REPLY = _IO('r', 18),
484
+ /*
485
+ * The target of the last transaction (either a bcTRANSACTION or
486
+ * a bcATTEMPT_ACQUIRE) is frozen. No parameters.
487
+ */
488
+
489
+ BR_ONEWAY_SPAM_SUSPECT = _IO('r', 19),
490
+ /*
491
+ * Current process sent too many oneway calls to target, and the last
492
+ * asynchronous transaction makes the allocated async buffer size exceed
493
+ * detection threshold. No parameters.
494
+ */
457495 };
458496
459497 enum binder_driver_command_protocol {