Subject: Re: Powernow support?
To: TAMURA Kent <kent@netbsd.org>
From: Klaus Klein <kleink@reziprozitaet.de>
List: port-amd64
Date: 07/31/2006 11:58:26
On Monday 31 July 2006 10:30, TAMURA Kent wrote:
> > Anyone wants to review the patch or try to fix the code if something is
> > wrong? http://www.xtrarom.org/~juan/powernow_k8.patch
>
> I moved powernow_k8.c into sys/arch/x86/x86, modified some files
> for i386, and tested it. Unfortunately, it didn't work because
> the BIOS of my machine doesn't provide AMDK7PNOW! PSB entry. I
> guess the machine provides such information just via ACPI.
>
> The following patch fixes uninitialized cstate->n_states
> dereference and syctl_createv() failures.
> + freq_names = malloc(freq_names_len, M_SYSCTLDATA, M_WAITOK);
> + if (freq_names == NULL)
> + panic("%s: freq_names alloc not possible", __func__);
While you're at it, M_WAITOK implies that the malloc result can't be
NULL, hence this if-section is pointless (along with a couple of
similar ones in this module).
- Klaus