On Wed, 3 May 2023 at 08:19, Richard Henderson <richard.hender...@linaro.org> wrote: > > These features are present for Apple M1. > > Tested-by: Philippe Mathieu-Daudé <phi...@linaro.org> > Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org> > Signed-off-by: Richard Henderson <richard.hender...@linaro.org> > +#ifdef CONFIG_DARWIN > +static bool sysctl_for_bool(const char *name) > +{ > + int val = 0; > + size_t len = sizeof(val); > + > + if (sysctlbyname(name, &val, &len, NULL, 0) == 0) { > + return val != 0; > + } > + > + /* > + * We might in ask for properties not present in older kernels,
"might in ask" is a typo for something, but I'm not sure what. > + * but we're only asking about static properties, all of which > + * should be 'int'. So we shouln't see ENOMEM (val too small), > + * or any of the other more exotic errors. > + */ > + assert(errno == ENOENT); > + return false; > +} > +#endif Otherwise Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> thanks -- PMM