ofw_cpu_early_foreach: Change callback to return bool instead of boolean_t.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D39926
This commit is contained in:
John Baldwin 2023-05-04 12:33:39 -07:00
parent 2fd903276d
commit afdb42987c
9 changed files with 23 additions and 23 deletions

View File

@ -80,9 +80,9 @@ extern void mpentry(void);
static int platform_mp_get_core_cnt(void); static int platform_mp_get_core_cnt(void);
static int alpine_get_cpu_resume_base(u_long *pbase, u_long *psize); static int alpine_get_cpu_resume_base(u_long *pbase, u_long *psize);
static int alpine_get_nb_base(u_long *pbase, u_long *psize); static int alpine_get_nb_base(u_long *pbase, u_long *psize);
static boolean_t alpine_validate_cpu(u_int, phandle_t, u_int, pcell_t *); static bool alpine_validate_cpu(u_int, phandle_t, u_int, pcell_t *);
static boolean_t static bool
alpine_validate_cpu(u_int id, phandle_t child, u_int addr_cell, pcell_t *reg) alpine_validate_cpu(u_int id, phandle_t child, u_int addr_cell, pcell_t *reg)
{ {
return ofw_bus_node_is_compatible(child, "arm,cortex-a15"); return ofw_bus_node_is_compatible(child, "arm,cortex-a15");

View File

@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$");
static int running_cpus; static int running_cpus;
static boolean_t static bool
virt_start_ap(u_int id, phandle_t node, u_int addr_cells, pcell_t *reg) virt_start_ap(u_int id, phandle_t node, u_int addr_cells, pcell_t *reg)
{ {
int err; int err;

View File

@ -75,7 +75,7 @@ ipq4018_mp_setmaxid(platform_t plat)
printf("SMP: ncpu=%d\n", ncpu); printf("SMP: ncpu=%d\n", ncpu);
} }
static boolean_t static bool
ipq4018_start_ap(u_int id, phandle_t node, u_int addr_cells, pcell_t *arg) ipq4018_start_ap(u_int id, phandle_t node, u_int addr_cells, pcell_t *arg)
{ {

View File

@ -30,6 +30,6 @@
#ifndef __QCOM_CPU_KPSSV2_H__ #ifndef __QCOM_CPU_KPSSV2_H__
#define __QCOM_CPU_KPSSV2_H__ #define __QCOM_CPU_KPSSV2_H__
extern boolean_t qcom_cpu_kpssv2_regulator_start(u_int id, phandle_t node); extern bool qcom_cpu_kpssv2_regulator_start(u_int id, phandle_t node);
#endif /* __QCOM_CPU_KPSSV2_H__ */ #endif /* __QCOM_CPU_KPSSV2_H__ */

View File

@ -119,7 +119,7 @@ rk32xx_mp_start_pmu(uint32_t mask)
bus_space_unmap(fdtbus_bs_tag, pmu, PMU_SIZE); bus_space_unmap(fdtbus_bs_tag, pmu, PMU_SIZE);
} }
static boolean_t static bool
rk32xx_start_ap(u_int id, phandle_t node, u_int addr_cells, pcell_t *reg) rk32xx_start_ap(u_int id, phandle_t node, u_int addr_cells, pcell_t *reg)
{ {
int rv; int rv;

View File

@ -687,7 +687,7 @@ populate_release_addr(phandle_t node, vm_paddr_t *release_addr)
*release_addr = (((uintptr_t)buf[0] << 32) | buf[1]); *release_addr = (((uintptr_t)buf[0] << 32) | buf[1]);
} }
static boolean_t static bool
start_cpu_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg) start_cpu_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
{ {
uint64_t target_cpu; uint64_t target_cpu;
@ -716,11 +716,11 @@ start_cpu_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
if (!psci_present && cpuid != 0) { if (!psci_present && cpuid != 0) {
if (OF_getprop_alloc(node, "enable-method", if (OF_getprop_alloc(node, "enable-method",
(void **)&enable_method) <= 0) (void **)&enable_method) <= 0)
return (FALSE); return (false);
if (strcmp(enable_method, "spin-table") != 0) { if (strcmp(enable_method, "spin-table") != 0) {
OF_prop_free(enable_method); OF_prop_free(enable_method);
return (FALSE); return (false);
} }
OF_prop_free(enable_method); OF_prop_free(enable_method);
@ -728,12 +728,12 @@ start_cpu_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
if (release_addr == 0) { if (release_addr == 0) {
printf("Failed to fetch release address for CPU %u", printf("Failed to fetch release address for CPU %u",
cpuid); cpuid);
return (FALSE); return (false);
} }
} }
if (!start_cpu(cpuid, target_cpu, 0, release_addr)) if (!start_cpu(cpuid, target_cpu, 0, release_addr))
return (FALSE); return (false);
/* /*
* Don't increment for the boot CPU, its CPU ID is reserved. * Don't increment for the boot CPU, its CPU ID is reserved.
@ -748,7 +748,7 @@ start_cpu_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
cpuid_to_pcpu[cpuid]->pc_domain = domain; cpuid_to_pcpu[cpuid]->pc_domain = domain;
if (domain < MAXMEMDOM) if (domain < MAXMEMDOM)
CPU_SET(cpuid, &cpuset_domain[domain]); CPU_SET(cpuid, &cpuset_domain[domain]);
return (TRUE); return (true);
} }
static void static void
cpu_init_fdt(void) cpu_init_fdt(void)

View File

@ -73,7 +73,7 @@ fdt_platform_probe(platform_t plat)
} }
#if defined(SMP) #if defined(SMP)
static boolean_t static bool
fdt_platform_maxid(u_int id, phandle_t node, u_int addr_cells, pcell_t *reg) fdt_platform_maxid(u_int id, phandle_t node, u_int addr_cells, pcell_t *reg)
{ {

View File

@ -31,7 +31,7 @@
#ifndef _DEV_OFW_OFW_CPU_H_ #ifndef _DEV_OFW_OFW_CPU_H_
#define _DEV_OFW_OFW_CPU_H_ #define _DEV_OFW_OFW_CPU_H_
typedef boolean_t (*ofw_cpu_foreach_cb)(u_int, phandle_t, u_int, pcell_t *); typedef bool (*ofw_cpu_foreach_cb)(u_int, phandle_t, u_int, pcell_t *);
int ofw_cpu_early_foreach(ofw_cpu_foreach_cb, boolean_t); int ofw_cpu_early_foreach(ofw_cpu_foreach_cb, boolean_t);
#endif /* _DEV_OFW_OFW_CPU_H_ */ #endif /* _DEV_OFW_OFW_CPU_H_ */

View File

@ -403,7 +403,7 @@ cpu_mp_probe(void)
} }
#ifdef FDT #ifdef FDT
static boolean_t static bool
cpu_check_mmu(u_int id __unused, phandle_t node, u_int addr_size __unused, cpu_check_mmu(u_int id __unused, phandle_t node, u_int addr_size __unused,
pcell_t *reg __unused) pcell_t *reg __unused)
{ {
@ -412,12 +412,12 @@ cpu_check_mmu(u_int id __unused, phandle_t node, u_int addr_size __unused,
/* Check if this hart supports MMU. */ /* Check if this hart supports MMU. */
if (OF_getprop(node, "mmu-type", (void *)type, sizeof(type)) == -1 || if (OF_getprop(node, "mmu-type", (void *)type, sizeof(type)) == -1 ||
strncmp(type, "riscv,none", 10) == 0) strncmp(type, "riscv,none", 10) == 0)
return (0); return (false);
return (1); return (true);
} }
static boolean_t static bool
cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg) cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
{ {
struct pcpu *pcpup; struct pcpu *pcpup;
@ -428,7 +428,7 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
int error; int error;
if (!cpu_check_mmu(id, node, addr_size, reg)) if (!cpu_check_mmu(id, node, addr_size, reg))
return (0); return (false);
KASSERT(id < MAXCPU, ("Too many CPUs")); KASSERT(id < MAXCPU, ("Too many CPUs"));
@ -449,7 +449,7 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
/* We are already running on this cpu */ /* We are already running on this cpu */
if (hart == boot_hart) if (hart == boot_hart)
return (1); return (true);
/* /*
* Rotate the CPU IDs to put the boot CPU as CPU 0. * Rotate the CPU IDs to put the boot CPU as CPU 0.
@ -462,7 +462,7 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
/* Check if we are able to start this cpu */ /* Check if we are able to start this cpu */
if (cpuid > mp_maxid) if (cpuid > mp_maxid)
return (0); return (false);
/* /*
* Depending on the SBI implementation, APs are waiting either in * Depending on the SBI implementation, APs are waiting either in
@ -477,7 +477,7 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
/* Send a warning to the user and continue. */ /* Send a warning to the user and continue. */
printf("AP %u (hart %lu) failed to start, error %d\n", printf("AP %u (hart %lu) failed to start, error %d\n",
cpuid, hart, error); cpuid, hart, error);
return (0); return (false);
} }
} }
@ -503,7 +503,7 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
CPU_SET(cpuid, &all_cpus); CPU_SET(cpuid, &all_cpus);
CPU_SET(hart, &all_harts); CPU_SET(hart, &all_harts);
return (1); return (true);
} }
#endif #endif