Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 1927afa4 authored by Abhishek Pandit-Subedi's avatar Abhishek Pandit-Subedi Committed by Abhishek Pandit-Subedi
Browse files

Refactor topshim with bindgen and unsafe code

Writing topshim interfaces is very tedious and lots of code is
duplicated in C++. Rather that depend on unsafe C++ code, we write
a small amount of unsafe Rust code and use macros to interact with the
native layer directly from Rust.

A few major changes introduced in this patch:
- Bindgen to get Rust interface into C
- Macros to call raw pointer functions directly
- Macros to handle converting a callback into an enum variant
- Refactor code to use new data structures
- Replace use of closures for callbacks with an enum and dispatch fn

This change also updates the bindgen requirement to 0.57 to match what
Android is already using.

BYPASS_INCLUSIVE_LANGUAGE_REASON=Bindgen dependency provides this api

Bug: 183208689
Tag: #floss
Test: atest --host bluetooth_test_gd
Change-Id: Iebe904ebc2643b48d1a371051fbf3c06f2bf04d4
parent ebf26de3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment