sfi_acpi.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /* sfi.h Simple Firmware Interface */
  2. /*
  3. This file is provided under a dual BSD/GPLv2 license. When using or
  4. redistributing this file, you may do so under either license.
  5. GPL LICENSE SUMMARY
  6. Copyright(c) 2009 Intel Corporation. All rights reserved.
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of version 2 of the GNU General Public License as
  9. published by the Free Software Foundation.
  10. This program is distributed in the hope that it will be useful, but
  11. WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  17. The full GNU General Public License is included in this distribution
  18. in the file called LICENSE.GPL.
  19. BSD LICENSE
  20. Copyright(c) 2009 Intel Corporation. All rights reserved.
  21. Redistribution and use in source and binary forms, with or without
  22. modification, are permitted provided that the following conditions
  23. are met:
  24. * Redistributions of source code must retain the above copyright
  25. notice, this list of conditions and the following disclaimer.
  26. * Redistributions in binary form must reproduce the above copyright
  27. notice, this list of conditions and the following disclaimer in
  28. the documentation and/or other materials provided with the
  29. distribution.
  30. * Neither the name of Intel Corporation nor the names of its
  31. contributors may be used to endorse or promote products derived
  32. from this software without specific prior written permission.
  33. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  34. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  35. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  36. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  37. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  38. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  39. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  40. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  41. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  42. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  43. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  44. */
  45. #ifndef _LINUX_SFI_ACPI_H
  46. #define _LINUX_SFI_ACPI_H
  47. #include <linux/acpi.h>
  48. #include <linux/sfi.h>
  49. #ifdef CONFIG_SFI
  50. extern int sfi_acpi_table_parse(char *signature, char *oem_id,
  51. char *oem_table_id,
  52. int (*handler)(struct acpi_table_header *));
  53. static inline int __init acpi_sfi_table_parse(char *signature,
  54. int (*handler)(struct acpi_table_header *))
  55. {
  56. if (!acpi_table_parse(signature, handler))
  57. return 0;
  58. return sfi_acpi_table_parse(signature, NULL, NULL, handler);
  59. }
  60. #else /* !CONFIG_SFI */
  61. static inline int sfi_acpi_table_parse(char *signature, char *oem_id,
  62. char *oem_table_id,
  63. int (*handler)(struct acpi_table_header *))
  64. {
  65. return -1;
  66. }
  67. static inline int __init acpi_sfi_table_parse(char *signature,
  68. int (*handler)(struct acpi_table_header *))
  69. {
  70. return acpi_table_parse(signature, handler);
  71. }
  72. #endif /* !CONFIG_SFI */
  73. #endif /*_LINUX_SFI_ACPI_H*/