summaryrefslogtreecommitdiff
path: root/tools/sched_ext/include/scx/const-defs.h
blob: 4c8f45756b5112d7240de386d29cfa916926ff01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (c) 2026 Tejun Heo <tj@kernel.org> */
#pragma once

/*
 * Constants shared across the BPF headers, the lib and the schedulers.
 * Freestanding so that scheduler interface headers consumed by bindgen can
 * include it. Rust code cannot, so rust/scx_arena/scx_arena/src/lib.rs mirrors
 * the values. Keep them in sync.
 */
enum scx_const_defs {
	/* mirrors the kernel's per-arch L1_CACHE_SHIFT */
#if defined(__TARGET_ARCH_s390) || defined(__s390x__)
	SCX_CACHELINE_SIZE	= 256,
#elif defined(__TARGET_ARCH_powerpc) || defined(__powerpc64__)
	SCX_CACHELINE_SIZE	= 128,
#else
	SCX_CACHELINE_SIZE	= 64,
#endif
};