Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\apm_32.c Create Date:2022-07-28 08:22:39
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:apm

Proto:static int apm(void *unused)

Type:int

Parameter:

TypeParameterName
void *unused
1731  set_cpus_allowed_ptr(current process, cpumask_of - the cpumask containing just a given cpu*@cpu: the cpu (<= nr_cpu_ids)(0))
1732  BUG_ON(smp_processor_id() != 0)
1734  If connection_version == 0 Then
1735  connection_version = version
1736  If connection_version > 0x100 Then
1740  If connection_version > 0x0102 Then connection_version = 0x0102
1743  If error != Error codes Then
1751  If debug Then printk(formational "apm: Connection version %d.%d\n", (connection_version >> 8) & 0xff, connection_version & 0xff)
1771  If flags & APM_BIOS_DISENGAGED && connection_version > 0x0100 Then
1773  error = apm_engage_power_management - enable PM on a device*@device: identity of device*@enable: on/off* Activate or deactivate power management on either a specific device* or the entire system (%APM_DEVICE_ALL).
1774  If error Then
1776  Return -1
1780  If debug && ( num_online_cpus() == 1 || smp) Then
1781  error = apm_get_power_status - get current power state*@status: returned status*@bat: battery info*@life: estimated life* Obtain the current power status from the APM BIOS. We return a* status which gives the rough battery status, and current power* source
1782  If error Then printk(formational "apm: power status not available\n")
1784  Else
1786  Case & == 0
1787  power_stat = "off line"
1788  Break
1789  Case & == 1
1790  power_stat = "on line"
1791  Break
1792  Case & == 2
1793  power_stat = "on backup power"
1794  Break
1795  Default
1796  power_stat = "unknown"
1797  Break
1800  Case & == 0
1801  bat_stat = "high"
1802  Break
1803  Case & == 1
1804  bat_stat = "low"
1805  Break
1806  Case & == 2
1807  bat_stat = "critical"
1808  Break
1809  Case & == 3
1810  bat_stat = "charging"
1811  Break
1812  Default
1813  bat_stat = "unknown"
1814  Break
1816  printk(formational "apm: AC %s, battery status %s, battery life ", power_stat, bat_stat)
1819  If (cx & 0xff) == 0xff Then printk("unknown\n")
1821  Else printk("%d%%\n", cx & 0xff)
1823  If connection_version > 0x100 Then
1824  printk(formational "apm: battery flag 0x%02x, battery life ", (cx >> 8) & 0xff)
1827  If dx == 0xffff Then printk("unknown\n")
1829  Else printk("%d %s\n", dx & 0x7fff, (dx & 0x8000) ? "minutes" : "seconds")
1838  If power_off Then pm_power_off = apm_power_off - ask the BIOS to power off* Handle the power off sequence
1841  If num_online_cpus() == 1 || smp Then
1851  Return 0