aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sfi_acpi.h
diff options
context:
space:
mode:
authorFeng Tang <feng.tang@intel.com>2009-08-14 15:17:53 -0400
committerLen Brown <len.brown@intel.com>2009-08-28 19:57:33 -0400
commit13e82d023c4c3f13ab1e665cbb917a7ebba8935c (patch)
treec0d257873f7487e75b07ed3171e2e7ea29245f9c /include/linux/sfi_acpi.h
parent6ae6996a466e14bcf41618cde641a74ae03dc285 (diff)
SFI: add capability to parse ACPI tables
Extend SFI to access standard ACPI tables. (eg. the PCI MCFG) using sfi_acpi_table_parse(). Note that this is _not_ a hybrid ACPI + SFI mode. The platform boots in either ACPI mode or SFI mode. SFI runs only with acpi_disabled=1, which can be set at build-time via CONFIG_ACPI=n, or at boot time by the failure to find ACPI platform support. So this extension simply allows SFI-platforms to re-use existing standard table formats that happen to be defined to live in ACPI envelopes. Signed-off-by: Feng Tang <feng.tang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/linux/sfi_acpi.h')
-rw-r--r--include/linux/sfi_acpi.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/include/linux/sfi_acpi.h b/include/linux/sfi_acpi.h
new file mode 100644
index 000000000000..c4a5a8cd4469
--- /dev/null
+++ b/include/linux/sfi_acpi.h
@@ -0,0 +1,93 @@
1/* sfi.h Simple Firmware Interface */
2
3/*
4
5 This file is provided under a dual BSD/GPLv2 license. When using or
6 redistributing this file, you may do so under either license.
7
8 GPL LICENSE SUMMARY
9
10 Copyright(c) 2009 Intel Corporation. All rights reserved.
11
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of version 2 of the GNU General Public License as
14 published by the Free Software Foundation.
15
16 This program is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
24 The full GNU General Public License is included in this distribution
25 in the file called LICENSE.GPL.
26
27 BSD LICENSE
28
29 Copyright(c) 2009 Intel Corporation. All rights reserved.
30
31 Redistribution and use in source and binary forms, with or without
32 modification, are permitted provided that the following conditions
33 are met:
34
35 * Redistributions of source code must retain the above copyright
36 notice, this list of conditions and the following disclaimer.
37 * Redistributions in binary form must reproduce the above copyright
38 notice, this list of conditions and the following disclaimer in
39 the documentation and/or other materials provided with the
40 distribution.
41 * Neither the name of Intel Corporation nor the names of its
42 contributors may be used to endorse or promote products derived
43 from this software without specific prior written permission.
44
45 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
46 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
47 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
48 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
49 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
50 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
51 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
52 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
53 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
54 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
55 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56
57*/
58
59#ifndef _LINUX_SFI_ACPI_H
60#define _LINUX_SFI_ACPI_H
61
62#ifdef CONFIG_SFI
63#include <acpi/acpi.h> /* struct acpi_table_header */
64
65extern int sfi_acpi_table_parse(char *signature, char *oem_id,
66 char *oem_table_id,
67 int (*handler)(struct acpi_table_header *));
68
69static inline int acpi_sfi_table_parse(char *signature,
70 int (*handler)(struct acpi_table_header *))
71{
72 if (!acpi_table_parse(signature, handler))
73 return 0;
74
75 return sfi_acpi_table_parse(signature, NULL, NULL, handler);
76}
77#else /* !CONFIG_SFI */
78
79static inline int sfi_acpi_table_parse(char *signature, char *oem_id,
80 char *oem_table_id,
81 int (*handler)(struct acpi_table_header *))
82{
83 return -1;
84}
85
86static inline int acpi_sfi_table_parse(char *signature,
87 int (*handler)(struct acpi_table_header *))
88{
89 return acpi_table_parse(signature, handler);
90}
91#endif /* !CONFIG_SFI */
92
93#endif /*_LINUX_SFI_ACPI_H*/