lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 02 Jul 2013 22:01:27 +0800
From:	Aaron Lu <aaron.lu@...el.com>
To:	Matthew Garrett <matthew.garrett@...ula.com>,
	"Rafael J. Wysocki" <rjw@...k.pl>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
	"seth.forshee@...onical.com" <seth.forshee@...onical.com>,
	"joeyli.kernel@...il.com" <joeyli.kernel@...il.com>,
	"daniel.vetter@...ll.ch" <daniel.vetter@...ll.ch>,
	"lenb@...nel.org" <lenb@...nel.org>,
	Bob Moore <robert.moore@...el.com>
Subject: [PATCH 2/2] ACPI / OSL: add a wrapper function to return OSI version

Drivers may need to make policy decisions based on the OS that the firmware
believes it's interacting with. ACPI firmware will make a series of _OSI
calls, starting from the oldest OS version they support and ending with the
most recent. This patchset adds a function in ACPI OSL layer to return the
last successful call so that drivers know what the firmware's expecting.

Based on a patch by Matthew Garrett <matthew.garrett@...ula.com>, which
is again based on a patch by Seth Forshee <seth.forshee@...onical.com>.

Changelog-by: Matthew Garrett <matthew.garrett@...ula.com>
Signed-off-by: Aaron Lu <aaron.lu@...el.com>
Cc: Matthew Garrett <matthew.garrett@...ula.com>
Cc: Seth Forshee <seth.forshee@...onical.com>
---
 drivers/acpi/osl.c   | 6 ++++++
 include/linux/acpi.h | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 6ab2c35..7ebf07d 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -1799,3 +1799,9 @@ void alloc_acpi_hp_work(acpi_handle handle, u32 type, void *context,
 		kfree(hp_work);
 }
 EXPORT_SYMBOL_GPL(alloc_acpi_hp_work);
+
+u8 acpi_osi_version(void)
+{
+	return acpi_gbl_osi_data;
+}
+EXPORT_SYMBOL_GPL(acpi_osi_version);
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 353ba25..fc3b5c2 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -578,4 +578,10 @@ acpi_handle_printk(const char *level, void *handle, const char *fmt, ...) {}
 })
 #endif
 
+#ifdef CONFIG_ACPI
+u8 acpi_osi_version(void);
+#else
+static inline u8 acpi_osi_version(void) { return 0; }
+#endif
+
 #endif	/*_LINUX_ACPI_H*/
-- 
1.8.3.2.10.g43d11f4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ