forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cpu/SMT: Move SMT prototypes into cpu_smt.h
In order to export the cpuhp_smt_control enum as part of the interface between generic and architecture code, the architecture code needs to include asm/topology.h. But that leads to circular header dependencies. So split the enum and related declarations into a separate header. [ ldufour: Reworded the commit's description ] Signed-off-by: Michael Ellerman <[email protected]> Signed-off-by: Laurent Dufour <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Zhang Rui <[email protected]> Link: https://lore.kernel.org/r/[email protected]
- Loading branch information
Showing
4 changed files
with
33 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef _LINUX_CPU_SMT_H_ | ||
#define _LINUX_CPU_SMT_H_ | ||
|
||
enum cpuhp_smt_control { | ||
CPU_SMT_ENABLED, | ||
CPU_SMT_DISABLED, | ||
CPU_SMT_FORCE_DISABLED, | ||
CPU_SMT_NOT_SUPPORTED, | ||
CPU_SMT_NOT_IMPLEMENTED, | ||
}; | ||
|
||
#if defined(CONFIG_SMP) && defined(CONFIG_HOTPLUG_SMT) | ||
extern enum cpuhp_smt_control cpu_smt_control; | ||
extern void cpu_smt_disable(bool force); | ||
extern void cpu_smt_check_topology(void); | ||
extern bool cpu_smt_possible(void); | ||
extern int cpuhp_smt_enable(void); | ||
extern int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval); | ||
#else | ||
# define cpu_smt_control (CPU_SMT_NOT_IMPLEMENTED) | ||
static inline void cpu_smt_disable(bool force) { } | ||
static inline void cpu_smt_check_topology(void) { } | ||
static inline bool cpu_smt_possible(void) { return false; } | ||
static inline int cpuhp_smt_enable(void) { return 0; } | ||
static inline int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval) { return 0; } | ||
#endif | ||
|
||
#endif /* _LINUX_CPU_SMT_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters