• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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) 2024 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, spinlock_t *lock,
17 				   void *cb_arg);
18 
19 enum lru_status
rust_shrink_free_page_wrap(struct list_head * item,struct list_lru_one * list,spinlock_t * lock,void * cb_arg)20 rust_shrink_free_page_wrap(struct list_head *item, struct list_lru_one *list,
21 			   spinlock_t *lock, void *cb_arg)
22 {
23 	return rust_shrink_free_page(item, list, lock, cb_arg);
24 }
25