Contribute
Register

Battery state problem (10.11)

Status
Not open for further replies.
I don't have control over ^^EC0.BAC0 value nor I know where it originated from to see why it takes wrong values. BAC0 exists only once in _BST and once in EC0
That's because I guess everything under EC0 device is just a kind-of pointer to the Embedded Controller.
If you modprobe ec_sys in linux (where they use this quirk btw) you can even access its data directly, no trick, no acpi magic in-between, and it's the same (but inverted of course, with no 0xFFFF - Local4 correction)

I guess like the only proper fix could be:
Code:
            If (Local4 > 0x7FFF)
            {
                Local4 = 0xFFFF - Local4
            }
EDIT2:
I also have a question: both IOREG and System Information should report signed amperage while ACPIBatteryManager debug and raw ACPI data would report unsigned amperage. Is this statement correct?
According to acpi spec, "sign" should just be ultimately derived from the charging/discharging status, so yes.
 
Last edited:
I guess like the only proper fix could be:
Code:
            If (Local4 > 0x7FFF)
            {
                Local4 = 0xFFFF - Local4
            }

If you find your DSDT is reporting signed twos complement (when it shouldn't)...
0xFFFF is twos complement -1, but (as an example) 0xFFFF-0xFFFF is zero...
So, more like:
Code:
            If (Local4 > 0x7FFF)
            {
                Local4 = 0xFFFF - Local4 + 1
            }

Also, you can configure ACPIBatteryManager.kext to correct for this with setting: Correct16bitSignedCurrentRate
Actually, it is default true.
 
If you find your DSDT is reporting signed twos complement (when it shouldn't)...
0xFFFF is twos complement -1, but (as an example) 0xFFFF-0xFFFF is zero...
Seems like I owe you one.
I had totally forgot about values order being inverted.

Also, you can configure ACPIBatteryManager.kext to correct for this with setting: Correct16bitSignedCurrentRate
Actually, it is default true.
Don't worry I wouldn't touch OSX with a pole =)
 
Last edited:
Status
Not open for further replies.
Back
Top