Files

37 lines
974 B
C
Raw Permalink Normal View History

// SPDX-License-Identifier: GPL-2.0
/*
* Generate definitions needed by the preprocessor.
* This code generates raw asm output which is post-processed
* to extract and format the required data.
*/
#define __GENERATING_BOUNDS_H
2025-12-02 09:59:37 -08:00
#define COMPILE_OFFSETS
/* Include headers that define the enum constants of interest */
2008-04-28 02:12:48 -07:00
#include <linux/page-flags.h>
2008-04-28 02:12:54 -07:00
#include <linux/mmzone.h>
#include <linux/kbuild.h>
#include <linux/log2.h>
#include <linux/spinlock_types.h>
2018-10-30 15:07:32 -07:00
int main(void)
{
2009-04-19 21:57:19 +02:00
/* The enum constants to put into include/generated/bounds.h */
2008-04-28 02:12:48 -07:00
DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS);
2008-04-28 02:12:54 -07:00
DEFINE(MAX_NR_ZONES, __MAX_NR_ZONES);
#ifdef CONFIG_SMP
DEFINE(NR_CPUS_BITS, order_base_2(CONFIG_NR_CPUS));
#endif
DEFINE(SPINLOCK_SIZE, sizeof(spinlock_t));
2022-09-18 02:00:02 -06:00
#ifdef CONFIG_LRU_GEN
DEFINE(LRU_GEN_WIDTH, order_base_2(MAX_NR_GENS + 1));
2022-09-18 02:00:03 -06:00
DEFINE(__LRU_REFS_WIDTH, MAX_NR_TIERS - 2);
2022-09-18 02:00:02 -06:00
#else
DEFINE(LRU_GEN_WIDTH, 0);
2022-09-18 02:00:03 -06:00
DEFINE(__LRU_REFS_WIDTH, 0);
2022-09-18 02:00:02 -06:00
#endif
/* End of constants */
2018-10-30 15:07:32 -07:00
return 0;
}