GithubHelp home page GithubHelp logo

Comments (2)

dreamwhite avatar dreamwhite commented on August 25, 2024

Hi,
at the moment the only SSDTs that have _OSI("Darwin") implemented are:

  • SSDT-EC
  • SSDT-AWAC
  • SSDT-PMC
  • SSDT-USB_Reset

In fact, saying

If (_OSI ("Darwin"))
{
    Return (Zero)
}
Else
{
    Return (0x0F)
}

inside a _STA method can be translated into if in macOS add the following code, else don't.

If you look at ACPICA specification, page 470 you can have a more clear view of how _STA method works.

I don't have any idea if wrapping Only-macOS SSDTs into a big If (_OSI ("Darwin")) is a smart idea, as the only SSDT which may cause problems is SSDT-PLUG :/

CC @1alessandro1

from ssdttime.

startergo avatar startergo commented on August 25, 2024

Hi, at the moment the only SSDTs that have _OSI("Darwin") implemented are:

  • SSDT-EC
  • SSDT-AWAC
  • SSDT-PMC
  • SSDT-USB_Reset

In fact, saying

If (_OSI ("Darwin"))
{
    Return (Zero)
}
Else
{
    Return (0x0F)
}

inside a _STA method can be translated into if in macOS add the following code, else don't.

If you look at ACPICA specification, page 470 you can have a more clear view of how _STA method works.

I don't have any idea if wrapping Only-macOS SSDTs into a big If (_OSI ("Darwin")) is a smart idea, as the only SSDT which may cause problems is SSDT-PLUG :/

CC @1alessandro1

_6.3.7 _STA (Status)
This object returns the current status of a device, which can be one of the following: enabled, disabled, or removed.
OSPM evaluates the _STA object before it evaluates a device _INI method. The return values of the Present and Functioning bits determines whether _INI should be evaluated and whether children of the device should be enumerated and initialized. See Section 6.5.1, “_INI (Init)”.
If a device object describes a device that is not on an enumerable bus and the device object does not have an _STA object, then OSPM assumes that the device is present, enabled, shown in the UI, and functioning.
This method must not reference any operation regions that have not been declared available by a REG method.
Arguments:
None
Return Value:
An Integer containing a device status bitmap:
Bit [0] – Set if the device is present.
Bit [1] – Set if the device is enabled and decoding its resources.
Bit [2] – Set if the device should be shown in the UI.
Bit [3] – Set if the device is functioning properly (cleared if device failed its diagnostics).
Bit [4] – Set if the battery is present.
Bits [31:5] – Reserved (must be cleared).
Return Value Information
If bit [0] is cleared, then bit 1 must also be cleared (in other words, a device that is not present cannot be enabled).
A device can only decode its hardware resources if both bits 0 and 1 are set. If the device is not present (bit [0] cleared) or not enabled (bit [1] cleared), then the device must not decode its resources.

Which means if it returns 0x0F bits 0,1,2 and 3 are set to 1
If It returns Zero bits 0 and 1 are cleared, which means the device (or function) is not present and not enabled.

In this respect:

If (_OSI ("Darwin"))
{
    Return (Zero)
}
Else
{
    Return (0x0F)
}

Means if this is Darwin disable the device (Or function), if it is not enable it. And this code:

If (_OSI ("Darwin"))
{
    Return (0x0F)
}
Else
{
    Return (Zero)
}

Means: If it is Darwin enable the device (or function), otherwise disable it.

from ssdttime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.