git: 722b40377198 - main - riscv: Remove the unused riscv64_cpu driver
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 30 Jan 2024 20:33:50 UTC
The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=722b40377198e384a808f9561ae7262767068ab2 commit 722b40377198e384a808f9561ae7262767068ab2 Author: Jessica Clarke <jrtc27@FreeBSD.org> AuthorDate: 2024-01-30 20:33:30 +0000 Commit: Jessica Clarke <jrtc27@FreeBSD.org> CommitDate: 2024-01-30 20:33:30 +0000 riscv: Remove the unused riscv64_cpu driver This is a repeat of 63bf2d735ca3 ("Remove the unused arm64_cpu driver.") for RISC-V, which copied the defunct code from arm64 with no changes beyond substituting riscv64 for arm64, and made no use of it elsewhere. It has thus always been entirely superfluous. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43672 --- sys/riscv/riscv/mp_machdep.c | 76 -------------------------------------------- 1 file changed, 76 deletions(-) diff --git a/sys/riscv/riscv/mp_machdep.c b/sys/riscv/riscv/mp_machdep.c index be5c50485bf4..0e4d18ce47fb 100644 --- a/sys/riscv/riscv/mp_machdep.c +++ b/sys/riscv/riscv/mp_machdep.c @@ -79,10 +79,6 @@ static enum { #endif } cpu_enum_method; -static device_identify_t riscv64_cpu_identify; -static device_probe_t riscv64_cpu_probe; -static device_attach_t riscv64_cpu_attach; - static void ipi_ast(void *); static void ipi_hardclock(void *); static void ipi_preempt(void *); @@ -95,7 +91,6 @@ extern cpuset_t all_harts; #ifdef INVARIANTS static uint32_t cpu_reg[MAXCPU][2]; #endif -static device_t cpu_list[MAXCPU]; void mpentry(u_long hartid); void init_secondary(uint64_t); @@ -115,77 +110,6 @@ static volatile int aps_ready; /* Temporary variables for init_secondary() */ void *dpcpu[MAXCPU - 1]; -static device_method_t riscv64_cpu_methods[] = { - /* Device interface */ - DEVMETHOD(device_identify, riscv64_cpu_identify), - DEVMETHOD(device_probe, riscv64_cpu_probe), - DEVMETHOD(device_attach, riscv64_cpu_attach), - - DEVMETHOD_END -}; - -static driver_t riscv64_cpu_driver = { - "riscv64_cpu", - riscv64_cpu_methods, - 0 -}; - -DRIVER_MODULE(riscv64_cpu, cpu, riscv64_cpu_driver, 0, 0); - -static void -riscv64_cpu_identify(driver_t *driver, device_t parent) -{ - - if (device_find_child(parent, "riscv64_cpu", -1) != NULL) - return; - if (BUS_ADD_CHILD(parent, 0, "riscv64_cpu", -1) == NULL) - device_printf(parent, "add child failed\n"); -} - -static int -riscv64_cpu_probe(device_t dev) -{ - u_int cpuid; - - cpuid = device_get_unit(dev); - if (cpuid >= MAXCPU || cpuid > mp_maxid) - return (EINVAL); - - device_quiet(dev); - return (0); -} - -static int -riscv64_cpu_attach(device_t dev) -{ - const uint32_t *reg; - size_t reg_size; - u_int cpuid; - int i; - - cpuid = device_get_unit(dev); - - if (cpuid >= MAXCPU || cpuid > mp_maxid) - return (EINVAL); - KASSERT(cpu_list[cpuid] == NULL, ("Already have cpu %u", cpuid)); - - reg = cpu_get_cpuid(dev, ®_size); - if (reg == NULL) - return (EINVAL); - - if (bootverbose) { - device_printf(dev, "register <"); - for (i = 0; i < reg_size; i++) - printf("%s%x", (i == 0) ? "" : " ", reg[i]); - printf(">\n"); - } - - /* Set the device to start it later */ - cpu_list[cpuid] = dev; - - return (0); -} - static void release_aps(void *dummy __unused) {