actables.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /******************************************************************************
  2. *
  3. * Name: actables.h - ACPI table management
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2006, R. Byron Moore
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #ifndef __ACTABLES_H__
  43. #define __ACTABLES_H__
  44. /* Used in acpi_tb_map_acpi_table for size parameter if table header is to be used */
  45. #define SIZE_IN_HEADER 0
  46. /*
  47. * tbconvrt - Table conversion routines
  48. */
  49. acpi_status acpi_tb_convert_to_xsdt(struct acpi_table_desc *table_info);
  50. acpi_status acpi_tb_convert_table_fadt(void);
  51. acpi_status acpi_tb_build_common_facs(struct acpi_table_desc *table_info);
  52. u32
  53. acpi_tb_get_table_count(struct rsdp_descriptor *RSDP,
  54. struct acpi_table_header *RSDT);
  55. /*
  56. * tbget - Table "get" routines
  57. */
  58. acpi_status
  59. acpi_tb_get_table(struct acpi_pointer *address,
  60. struct acpi_table_desc *table_info);
  61. acpi_status
  62. acpi_tb_get_table_header(struct acpi_pointer *address,
  63. struct acpi_table_header *return_header);
  64. acpi_status
  65. acpi_tb_get_table_body(struct acpi_pointer *address,
  66. struct acpi_table_header *header,
  67. struct acpi_table_desc *table_info);
  68. acpi_status
  69. acpi_tb_get_table_ptr(acpi_table_type table_type,
  70. u32 instance, struct acpi_table_header **table_ptr_loc);
  71. acpi_status acpi_tb_verify_rsdp(struct acpi_pointer *address);
  72. void acpi_tb_get_rsdt_address(struct acpi_pointer *out_address);
  73. acpi_status acpi_tb_validate_rsdt(struct acpi_table_header *table_ptr);
  74. /*
  75. * tbgetall - get multiple required tables
  76. */
  77. acpi_status acpi_tb_get_required_tables(void);
  78. /*
  79. * tbinstall - Table installation
  80. */
  81. acpi_status acpi_tb_install_table(struct acpi_table_desc *table_info);
  82. acpi_status
  83. acpi_tb_recognize_table(struct acpi_table_desc *table_info, u8 search_type);
  84. acpi_status
  85. acpi_tb_init_table_descriptor(acpi_table_type table_type,
  86. struct acpi_table_desc *table_info);
  87. /*
  88. * tbremove - Table removal and deletion
  89. */
  90. void acpi_tb_delete_all_tables(void);
  91. void acpi_tb_delete_tables_by_type(acpi_table_type type);
  92. void acpi_tb_delete_single_table(struct acpi_table_desc *table_desc);
  93. struct acpi_table_desc *acpi_tb_uninstall_table(struct acpi_table_desc
  94. *table_desc);
  95. /*
  96. * tbxfroot - RSDP, RSDT utilities
  97. */
  98. acpi_status
  99. acpi_tb_find_table(char *signature,
  100. char *oem_id,
  101. char *oem_table_id, struct acpi_table_header **table_ptr);
  102. acpi_status acpi_tb_get_table_rsdt(void);
  103. acpi_status acpi_tb_validate_rsdp(struct rsdp_descriptor *rsdp);
  104. /*
  105. * tbutils - common table utilities
  106. */
  107. acpi_status acpi_tb_is_table_installed(struct acpi_table_desc *new_table_desc);
  108. acpi_status
  109. acpi_tb_verify_table_checksum(struct acpi_table_header *table_header);
  110. u8 acpi_tb_generate_checksum(void *buffer, u32 length);
  111. acpi_status
  112. acpi_tb_validate_table_header(struct acpi_table_header *table_header);
  113. #endif /* __ACTABLES_H__ */