From 474781b2703de37ea7a484fd4cdfde5103e48d01 Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Fri, 23 Jul 2021 10:21:48 -0600 Subject: arch/{arm,ppc64,riscv}: Remove cpu_info The structure and function are not currently used or implemented. x86 is the only arch that currently implements it. It is currently used for COOP_MULTITASKING and mp_init. Keeping around the unused definitions leads to confusion. BUG=b:179699789 TEST=none Signed-off-by: Raul E Rangel Change-Id: I0775ef03168f7f9c41b1b05cb8f12724d0458ba5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56572 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- src/arch/arm/Makefile.inc | 1 - src/arch/arm/cpu.c | 19 ------------------- src/arch/arm/include/armv7/arch/cpu.h | 1 - src/arch/ppc64/include/arch/cpu.h | 12 ------------ src/arch/riscv/include/arch/cpu.h | 11 ----------- 5 files changed, 44 deletions(-) delete mode 100644 src/arch/arm/cpu.c (limited to 'src') diff --git a/src/arch/arm/Makefile.inc b/src/arch/arm/Makefile.inc index 63367bb2c0..b18b137252 100644 --- a/src/arch/arm/Makefile.inc +++ b/src/arch/arm/Makefile.inc @@ -106,7 +106,6 @@ ifeq ($(CONFIG_ARCH_RAMSTAGE_ARM),y) ramstage-y += stages.c ramstage-y += div0.c -ramstage-$(CONFIG_COOP_MULTITASKING) += cpu.c ramstage-y += eabi_compat.c ramstage-y += boot.c ramstage-y += tables.c diff --git a/src/arch/arm/cpu.c b/src/arch/arm/cpu.c deleted file mode 100644 index 75816d3fc0..0000000000 --- a/src/arch/arm/cpu.c +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause */ - -#include -#include - -/* Return the CPU struct which is at the high memory address of the stack. - */ -struct cpu_info *cpu_info(void) -{ -#error "This is BROKEN! ARM stacks are currently not guaranteed to be " \ - "STACK_SIZE-aligned in any way. If you ever plan to revive this " \ - "feature, make sure you add the proper assertions " \ - "(and maybe consider revising the whole thing to work closer to what " \ - "arm64 is doing now)." - uintptr_t addr = ALIGN_UP((uintptr_t)__builtin_frame_address(0), - CONFIG_STACK_SIZE); - addr -= sizeof(struct cpu_info); - return (void *)addr; -} diff --git a/src/arch/arm/include/armv7/arch/cpu.h b/src/arch/arm/include/armv7/arch/cpu.h index af79344836..3f1f1ae811 100644 --- a/src/arch/arm/include/armv7/arch/cpu.h +++ b/src/arch/arm/include/armv7/arch/cpu.h @@ -75,5 +75,4 @@ static inline void set_system_mode(void) asm volatile("msr cpsr_c, %0" :: "r"(0x1f | 0xc0)); } -struct cpu_info *cpu_info(void); #endif /* __ARCH_CPU_H__ */ diff --git a/src/arch/ppc64/include/arch/cpu.h b/src/arch/ppc64/include/arch/cpu.h index d41b94a450..5e5ba30ab5 100644 --- a/src/arch/ppc64/include/arch/cpu.h +++ b/src/arch/ppc64/include/arch/cpu.h @@ -12,22 +12,10 @@ struct cpu_driver { const struct cpu_device_id *id_table; }; -struct thread; - -struct cpu_info { - struct device *cpu; - unsigned long index; -#if CONFIG(COOP_MULTITASKING) - struct thread *thread; -#endif -}; - struct cpuinfo_ppc64 { uint8_t ppc64; /* CPU family */ uint8_t ppc64_vendor; /* CPU vendor */ uint8_t ppc64_model; }; -struct cpu_info *cpu_info(void); - #endif /* __ARCH_CPU_H__ */ diff --git a/src/arch/riscv/include/arch/cpu.h b/src/arch/riscv/include/arch/cpu.h index d623e84241..7cf94615a6 100644 --- a/src/arch/riscv/include/arch/cpu.h +++ b/src/arch/riscv/include/arch/cpu.h @@ -13,16 +13,6 @@ struct cpu_driver { const struct cpu_device_id *id_table; }; -struct thread; - -struct cpu_info { - struct device *cpu; - unsigned long index; -#if CONFIG(COOP_MULTITASKING) - struct thread *thread; -#endif -}; - struct cpuinfo_riscv { uint8_t riscv; /* CPU family */ uint8_t riscv_vendor; /* CPU vendor */ @@ -40,5 +30,4 @@ static inline int machine_xlen(void) return (1 << mxl) * 16; } -struct cpu_info *cpu_info(void); #endif /* __ARCH_CPU_H__ */ -- cgit v1.2.3