[patch 23/38] alpha: Select ARCH_HAS_RANDOM_ENTROPY
Thomas Gleixner <[email protected]> Fri, 10 Apr 2026 14:20:21 +0200
| Newsgroups | org.kernel.vger.linux-hams,dev.linux.lists.iommu,dev.linux.lists.loongarch,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-riscv,org.kernel.vger.linux-alpha,org.kernel.vger.linux-crypto,org.kernel.vger.linux-ext4,org.kernel.vger.linux-fbdev,org.kernel.vger.linux-kernel,org.kernel.vger.linux-m68k,org.kernel.vger.linux-openrisc,org.kernel.vger.linux-parisc,org.kernel.vger.linux-s390,org.kernel.vger.linux-wireless,org.kernel.vger.netdev,org.kernel.vger.sparclinux,org.kvack.linux-mm,org.ozlabs.lists.linuxppc-dev |
|---|---|
| Message-ID | <[email protected]> |
The only remaining usage of get_cycles() is to provide random_get_entropy(). Switch alpha over to the new scheme of selecting ARCH_HAS_RANDOM_ENTROPY and providing random_get_entropy() in asm/random.h. Remove asm/timex.h as it has no functionality anymore. Signed-off-by: Thomas Gleixner <[email protected]> Cc: Richard Henderson <[email protected]> Cc: [email protected] --- arch/alpha/Kconfig | 1 + arch/alpha/include/asm/random.h | 14 ++++++++++++++ arch/alpha/include/asm/timex.h | 26 -------------------------- 3 files changed, 15 insertions(+), 26 deletions(-) --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig @@ -5,6 +5,7 @@ config ALPHA select ARCH_32BIT_USTAT_F_TINODE select ARCH_HAS_CURRENT_STACK_POINTER select ARCH_HAS_DMA_OPS if PCI + select ARCH_HAS_RANDOM_ENTROPY select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_MIGHT_HAVE_PC_SERIO select ARCH_MODULE_NEEDS_WEAK_PER_CPU if SMP --- /dev/null +++ b/arch/alpha/include/asm/random.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASMALPHA_RANDOM_H +#define _ASMALPHA_RANDOM_H + +/* Use the cycle counter for entropy. */ +static inline unsigned long random_get_entropy(void) +{ + unsigned long ret; + + __asm__ __volatile__ ("rpcc %0" : "=r"(ret)); + return ret; +} + +#endif --- a/arch/alpha/include/asm/timex.h +++ /dev/null @@ -1,26 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * linux/include/asm-alpha/timex.h - * - * ALPHA architecture timex specifications - */ -#ifndef _ASMALPHA_TIMEX_H -#define _ASMALPHA_TIMEX_H - -/* - * Standard way to access the cycle counter. - * Currently only used on SMP for scheduling. - * - * Only the low 32 bits are available as a continuously counting entity. - * But this only means we'll force a reschedule every 8 seconds or so, - * which isn't an evil thing. - */ -static inline cycles_t get_cycles (void) -{ - cycles_t ret; - __asm__ __volatile__ ("rpcc %0" : "=r"(ret)); - return ret; -} -#define get_cycles get_cycles - -#endif