xref: /linux/drivers/android/binder/page_range_helper.c (revision 6093a688a07da07808f0122f9aa2a3eed250d853)
1 // SPDX-License-Identifier: GPL-2.0
2 
3 /* C helper for page_range.rs to work around a CFI violation.
4  *
5  * Bindgen currently pretends that `enum lru_status` is the same as an integer.
6  * This assumption is fine ABI-wise, but once you add CFI to the mix, it
7  * triggers a CFI violation because `enum lru_status` gets a different CFI tag.
8  *
9  * This file contains a workaround until bindgen can be fixed.
10  *
11  * Copyright (C) 2025 Google LLC.
12  */
13 #include "page_range_helper.h"
14 
15 unsigned int rust_shrink_free_page(struct list_head *item,
16 				   struct list_lru_one *list,
17 				   void *cb_arg);
18 
19 enum lru_status
20 rust_shrink_free_page_wrap(struct list_head *item, struct list_lru_one *list,
21 			   void *cb_arg)
22 {
23 	return rust_shrink_free_page(item, list, cb_arg);
24 }
25