Merge tag 'dma-mapping-6.10-2024-05-31' of git://git.infradead.org/users/hch/dma...
[linux-block.git] / kernel / bounds.c
CommitLineData
b2441318 1// SPDX-License-Identifier: GPL-2.0
1cdf25d7
CL
2/*
3 * Generate definitions needed by the preprocessor.
4 * This code generates raw asm output which is post-processed
5 * to extract and format the required data.
6 */
7
8#define __GENERATING_BOUNDS_H
9/* Include headers that define the enum constants of interest */
9223b419 10#include <linux/page-flags.h>
97965478 11#include <linux/mmzone.h>
37487a56 12#include <linux/kbuild.h>
90572890 13#include <linux/log2.h>
24b9fdc5 14#include <linux/spinlock_types.h>
1cdf25d7 15
6a32c246 16int main(void)
1cdf25d7 17{
01fc0ac1 18 /* The enum constants to put into include/generated/bounds.h */
9223b419 19 DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS);
97965478 20 DEFINE(MAX_NR_ZONES, __MAX_NR_ZONES);
90572890 21#ifdef CONFIG_SMP
5af385f5 22 DEFINE(NR_CPUS_BITS, order_base_2(CONFIG_NR_CPUS));
90572890 23#endif
597d795a 24 DEFINE(SPINLOCK_SIZE, sizeof(spinlock_t));
ec1c86b2
YZ
25#ifdef CONFIG_LRU_GEN
26 DEFINE(LRU_GEN_WIDTH, order_base_2(MAX_NR_GENS + 1));
ac35a490 27 DEFINE(__LRU_REFS_WIDTH, MAX_NR_TIERS - 2);
ec1c86b2
YZ
28#else
29 DEFINE(LRU_GEN_WIDTH, 0);
ac35a490 30 DEFINE(__LRU_REFS_WIDTH, 0);
ec1c86b2 31#endif
1cdf25d7 32 /* End of constants */
6a32c246
AB
33
34 return 0;
1cdf25d7 35}