ANDROID: make list_lru/task_work C functions available to Rust
Binder calls these C functions directly, so they need to be callable from Rust. This change can be reverted once b/394605825 is fixed. Bug: 388786466 Bug: 394605825 Change-Id: I02af16a1dc50a3a7595c0f40494e8054e563e74d Signed-off-by: Alice Ryhl <aliceryhl@google.com>
This commit is contained in:
@@ -13,11 +13,13 @@
|
||||
#include <linux/cred.h>
|
||||
#include <linux/errname.h>
|
||||
#include <linux/ethtool.h>
|
||||
#include <linux/fdtable.h>
|
||||
#include <linux/file.h>
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/jump_label.h>
|
||||
#include <linux/list_lru.h>
|
||||
#include <linux/mdio.h>
|
||||
#include <linux/miscdevice.h>
|
||||
#include <linux/phy.h>
|
||||
@@ -27,6 +29,7 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/security.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/task_work.h>
|
||||
#include <linux/tracepoint.h>
|
||||
#include <linux/wait.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
#include <linux/list_lru.h>
|
||||
#include <linux/task_work.h>
|
||||
|
||||
unsigned long rust_helper_list_lru_count(struct list_lru *lru)
|
||||
{
|
||||
return list_lru_count(lru);
|
||||
}
|
||||
|
||||
unsigned long rust_helper_list_lru_walk(struct list_lru *lru,
|
||||
list_lru_walk_cb isolate, void *cb_arg,
|
||||
unsigned long nr_to_walk)
|
||||
{
|
||||
return list_lru_walk(lru, isolate, cb_arg, nr_to_walk);
|
||||
}
|
||||
|
||||
void rust_helper_init_task_work(struct callback_head *twork,
|
||||
task_work_func_t func)
|
||||
{
|
||||
init_task_work(twork, func);
|
||||
}
|
||||
@@ -7,6 +7,7 @@
|
||||
* Sorted alphabetically.
|
||||
*/
|
||||
|
||||
#include "binder.c"
|
||||
#include "blk.c"
|
||||
#include "bug.c"
|
||||
#include "build_assert.c"
|
||||
|
||||
Reference in New Issue
Block a user