Bill Holler wrote:
> Dana H. Myers wrote:
>> Bill Holler wrote:
>>> Hi,
>>>
>>> I would like to try to get a fix for this into the next OpenSolaris
>>> release. Time is running out if it has not already.
>>>
>>> Are we happy with using AcpiEvaluateObjectTyped(), or do
>>> we need to do more work in the ACPICA?
>>>
>>> This change works on tecra M9 and M10. AcpiEvaluateObjectTyped()
>>> returns 9 on both of these systems which indicates an error.
>>>
>>>
>>> diff -r 11c1672e6d5b -r 90c9f0b548f7
>>> usr/src/uts/i86pc/os/cpupm/cpu_acpi.c
>>> --- a/usr/src/uts/i86pc/os/cpupm/cpu_acpi.c Tue Mar 17 19:00:36
>>> 2009 -0400
>>> +++ b/usr/src/uts/i86pc/os/cpupm/cpu_acpi.c Wed Mar 18 17:42:48
>>> 2009 -0700
>>> @@ -695,11 +695,15 @@
>>> abuf.Length = ACPI_ALLOCATE_BUFFER;
>>> abuf.Pointer = NULL;
>>>
>>> - if (ACPI_FAILURE(AcpiEvaluateObject(handle->cs_handle, "_CST",
>>> - NULL, &abuf))) {
>>> + if (ACPI_FAILURE(AcpiEvaluateObjectTyped(handle->cs_handle,
>>> "_CST",
>>> + NULL, &abuf, ACPI_TYPE_PACKAGE))) {
>>> cmn_err(CE_NOTE, "!cpu_acpi: _CST evaluate failure");
>>> return (-1);
>>> }
>> I really don't believe this length check is required once we're using
>> AcpiEvaluateObjectTyped():
>>> + if (abuf.Length < sizeof (ACPI_OBJECT)) {
>>> + cmn_err(CE_NOTE, "!cpu_acpi: _CST evaluate length
>>> failure");
>>> + return (-1);
>>> + }
>
> I would like to keep the abuf.Length check. The extra level of
> checking should not hurt. Should this Length check stay or go?
It doesn't hurt, but it's totally unnecessary once you're using
AcpiEvaluateObjectTyped(). It's only guarding against a
horrific error in ACPI CA; at most, I'd use an assert here.
I mean, AcpiEvaluateObjectTyped() has returned success,
it thinks it has copied an ACPI_OBJECT to the buffer.
Suit yourself, but I think it's needless code to maintain :-)
Now we need to figure out why _CST fails to return a value
on Toshiba. I'm somewhat suspicious of the way the BIOS
Load()s the table, that ACPI CA might be missing something.
Dana
>
> Bill
>
>>> obj = (ACPI_OBJECT *)abuf.Pointer;
>>> if (obj->Package.Count < 2) {
>>> cmn_err(CE_NOTE, "!cpu_acpi: _CST package bad count
>>> %d.",
>>>
>>>
>>> Is ACPI_STATUS "9" defined?
>>>
>>> Regards,
>>> Bill
>>
>