ACPIStaticParser.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright notice, this
  9. * list of conditions and the following disclaimer.
  10. *
  11. * 2. Redistributions in binary form must reproduce the above copyright notice,
  12. * this list of conditions and the following disclaimer in the documentation
  13. * and/or other materials provided with the distribution.
  14. *
  15. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  16. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  17. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  18. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  19. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  20. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  21. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  22. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  23. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  24. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. */
  26. #include <Kernel/ACPI/ACPIStaticParser.h>
  27. #include <Kernel/IO.h>
  28. #include <Kernel/StdLib.h>
  29. #include <Kernel/VM/MemoryManager.h>
  30. //#define ACPI_DEBUG
  31. void ACPIStaticParser::initialize(ACPI_RAW::RSDPDescriptor20& rsdp)
  32. {
  33. if (!ACPIParser::is_initialized()) {
  34. new ACPIStaticParser(rsdp);
  35. }
  36. }
  37. void ACPIStaticParser::initialize_without_rsdp()
  38. {
  39. if (!ACPIParser::is_initialized()) {
  40. new ACPIStaticParser();
  41. }
  42. }
  43. bool ACPIStaticParser::is_initialized()
  44. {
  45. return ACPIParser::is_initialized();
  46. }
  47. void ACPIStaticParser::locate_static_data()
  48. {
  49. locate_main_system_description_table();
  50. initialize_main_system_description_table();
  51. init_fadt();
  52. locate_all_aml_tables();
  53. }
  54. ACPI_RAW::SDTHeader* ACPIStaticParser::find_table(const char* sig)
  55. {
  56. #ifdef ACPI_DEBUG
  57. dbgprintf("ACPI: Calling Find Table method!\n");
  58. #endif
  59. for (auto* physical_sdt_ptr : m_main_sdt->get_sdt_pointers()) {
  60. auto region = MM.allocate_kernel_region(PhysicalAddress(page_base_of(physical_sdt_ptr)), (PAGE_SIZE * 2), "ACPI Static Parser Tables Finding", Region::Access::Read);
  61. auto* sdt = (const ACPI_RAW::SDTHeader*)region->vaddr().offset(offset_in_page(physical_sdt_ptr)).as_ptr();
  62. #ifdef ACPI_DEBUG
  63. dbgprintf("ACPI: Examining Table @ P 0x%x\n", physical_sdt_ptr);
  64. #endif
  65. if (!strncmp(sdt->sig, sig, 4)) {
  66. #ifdef ACPI_DEBUG
  67. dbgprintf("ACPI: Found Table @ P 0x%x\n", physical_sdt_ptr);
  68. #endif
  69. return physical_sdt_ptr;
  70. }
  71. }
  72. return nullptr;
  73. }
  74. void ACPIStaticParser::init_fadt()
  75. {
  76. kprintf("ACPI: Initializing Fixed ACPI data\n");
  77. kprintf("ACPI: Searching for the Fixed ACPI Data Table\n");
  78. ASSERT(find_table("FACP") != nullptr);
  79. auto* fadt_ptr = find_table("FACP");
  80. auto checkup_region = MM.allocate_kernel_region(PhysicalAddress(page_base_of((fadt_ptr))), (PAGE_SIZE * 2), "ACPI Static Parser", Region::Access::Read);
  81. #ifdef ACPI_DEBUG
  82. dbgprintf("ACPI: Checking FADT Length to choose the correct mapping size\n");
  83. #endif
  84. auto* sdt = (const ACPI_RAW::SDTHeader*)checkup_region->vaddr().offset(offset_in_page((fadt_ptr))).as_ptr();
  85. #ifdef ACPI_DEBUG
  86. dbgprintf("ACPI: FADT @ V 0x%x, P 0x%x\n", sdt, fadt_ptr);
  87. #endif
  88. u32 length = sdt->length;
  89. kprintf("ACPI: Fixed ACPI data, Revision %u\n", sdt->revision);
  90. auto fadt_region = MM.allocate_kernel_region(PhysicalAddress(page_base_of((fadt_ptr))), PAGE_ROUND_UP(length) + PAGE_SIZE, "ACPI Static Parser", Region::Access::Read);
  91. m_fadt = make<ACPI::FixedACPIData>(*(ACPI_RAW::FADT*)fadt_region->vaddr().offset(offset_in_page((fadt_ptr))).as_ptr());
  92. #ifdef ACPI_DEBUG
  93. dbgprintf("ACPI: Finished to initialize Fixed ACPI data\n");
  94. #endif
  95. }
  96. void ACPIStaticParser::do_acpi_reboot()
  97. {
  98. // FIXME: Determine if we need to do MMIO/PCI/IO access to reboot, according to ACPI spec 6.2, Section 4.8.3.6
  99. #ifdef ACPI_DEBUG
  100. dbgprintf("ACPI: Rebooting, Probing FADT (P @ 0x%x)\n", m_fadt.ptr());
  101. #endif
  102. if (m_fadt->m_revision >= 2) {
  103. kprintf("ACPI: Reboot, Sending value 0%x to Port 0x%x\n", m_fadt->m_reset_value, m_fadt->m_reset_reg.address);
  104. IO::out8(m_fadt->m_reset_reg.address, m_fadt->m_reset_value);
  105. } else {
  106. kprintf("ACPI: Reboot, Not supported!\n");
  107. }
  108. ASSERT_NOT_REACHED(); /// If rebooting didn't work, halt.
  109. }
  110. void ACPIStaticParser::do_acpi_shutdown()
  111. {
  112. kprintf("ACPI: Shutdown is not supported with the current configuration, Abort!\n");
  113. ASSERT_NOT_REACHED();
  114. }
  115. inline bool validate_acpi_table(ACPI_RAW::SDTHeader& v_header, size_t length)
  116. {
  117. u8 checksum = 0;
  118. auto* sdt = (u8*)&v_header;
  119. for (size_t i = 0; i < length; i++)
  120. checksum += sdt[i];
  121. if (checksum == 0)
  122. return true;
  123. return false;
  124. }
  125. size_t ACPIStaticParser::get_table_size(ACPI_RAW::SDTHeader& p_header)
  126. {
  127. InterruptDisabler disabler;
  128. #ifdef ACPI_DEBUG
  129. dbgprintf("ACPI: Checking SDT Length\n");
  130. #endif
  131. auto region = MM.allocate_kernel_region(PhysicalAddress((uintptr_t)&p_header).page_base(), (PAGE_SIZE * 2), "ACPI get_table_size()", Region::Access::Read);
  132. auto* sdt = (volatile ACPI_RAW::SDTHeader*)region->vaddr().offset(offset_in_page(&p_header)).as_ptr();
  133. return sdt->length;
  134. }
  135. u8 ACPIStaticParser::get_table_revision(ACPI_RAW::SDTHeader& p_header)
  136. {
  137. InterruptDisabler disabler;
  138. #ifdef ACPI_DEBUG
  139. dbgprintf("ACPI: Checking SDT Revision\n");
  140. #endif
  141. auto region = MM.allocate_kernel_region(PhysicalAddress((uintptr_t)&p_header).page_base(), (PAGE_SIZE * 2), "ACPI get_table_revision()", Region::Access::Read);
  142. auto* sdt = (volatile ACPI_RAW::SDTHeader*)region->vaddr().offset(offset_in_page(&p_header)).as_ptr();
  143. return sdt->revision;
  144. }
  145. void ACPIStaticParser::initialize_main_system_description_table()
  146. {
  147. #ifdef ACPI_DEBUG
  148. dbgprintf("ACPI: Checking Main SDT Length to choose the correct mapping size\n");
  149. #endif
  150. ASSERT(m_main_system_description_table != nullptr);
  151. u32 length;
  152. u8 revision;
  153. if (m_xsdt_supported) {
  154. length = get_table_size(*m_main_system_description_table);
  155. revision = get_table_revision(*m_main_system_description_table);
  156. } else {
  157. length = get_table_size(*m_main_system_description_table);
  158. revision = get_table_revision(*m_main_system_description_table);
  159. }
  160. auto main_sdt_region = MM.allocate_kernel_region(PhysicalAddress(page_base_of(m_main_system_description_table)), PAGE_ROUND_UP(length) + PAGE_SIZE, "ACPI Static Parser Initialization", Region::Access::Read, false, true);
  161. auto* sdt = (volatile ACPI_RAW::SDTHeader*)main_sdt_region->vaddr().offset(offset_in_page(m_main_system_description_table)).as_ptr();
  162. kprintf("ACPI: Main Description Table valid? 0x%x\n", validate_acpi_table(const_cast<ACPI_RAW::SDTHeader&>(*sdt), length));
  163. Vector<ACPI_RAW::SDTHeader*> sdt_pointers;
  164. if (m_xsdt_supported) {
  165. volatile auto* xsdt = (volatile ACPI_RAW::XSDT*)sdt;
  166. kprintf("ACPI: Using XSDT, Enumerating tables @ P 0x%x\n", m_main_system_description_table);
  167. kprintf("ACPI: XSDT Revision %d, Total length - %u\n", revision, length);
  168. #ifdef ACPI_DEBUG
  169. dbgprintf("ACPI: XSDT pointer @ V 0x%x\n", xsdt);
  170. #endif
  171. for (u32 i = 0; i < ((length - sizeof(ACPI_RAW::SDTHeader)) / sizeof(u64)); i++) {
  172. #ifdef ACPI_DEBUG
  173. dbgprintf("ACPI: Found new table [%u], @ V0x%x - P0x%x\n", i, &xsdt->table_ptrs[i], xsdt->table_ptrs[i]);
  174. #endif
  175. sdt_pointers.append((ACPI_RAW::SDTHeader*)xsdt->table_ptrs[i]);
  176. }
  177. } else {
  178. volatile auto* rsdt = (volatile ACPI_RAW::RSDT*)sdt;
  179. kprintf("ACPI: Using RSDT, Enumerating tables @ P 0x%x\n", m_main_system_description_table);
  180. kprintf("ACPI: RSDT Revision %d, Total length - %u\n", revision, length);
  181. #ifdef ACPI_DEBUG
  182. dbgprintf("ACPI: RSDT pointer @ V 0x%x\n", rsdt);
  183. #endif
  184. for (u32 i = 0; i < ((length - sizeof(ACPI_RAW::SDTHeader)) / sizeof(u32)); i++) {
  185. #ifdef ACPI_DEBUG
  186. dbgprintf("ACPI: Found new table [%u], @ V0x%x - P0x%x\n", i, &rsdt->table_ptrs[i], rsdt->table_ptrs[i]);
  187. #endif
  188. sdt_pointers.append((ACPI_RAW::SDTHeader*)rsdt->table_ptrs[i]);
  189. }
  190. }
  191. m_main_sdt = OwnPtr<ACPI::MainSystemDescriptionTable>(new ACPI::MainSystemDescriptionTable(move(sdt_pointers)));
  192. }
  193. void ACPIStaticParser::locate_main_system_description_table()
  194. {
  195. auto rsdp_region = MM.allocate_kernel_region(PhysicalAddress(page_base_of((u32)m_rsdp)), (PAGE_SIZE * 2), "ACPI Static Parser Initialization", Region::Access::Read, false, true);
  196. volatile auto* rsdp = (ACPI_RAW::RSDPDescriptor20*)rsdp_region->vaddr().offset(offset_in_page((u32)m_rsdp)).as_ptr();
  197. if (rsdp->base.revision == 0) {
  198. m_xsdt_supported = false;
  199. } else if (rsdp->base.revision >= 2) {
  200. if (rsdp->xsdt_ptr != (u64) nullptr) {
  201. m_xsdt_supported = true;
  202. } else {
  203. m_xsdt_supported = false;
  204. }
  205. }
  206. if (!m_xsdt_supported) {
  207. m_main_system_description_table = (ACPI_RAW::SDTHeader*)rsdp->base.rsdt_ptr;
  208. } else {
  209. m_main_system_description_table = (ACPI_RAW::SDTHeader*)rsdp->xsdt_ptr;
  210. }
  211. }
  212. void ACPIStaticParser::locate_all_aml_tables()
  213. {
  214. // Note: According to the ACPI spec, DSDT pointer may be found in the FADT table.
  215. // All other continuation of the DSDT can be found as pointers in the RSDT/XSDT.
  216. kprintf("ACPI: Searching for AML Tables\n");
  217. m_aml_tables_ptrs.append(m_fadt->get_dsdt());
  218. for (auto* sdt_ptr : m_main_sdt->get_sdt_pointers()) {
  219. auto region = MM.allocate_kernel_region(PhysicalAddress(page_base_of(sdt_ptr)), (PAGE_SIZE * 2), "ACPI Static Parser AML Tables Finding", Region::Access::Read);
  220. auto* sdt = (ACPI_RAW::SDTHeader*)region->vaddr().offset(offset_in_page(sdt_ptr)).as_ptr();
  221. #ifdef ACPI_DEBUG
  222. dbgprintf("ACPI: Examining Table @ P 0x%x\n", sdt_ptr);
  223. #endif
  224. if (!strncmp(sdt->sig, "SSDT", 4)) {
  225. kprintf("ACPI: Found AML Table @ P 0x%x, registering\n", sdt_ptr);
  226. m_aml_tables_ptrs.append(sdt);
  227. }
  228. }
  229. }
  230. ACPIStaticParser::ACPIStaticParser()
  231. : ACPIParser(true)
  232. , m_rsdp(nullptr)
  233. , m_main_sdt(nullptr)
  234. , m_fadt(nullptr)
  235. {
  236. m_rsdp = search_rsdp();
  237. if (m_rsdp != nullptr) {
  238. kprintf("ACPI: Using RSDP @ P 0x%x\n", m_rsdp);
  239. m_operable = true;
  240. locate_static_data();
  241. } else {
  242. m_operable = false;
  243. kprintf("ACPI: Disabled, due to RSDP being absent\n");
  244. }
  245. }
  246. ACPI_RAW::RSDPDescriptor20* ACPIStaticParser::search_rsdp_in_ebda(u16 ebda_segment)
  247. {
  248. auto rsdp_region = MM.allocate_kernel_region(PhysicalAddress(page_base_of((u32)(ebda_segment << 4))), PAGE_ROUND_UP(1024), "ACPI Static Parser RSDP Finding #1", Region::Access::Read, false, true);
  249. char* p_rsdp_str = (char*)(PhysicalAddress(ebda_segment << 4).as_ptr());
  250. for (char* rsdp_str = (char*)rsdp_region->vaddr().offset(offset_in_page((u32)(ebda_segment << 4))).as_ptr(); rsdp_str < (char*)(rsdp_region->vaddr().offset(offset_in_page((u32)(ebda_segment << 4))).get() + 1024); rsdp_str += 16) {
  251. #ifdef ACPI_DEBUG
  252. dbgprintf("ACPI: Looking for RSDP in EBDA @ V0x%x, P0x%x\n", rsdp_str, p_rsdp_str);
  253. #endif
  254. if (!strncmp("RSD PTR ", rsdp_str, strlen("RSD PTR ")))
  255. return (ACPI_RAW::RSDPDescriptor20*)p_rsdp_str;
  256. p_rsdp_str += 16;
  257. }
  258. return nullptr;
  259. }
  260. ACPI_RAW::RSDPDescriptor20* ACPIStaticParser::search_rsdp_in_bios_area()
  261. {
  262. auto rsdp_region = MM.allocate_kernel_region(PhysicalAddress(page_base_of((u32)0xE0000)), PAGE_ROUND_UP(0xFFFFF - 0xE0000), "ACPI Static Parser RSDP Finding #2", Region::Access::Read, false, true);
  263. char* p_rsdp_str = (char*)(PhysicalAddress(0xE0000).as_ptr());
  264. for (char* rsdp_str = (char*)rsdp_region->vaddr().offset(offset_in_page((u32)(0xE0000))).as_ptr(); rsdp_str < (char*)(rsdp_region->vaddr().offset(offset_in_page((u32)(0xE0000))).get() + (0xFFFFF - 0xE0000)); rsdp_str += 16) {
  265. #ifdef ACPI_DEBUG
  266. dbgprintf("ACPI: Looking for RSDP in EBDA @ V0x%x, P0x%x\n", rsdp_str, p_rsdp_str);
  267. #endif
  268. if (!strncmp("RSD PTR ", rsdp_str, strlen("RSD PTR ")))
  269. return (ACPI_RAW::RSDPDescriptor20*)p_rsdp_str;
  270. p_rsdp_str += 16;
  271. }
  272. return nullptr;
  273. }
  274. ACPI_RAW::RSDPDescriptor20* ACPIStaticParser::search_rsdp()
  275. {
  276. ACPI_RAW::RSDPDescriptor20* rsdp = nullptr;
  277. auto region = MM.allocate_kernel_region(PhysicalAddress(0), PAGE_SIZE, "ACPI Static Parser RSDP Finding", Region::Access::Read);
  278. u16 ebda_seg = (u16) * ((uint16_t*)((region->vaddr().get() & PAGE_MASK) + 0x40e));
  279. kprintf("ACPI: Probing EBDA, Segment 0x%x\n", ebda_seg);
  280. rsdp = search_rsdp_in_ebda(ebda_seg);
  281. if (rsdp != nullptr)
  282. return rsdp;
  283. return search_rsdp_in_bios_area();
  284. }
  285. ACPIStaticParser::ACPIStaticParser(ACPI_RAW::RSDPDescriptor20& rsdp)
  286. : ACPIParser(true)
  287. , m_rsdp(&rsdp)
  288. , m_main_sdt(nullptr)
  289. , m_fadt(nullptr)
  290. {
  291. kprintf("ACPI: Using RSDP @ Px%x\n", &rsdp);
  292. m_operable = true;
  293. locate_static_data();
  294. }
  295. ACPI::MainSystemDescriptionTable::MainSystemDescriptionTable(Vector<ACPI_RAW::SDTHeader*>&& sdt_pointers)
  296. {
  297. for (auto* sdt_ptr : sdt_pointers) {
  298. #ifdef ACPI_DEBUG
  299. dbgprintf("ACPI: Register new table in Main SDT, @ P 0x%x\n", sdt_ptr);
  300. #endif
  301. m_sdt_pointers.append(sdt_ptr);
  302. }
  303. }
  304. Vector<ACPI_RAW::SDTHeader*>& ACPI::MainSystemDescriptionTable::get_sdt_pointers()
  305. {
  306. return m_sdt_pointers;
  307. }
  308. ACPI::FixedACPIData::FixedACPIData(ACPI_RAW::FADT& fadt)
  309. {
  310. m_dsdt_ptr = fadt.dsdt_ptr;
  311. #ifdef ACPI_DEBUG
  312. dbgprintf("ACPI: DSDT pointer @ P 0x%x\n", m_dsdt_ptr);
  313. #endif
  314. m_revision = fadt.h.revision;
  315. m_x_dsdt_ptr = fadt.x_dsdt;
  316. m_preferred_pm_profile = fadt.preferred_pm_profile;
  317. m_sci_int = fadt.sci_int;
  318. m_smi_cmd = fadt.smi_cmd;
  319. m_acpi_enable_value = fadt.acpi_enable_value;
  320. m_acpi_disable_value = fadt.acpi_disable_value;
  321. m_s4bios_req = fadt.s4bios_req;
  322. m_pstate_cnt = fadt.pstate_cnt;
  323. m_PM1a_EVT_BLK = fadt.PM1a_EVT_BLK;
  324. m_PM1b_EVT_BLK = fadt.PM1b_EVT_BLK;
  325. m_PM1a_CNT_BLK = fadt.PM1a_CNT_BLK;
  326. m_PM1b_CNT_BLK = fadt.PM1b_CNT_BLK;
  327. m_PM2_CNT_BLK = fadt.PM2_CNT_BLK;
  328. m_PM_TMR_BLK = fadt.PM_TMR_BLK;
  329. m_GPE0_BLK = fadt.GPE0_BLK;
  330. m_GPE1_BLK = fadt.GPE1_BLK;
  331. m_PM1_EVT_LEN = fadt.PM1_EVT_LEN;
  332. m_PM1_CNT_LEN = fadt.PM1_CNT_LEN;
  333. m_PM2_CNT_LEN = fadt.PM2_CNT_LEN;
  334. m_PM_TMR_LEN = fadt.PM_TMR_LEN;
  335. m_GPE0_BLK_LEN = fadt.GPE0_BLK_LEN;
  336. m_GPE1_BLK_LEN = fadt.GPE1_BLK_LEN;
  337. m_GPE1_BASE = fadt.GPE1_BASE;
  338. m_cst_cnt = fadt.cst_cnt;
  339. m_P_LVL2_LAT = fadt.P_LVL2_LAT;
  340. m_P_LVL3_LAT = fadt.P_LVL3_LAT;
  341. m_flush_size = fadt.flush_size;
  342. m_flush_stride = fadt.flush_stride;
  343. m_duty_offset = fadt.duty_offset;
  344. m_duty_width = fadt.duty_width;
  345. m_day_alrm = fadt.day_alrm;
  346. m_mon_alrm = fadt.mon_alrm;
  347. m_century = fadt.century;
  348. m_ia_pc_boot_arch_flags = fadt.ia_pc_boot_arch_flags;
  349. m_flags = fadt.flags;
  350. m_reset_reg = fadt.reset_reg;
  351. #ifdef ACPI_DEBUG
  352. dbgprintf("ACPI: Reset Register @ IO 0x%x\n", m_reset_reg.address);
  353. dbgprintf("ACPI: Reset Register Address space %x\n", fadt.reset_reg.address_space);
  354. #endif
  355. m_reset_value = fadt.reset_value;
  356. #ifdef ACPI_DEBUG
  357. dbgprintf("ACPI: Reset Register value @ P 0x%x\n", m_reset_value);
  358. #endif
  359. m_x_pm1a_evt_blk = fadt.x_pm1a_evt_blk;
  360. m_x_pm1b_evt_blk = fadt.x_pm1b_evt_blk;
  361. m_x_pm1a_cnt_blk = fadt.x_pm1a_cnt_blk;
  362. m_x_pm1b_cnt_blk = fadt.x_pm1b_cnt_blk;
  363. m_x_pm2_cnt_blk = fadt.x_pm2_cnt_blk;
  364. m_x_pm_tmr_blk = fadt.x_pm_tmr_blk;
  365. m_x_gpe0_blk = fadt.x_gpe0_blk;
  366. m_x_gpe1_blk = fadt.x_gpe1_blk;
  367. m_sleep_control = fadt.sleep_control;
  368. m_sleep_status = fadt.sleep_status;
  369. m_hypervisor_vendor_identity = fadt.hypervisor_vendor_identity;
  370. }
  371. ACPI_RAW::SDTHeader* ACPI::FixedACPIData::get_dsdt()
  372. {
  373. if (m_x_dsdt_ptr != (uintptr_t) nullptr)
  374. return (ACPI_RAW::SDTHeader*)m_x_dsdt_ptr;
  375. else {
  376. ASSERT((ACPI_RAW::SDTHeader*)m_dsdt_ptr != nullptr);
  377. return (ACPI_RAW::SDTHeader*)m_dsdt_ptr;
  378. }
  379. }