What you're referring to is AML, which is part of ACPI. It defines a bytecode for short programs that are provided to the operating system in the ACPI tables for performing certain operations on devices. The operating system can then 'call' these functions by executing the bytecode.
This way different devices can use different procedures to, for example, put the device into sleep mode.
https://wiki.osdev.org/AML