qemu-riscv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 18/57] tcg/aarch64: Detect have_lse, have_lse2 for darwin


From: Peter Maydell
Subject: Re: [PATCH v4 18/57] tcg/aarch64: Detect have_lse, have_lse2 for darwin
Date: Fri, 5 May 2023 11:43:19 +0100

On Wed, 3 May 2023 at 08:19, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> These features are present for Apple M1.
>
> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Signed-off-by: Richard Henderson <richard.henderson@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.maydell@linaro.org>

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]