drivers/android/binder/rust_binder.h
Source file repositories/reference/linux-study-clean/drivers/android/binder/rust_binder.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/android/binder/rust_binder.h- Extension
.h- Size
- 2496 bytes
- Lines
- 108
- Domain
- Driver Families
- Bucket
- drivers/android
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
uapi/linux/android/binder.huapi/linux/android/binderfs.h
Detected Declarations
struct dentrystruct inodestruct rb_process_layoutstruct rb_transaction_layoutstruct rb_node_layoutstruct rust_binder_layoutfunction rust_binder_transaction_debug_idfunction rust_binder_transaction_codefunction rust_binder_transaction_flagsfunction rust_binder_transaction_target_nodefunction rust_binder_transaction_to_procfunction rust_binder_node_debug_idfunction rust_binder_node_ptr
Annotated Snippet
struct rb_process_layout {
size_t arc_offset;
size_t task;
};
struct rb_transaction_layout {
size_t debug_id;
size_t code;
size_t flags;
size_t from_thread;
size_t to_proc;
size_t target_node;
};
struct rb_node_layout {
size_t arc_offset;
size_t debug_id;
size_t ptr;
};
struct rust_binder_layout {
struct rb_transaction_layout t;
struct rb_process_layout p;
struct rb_node_layout n;
};
extern const struct rust_binder_layout RUST_BINDER_LAYOUT;
static inline size_t rust_binder_transaction_debug_id(rust_binder_transaction t)
{
return *(size_t *) (t + RUST_BINDER_LAYOUT.t.debug_id);
}
static inline u32 rust_binder_transaction_code(rust_binder_transaction t)
{
return *(u32 *) (t + RUST_BINDER_LAYOUT.t.code);
}
static inline u32 rust_binder_transaction_flags(rust_binder_transaction t)
{
return *(u32 *) (t + RUST_BINDER_LAYOUT.t.flags);
}
// Nullable!
static inline rust_binder_node rust_binder_transaction_target_node(rust_binder_transaction t)
{
void *p = *(void **) (t + RUST_BINDER_LAYOUT.t.target_node);
if (p)
p = p + RUST_BINDER_LAYOUT.n.arc_offset;
return p;
}
static inline rust_binder_process rust_binder_transaction_to_proc(rust_binder_transaction t)
{
void *p = *(void **) (t + RUST_BINDER_LAYOUT.t.to_proc);
return p + RUST_BINDER_LAYOUT.p.arc_offset;
}
static inline struct task_struct *rust_binder_process_task(rust_binder_process t)
{
return *(struct task_struct **) (t + RUST_BINDER_LAYOUT.p.task);
}
static inline size_t rust_binder_node_debug_id(rust_binder_node t)
{
return *(size_t *) (t + RUST_BINDER_LAYOUT.n.debug_id);
}
static inline binder_uintptr_t rust_binder_node_ptr(rust_binder_node t)
{
return *(binder_uintptr_t *) (t + RUST_BINDER_LAYOUT.n.ptr);
}
#endif
Annotation
- Immediate include surface: `uapi/linux/android/binder.h`, `uapi/linux/android/binderfs.h`.
- Detected declarations: `struct dentry`, `struct inode`, `struct rb_process_layout`, `struct rb_transaction_layout`, `struct rb_node_layout`, `struct rust_binder_layout`, `function rust_binder_transaction_debug_id`, `function rust_binder_transaction_code`, `function rust_binder_transaction_flags`, `function rust_binder_transaction_target_node`.
- Atlas domain: Driver Families / drivers/android.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.