ACPIParser.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #include <Kernel/ACPI/ACPIParser.h>
  2. static ACPIParser* s_acpi_parser;
  3. ACPIParser& ACPIParser::the()
  4. {
  5. ASSERT(s_acpi_parser != nullptr);
  6. return *s_acpi_parser;
  7. }
  8. void ACPIParser::initialize_limited()
  9. {
  10. if (!ACPIParser::is_initialized()) {
  11. s_acpi_parser = new ACPIParser(false);
  12. }
  13. }
  14. bool ACPIParser::is_initialized()
  15. {
  16. return (s_acpi_parser != nullptr);
  17. }
  18. ACPIParser::ACPIParser(bool usable)
  19. {
  20. if (usable) {
  21. kprintf("ACPI: Setting up a functional parser\n");
  22. } else {
  23. kprintf("ACPI: Limited Initialization. Vital functions are disabled by a request\n");
  24. }
  25. s_acpi_parser = this;
  26. }
  27. ACPI_RAW::SDTHeader* ACPIParser::find_table(const char*)
  28. {
  29. kprintf("ACPI: Requested to search for a table, Abort!\n");
  30. return nullptr;
  31. }
  32. void ACPIParser::mmap(VirtualAddress, PhysicalAddress, u32)
  33. {
  34. ASSERT_NOT_REACHED();
  35. }
  36. void ACPIParser::mmap_region(Region&, PhysicalAddress)
  37. {
  38. ASSERT_NOT_REACHED();
  39. }
  40. void ACPIParser::do_acpi_reboot()
  41. {
  42. kprintf("ACPI: Cannot invoke reboot!\n");
  43. ASSERT_NOT_REACHED();
  44. }
  45. void ACPIParser::do_acpi_shutdown()
  46. {
  47. kprintf("ACPI: Cannot invoke shutdown!\n");
  48. ASSERT_NOT_REACHED();
  49. }
  50. void ACPIParser::enable_aml_interpretation()
  51. {
  52. kprintf("ACPI: No AML Interpretation Allowed\n");
  53. ASSERT_NOT_REACHED();
  54. }
  55. void ACPIParser::enable_aml_interpretation(File&)
  56. {
  57. kprintf("ACPI: No AML Interpretation Allowed\n");
  58. ASSERT_NOT_REACHED();
  59. }
  60. void ACPIParser::enable_aml_interpretation(u8*, u32)
  61. {
  62. kprintf("ACPI: No AML Interpretation Allowed\n");
  63. ASSERT_NOT_REACHED();
  64. }
  65. void ACPIParser::disable_aml_interpretation()
  66. {
  67. kprintf("ACPI Limited: No AML Interpretation Allowed\n");
  68. ASSERT_NOT_REACHED();
  69. }
  70. bool ACPIParser::is_operable()
  71. {
  72. return false;
  73. }