Skip to content

Commit

Permalink
PowerPC: Fix build failures on kernels built without CONFIG_SPE
Browse files Browse the repository at this point in the history
Closes #14233
Reported-by: Rich Ercolani <[email protected]>
Tested-by: Georgy Yakovlev <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
  • Loading branch information
ryao committed Dec 1, 2022
1 parent 7764411 commit b4811d4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions include/os/linux/kernel/linux/simd_powerpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
#define kfpu_allowed() 1

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
#ifdef CONFIG_SPE
#define kfpu_begin() \
{ \
preempt_disable(); \
Expand All @@ -83,6 +84,20 @@
disable_kernel_altivec(); \
preempt_enable(); \
}
#else /* CONFIG_SPE */
#define kfpu_begin() \
{ \
preempt_disable(); \
enable_kernel_altivec(); \
enable_kernel_vsx(); \
}
#define kfpu_end() \
{ \
disable_kernel_vsx(); \
disable_kernel_altivec(); \
preempt_enable(); \
}
#endif
#else
/* seems that before 4.5 no-one bothered */
#define kfpu_begin()
Expand Down

0 comments on commit b4811d4

Please sign in to comment.