hwregs.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. /*******************************************************************************
  2. *
  3. * Module Name: hwregs - Read/write access functions for the various ACPI
  4. * control and status registers.
  5. *
  6. ******************************************************************************/
  7. /*
  8. * Copyright (C) 2000 - 2011, Intel Corp.
  9. * All rights reserved.
  10. *
  11. * Redistribution and use in source and binary forms, with or without
  12. * modification, are permitted provided that the following conditions
  13. * are met:
  14. * 1. Redistributions of source code must retain the above copyright
  15. * notice, this list of conditions, and the following disclaimer,
  16. * without modification.
  17. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  18. * substantially similar to the "NO WARRANTY" disclaimer below
  19. * ("Disclaimer") and any redistribution must be conditioned upon
  20. * including a substantially similar Disclaimer requirement for further
  21. * binary redistribution.
  22. * 3. Neither the names of the above-listed copyright holders nor the names
  23. * of any contributors may be used to endorse or promote products derived
  24. * from this software without specific prior written permission.
  25. *
  26. * Alternatively, this software may be distributed under the terms of the
  27. * GNU General Public License ("GPL") version 2 as published by the Free
  28. * Software Foundation.
  29. *
  30. * NO WARRANTY
  31. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  32. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  33. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  34. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  35. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  36. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  37. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  38. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  39. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  40. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  41. * POSSIBILITY OF SUCH DAMAGES.
  42. */
  43. #include <acpi/acpi.h>
  44. #include "accommon.h"
  45. #include "acnamesp.h"
  46. #include "acevents.h"
  47. #define _COMPONENT ACPI_HARDWARE
  48. ACPI_MODULE_NAME("hwregs")
  49. /* Local Prototypes */
  50. static acpi_status
  51. acpi_hw_read_multiple(u32 *value,
  52. struct acpi_generic_address *register_a,
  53. struct acpi_generic_address *register_b);
  54. static acpi_status
  55. acpi_hw_write_multiple(u32 value,
  56. struct acpi_generic_address *register_a,
  57. struct acpi_generic_address *register_b);
  58. /******************************************************************************
  59. *
  60. * FUNCTION: acpi_hw_validate_register
  61. *
  62. * PARAMETERS: Reg - GAS register structure
  63. * max_bit_width - Max bit_width supported (32 or 64)
  64. * Address - Pointer to where the gas->address
  65. * is returned
  66. *
  67. * RETURN: Status
  68. *
  69. * DESCRIPTION: Validate the contents of a GAS register. Checks the GAS
  70. * pointer, Address, space_id, bit_width, and bit_offset.
  71. *
  72. ******************************************************************************/
  73. acpi_status
  74. acpi_hw_validate_register(struct acpi_generic_address *reg,
  75. u8 max_bit_width, u64 *address)
  76. {
  77. /* Must have a valid pointer to a GAS structure */
  78. if (!reg) {
  79. return (AE_BAD_PARAMETER);
  80. }
  81. /*
  82. * Copy the target address. This handles possible alignment issues.
  83. * Address must not be null. A null address also indicates an optional
  84. * ACPI register that is not supported, so no error message.
  85. */
  86. ACPI_MOVE_64_TO_64(address, &reg->address);
  87. if (!(*address)) {
  88. return (AE_BAD_ADDRESS);
  89. }
  90. /* Validate the space_iD */
  91. if ((reg->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) &&
  92. (reg->space_id != ACPI_ADR_SPACE_SYSTEM_IO)) {
  93. ACPI_ERROR((AE_INFO,
  94. "Unsupported address space: 0x%X", reg->space_id));
  95. return (AE_SUPPORT);
  96. }
  97. /* Validate the bit_width */
  98. if ((reg->bit_width != 8) &&
  99. (reg->bit_width != 16) &&
  100. (reg->bit_width != 32) && (reg->bit_width != max_bit_width)) {
  101. ACPI_ERROR((AE_INFO,
  102. "Unsupported register bit width: 0x%X",
  103. reg->bit_width));
  104. return (AE_SUPPORT);
  105. }
  106. /* Validate the bit_offset. Just a warning for now. */
  107. if (reg->bit_offset != 0) {
  108. ACPI_WARNING((AE_INFO,
  109. "Unsupported register bit offset: 0x%X",
  110. reg->bit_offset));
  111. }
  112. return (AE_OK);
  113. }
  114. /******************************************************************************
  115. *
  116. * FUNCTION: acpi_hw_read
  117. *
  118. * PARAMETERS: Value - Where the value is returned
  119. * Reg - GAS register structure
  120. *
  121. * RETURN: Status
  122. *
  123. * DESCRIPTION: Read from either memory or IO space. This is a 32-bit max
  124. * version of acpi_read, used internally since the overhead of
  125. * 64-bit values is not needed.
  126. *
  127. * LIMITATIONS: <These limitations also apply to acpi_hw_write>
  128. * bit_width must be exactly 8, 16, or 32.
  129. * space_iD must be system_memory or system_iO.
  130. * bit_offset and access_width are currently ignored, as there has
  131. * not been a need to implement these.
  132. *
  133. ******************************************************************************/
  134. acpi_status acpi_hw_read(u32 *value, struct acpi_generic_address *reg)
  135. {
  136. u64 address;
  137. acpi_status status;
  138. ACPI_FUNCTION_NAME(hw_read);
  139. /* Validate contents of the GAS register */
  140. status = acpi_hw_validate_register(reg, 32, &address);
  141. if (ACPI_FAILURE(status)) {
  142. return (status);
  143. }
  144. /* Initialize entire 32-bit return value to zero */
  145. *value = 0;
  146. /*
  147. * Two address spaces supported: Memory or IO. PCI_Config is
  148. * not supported here because the GAS structure is insufficient
  149. */
  150. if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
  151. status = acpi_os_read_memory((acpi_physical_address)
  152. address, value, reg->bit_width);
  153. } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
  154. status = acpi_hw_read_port((acpi_io_address)
  155. address, value, reg->bit_width);
  156. }
  157. ACPI_DEBUG_PRINT((ACPI_DB_IO,
  158. "Read: %8.8X width %2d from %8.8X%8.8X (%s)\n",
  159. *value, reg->bit_width, ACPI_FORMAT_UINT64(address),
  160. acpi_ut_get_region_name(reg->space_id)));
  161. return (status);
  162. }
  163. /******************************************************************************
  164. *
  165. * FUNCTION: acpi_hw_write
  166. *
  167. * PARAMETERS: Value - Value to be written
  168. * Reg - GAS register structure
  169. *
  170. * RETURN: Status
  171. *
  172. * DESCRIPTION: Write to either memory or IO space. This is a 32-bit max
  173. * version of acpi_write, used internally since the overhead of
  174. * 64-bit values is not needed.
  175. *
  176. ******************************************************************************/
  177. acpi_status acpi_hw_write(u32 value, struct acpi_generic_address *reg)
  178. {
  179. u64 address;
  180. acpi_status status;
  181. ACPI_FUNCTION_NAME(hw_write);
  182. /* Validate contents of the GAS register */
  183. status = acpi_hw_validate_register(reg, 32, &address);
  184. if (ACPI_FAILURE(status)) {
  185. return (status);
  186. }
  187. /*
  188. * Two address spaces supported: Memory or IO. PCI_Config is
  189. * not supported here because the GAS structure is insufficient
  190. */
  191. if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
  192. status = acpi_os_write_memory((acpi_physical_address)
  193. address, value, reg->bit_width);
  194. } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
  195. status = acpi_hw_write_port((acpi_io_address)
  196. address, value, reg->bit_width);
  197. }
  198. ACPI_DEBUG_PRINT((ACPI_DB_IO,
  199. "Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n",
  200. value, reg->bit_width, ACPI_FORMAT_UINT64(address),
  201. acpi_ut_get_region_name(reg->space_id)));
  202. return (status);
  203. }
  204. /*******************************************************************************
  205. *
  206. * FUNCTION: acpi_hw_clear_acpi_status
  207. *
  208. * PARAMETERS: None
  209. *
  210. * RETURN: Status
  211. *
  212. * DESCRIPTION: Clears all fixed and general purpose status bits
  213. *
  214. ******************************************************************************/
  215. acpi_status acpi_hw_clear_acpi_status(void)
  216. {
  217. acpi_status status;
  218. acpi_cpu_flags lock_flags = 0;
  219. ACPI_FUNCTION_TRACE(hw_clear_acpi_status);
  220. ACPI_DEBUG_PRINT((ACPI_DB_IO, "About to write %04X to %8.8X%8.8X\n",
  221. ACPI_BITMASK_ALL_FIXED_STATUS,
  222. ACPI_FORMAT_UINT64(acpi_gbl_xpm1a_status.address)));
  223. lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock);
  224. /* Clear the fixed events in PM1 A/B */
  225. status = acpi_hw_register_write(ACPI_REGISTER_PM1_STATUS,
  226. ACPI_BITMASK_ALL_FIXED_STATUS);
  227. if (ACPI_FAILURE(status)) {
  228. goto unlock_and_exit;
  229. }
  230. /* Clear the GPE Bits in all GPE registers in all GPE blocks */
  231. status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block, NULL);
  232. unlock_and_exit:
  233. acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags);
  234. return_ACPI_STATUS(status);
  235. }
  236. /*******************************************************************************
  237. *
  238. * FUNCTION: acpi_hw_get_register_bit_mask
  239. *
  240. * PARAMETERS: register_id - Index of ACPI Register to access
  241. *
  242. * RETURN: The bitmask to be used when accessing the register
  243. *
  244. * DESCRIPTION: Map register_id into a register bitmask.
  245. *
  246. ******************************************************************************/
  247. struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id)
  248. {
  249. ACPI_FUNCTION_ENTRY();
  250. if (register_id > ACPI_BITREG_MAX) {
  251. ACPI_ERROR((AE_INFO, "Invalid BitRegister ID: 0x%X",
  252. register_id));
  253. return (NULL);
  254. }
  255. return (&acpi_gbl_bit_register_info[register_id]);
  256. }
  257. /******************************************************************************
  258. *
  259. * FUNCTION: acpi_hw_write_pm1_control
  260. *
  261. * PARAMETERS: pm1a_control - Value to be written to PM1A control
  262. * pm1b_control - Value to be written to PM1B control
  263. *
  264. * RETURN: Status
  265. *
  266. * DESCRIPTION: Write the PM1 A/B control registers. These registers are
  267. * different than than the PM1 A/B status and enable registers
  268. * in that different values can be written to the A/B registers.
  269. * Most notably, the SLP_TYP bits can be different, as per the
  270. * values returned from the _Sx predefined methods.
  271. *
  272. ******************************************************************************/
  273. acpi_status acpi_hw_write_pm1_control(u32 pm1a_control, u32 pm1b_control)
  274. {
  275. acpi_status status;
  276. ACPI_FUNCTION_TRACE(hw_write_pm1_control);
  277. status =
  278. acpi_hw_write(pm1a_control, &acpi_gbl_FADT.xpm1a_control_block);
  279. if (ACPI_FAILURE(status)) {
  280. return_ACPI_STATUS(status);
  281. }
  282. if (acpi_gbl_FADT.xpm1b_control_block.address) {
  283. status =
  284. acpi_hw_write(pm1b_control,
  285. &acpi_gbl_FADT.xpm1b_control_block);
  286. }
  287. return_ACPI_STATUS(status);
  288. }
  289. /******************************************************************************
  290. *
  291. * FUNCTION: acpi_hw_register_read
  292. *
  293. * PARAMETERS: register_id - ACPI Register ID
  294. * return_value - Where the register value is returned
  295. *
  296. * RETURN: Status and the value read.
  297. *
  298. * DESCRIPTION: Read from the specified ACPI register
  299. *
  300. ******************************************************************************/
  301. acpi_status
  302. acpi_hw_register_read(u32 register_id, u32 * return_value)
  303. {
  304. u32 value = 0;
  305. acpi_status status;
  306. ACPI_FUNCTION_TRACE(hw_register_read);
  307. switch (register_id) {
  308. case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */
  309. status = acpi_hw_read_multiple(&value,
  310. &acpi_gbl_xpm1a_status,
  311. &acpi_gbl_xpm1b_status);
  312. break;
  313. case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access each */
  314. status = acpi_hw_read_multiple(&value,
  315. &acpi_gbl_xpm1a_enable,
  316. &acpi_gbl_xpm1b_enable);
  317. break;
  318. case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */
  319. status = acpi_hw_read_multiple(&value,
  320. &acpi_gbl_FADT.
  321. xpm1a_control_block,
  322. &acpi_gbl_FADT.
  323. xpm1b_control_block);
  324. /*
  325. * Zero the write-only bits. From the ACPI specification, "Hardware
  326. * Write-Only Bits": "Upon reads to registers with write-only bits,
  327. * software masks out all write-only bits."
  328. */
  329. value &= ~ACPI_PM1_CONTROL_WRITEONLY_BITS;
  330. break;
  331. case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
  332. status =
  333. acpi_hw_read(&value, &acpi_gbl_FADT.xpm2_control_block);
  334. break;
  335. case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
  336. status = acpi_hw_read(&value, &acpi_gbl_FADT.xpm_timer_block);
  337. break;
  338. case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
  339. status =
  340. acpi_hw_read_port(acpi_gbl_FADT.smi_command, &value, 8);
  341. break;
  342. default:
  343. ACPI_ERROR((AE_INFO, "Unknown Register ID: 0x%X", register_id));
  344. status = AE_BAD_PARAMETER;
  345. break;
  346. }
  347. if (ACPI_SUCCESS(status)) {
  348. *return_value = value;
  349. }
  350. return_ACPI_STATUS(status);
  351. }
  352. /******************************************************************************
  353. *
  354. * FUNCTION: acpi_hw_register_write
  355. *
  356. * PARAMETERS: register_id - ACPI Register ID
  357. * Value - The value to write
  358. *
  359. * RETURN: Status
  360. *
  361. * DESCRIPTION: Write to the specified ACPI register
  362. *
  363. * NOTE: In accordance with the ACPI specification, this function automatically
  364. * preserves the value of the following bits, meaning that these bits cannot be
  365. * changed via this interface:
  366. *
  367. * PM1_CONTROL[0] = SCI_EN
  368. * PM1_CONTROL[9]
  369. * PM1_STATUS[11]
  370. *
  371. * ACPI References:
  372. * 1) Hardware Ignored Bits: When software writes to a register with ignored
  373. * bit fields, it preserves the ignored bit fields
  374. * 2) SCI_EN: OSPM always preserves this bit position
  375. *
  376. ******************************************************************************/
  377. acpi_status acpi_hw_register_write(u32 register_id, u32 value)
  378. {
  379. acpi_status status;
  380. u32 read_value;
  381. ACPI_FUNCTION_TRACE(hw_register_write);
  382. switch (register_id) {
  383. case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */
  384. /*
  385. * Handle the "ignored" bit in PM1 Status. According to the ACPI
  386. * specification, ignored bits are to be preserved when writing.
  387. * Normally, this would mean a read/modify/write sequence. However,
  388. * preserving a bit in the status register is different. Writing a
  389. * one clears the status, and writing a zero preserves the status.
  390. * Therefore, we must always write zero to the ignored bit.
  391. *
  392. * This behavior is clarified in the ACPI 4.0 specification.
  393. */
  394. value &= ~ACPI_PM1_STATUS_PRESERVED_BITS;
  395. status = acpi_hw_write_multiple(value,
  396. &acpi_gbl_xpm1a_status,
  397. &acpi_gbl_xpm1b_status);
  398. break;
  399. case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access */
  400. status = acpi_hw_write_multiple(value,
  401. &acpi_gbl_xpm1a_enable,
  402. &acpi_gbl_xpm1b_enable);
  403. break;
  404. case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */
  405. /*
  406. * Perform a read first to preserve certain bits (per ACPI spec)
  407. * Note: This includes SCI_EN, we never want to change this bit
  408. */
  409. status = acpi_hw_read_multiple(&read_value,
  410. &acpi_gbl_FADT.
  411. xpm1a_control_block,
  412. &acpi_gbl_FADT.
  413. xpm1b_control_block);
  414. if (ACPI_FAILURE(status)) {
  415. goto exit;
  416. }
  417. /* Insert the bits to be preserved */
  418. ACPI_INSERT_BITS(value, ACPI_PM1_CONTROL_PRESERVED_BITS,
  419. read_value);
  420. /* Now we can write the data */
  421. status = acpi_hw_write_multiple(value,
  422. &acpi_gbl_FADT.
  423. xpm1a_control_block,
  424. &acpi_gbl_FADT.
  425. xpm1b_control_block);
  426. break;
  427. case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
  428. /*
  429. * For control registers, all reserved bits must be preserved,
  430. * as per the ACPI spec.
  431. */
  432. status =
  433. acpi_hw_read(&read_value,
  434. &acpi_gbl_FADT.xpm2_control_block);
  435. if (ACPI_FAILURE(status)) {
  436. goto exit;
  437. }
  438. /* Insert the bits to be preserved */
  439. ACPI_INSERT_BITS(value, ACPI_PM2_CONTROL_PRESERVED_BITS,
  440. read_value);
  441. status =
  442. acpi_hw_write(value, &acpi_gbl_FADT.xpm2_control_block);
  443. break;
  444. case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
  445. status = acpi_hw_write(value, &acpi_gbl_FADT.xpm_timer_block);
  446. break;
  447. case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
  448. /* SMI_CMD is currently always in IO space */
  449. status =
  450. acpi_hw_write_port(acpi_gbl_FADT.smi_command, value, 8);
  451. break;
  452. default:
  453. ACPI_ERROR((AE_INFO, "Unknown Register ID: 0x%X", register_id));
  454. status = AE_BAD_PARAMETER;
  455. break;
  456. }
  457. exit:
  458. return_ACPI_STATUS(status);
  459. }
  460. /******************************************************************************
  461. *
  462. * FUNCTION: acpi_hw_read_multiple
  463. *
  464. * PARAMETERS: Value - Where the register value is returned
  465. * register_a - First ACPI register (required)
  466. * register_b - Second ACPI register (optional)
  467. *
  468. * RETURN: Status
  469. *
  470. * DESCRIPTION: Read from the specified two-part ACPI register (such as PM1 A/B)
  471. *
  472. ******************************************************************************/
  473. static acpi_status
  474. acpi_hw_read_multiple(u32 *value,
  475. struct acpi_generic_address *register_a,
  476. struct acpi_generic_address *register_b)
  477. {
  478. u32 value_a = 0;
  479. u32 value_b = 0;
  480. acpi_status status;
  481. /* The first register is always required */
  482. status = acpi_hw_read(&value_a, register_a);
  483. if (ACPI_FAILURE(status)) {
  484. return (status);
  485. }
  486. /* Second register is optional */
  487. if (register_b->address) {
  488. status = acpi_hw_read(&value_b, register_b);
  489. if (ACPI_FAILURE(status)) {
  490. return (status);
  491. }
  492. }
  493. /*
  494. * OR the two return values together. No shifting or masking is necessary,
  495. * because of how the PM1 registers are defined in the ACPI specification:
  496. *
  497. * "Although the bits can be split between the two register blocks (each
  498. * register block has a unique pointer within the FADT), the bit positions
  499. * are maintained. The register block with unimplemented bits (that is,
  500. * those implemented in the other register block) always returns zeros,
  501. * and writes have no side effects"
  502. */
  503. *value = (value_a | value_b);
  504. return (AE_OK);
  505. }
  506. /******************************************************************************
  507. *
  508. * FUNCTION: acpi_hw_write_multiple
  509. *
  510. * PARAMETERS: Value - The value to write
  511. * register_a - First ACPI register (required)
  512. * register_b - Second ACPI register (optional)
  513. *
  514. * RETURN: Status
  515. *
  516. * DESCRIPTION: Write to the specified two-part ACPI register (such as PM1 A/B)
  517. *
  518. ******************************************************************************/
  519. static acpi_status
  520. acpi_hw_write_multiple(u32 value,
  521. struct acpi_generic_address *register_a,
  522. struct acpi_generic_address *register_b)
  523. {
  524. acpi_status status;
  525. /* The first register is always required */
  526. status = acpi_hw_write(value, register_a);
  527. if (ACPI_FAILURE(status)) {
  528. return (status);
  529. }
  530. /*
  531. * Second register is optional
  532. *
  533. * No bit shifting or clearing is necessary, because of how the PM1
  534. * registers are defined in the ACPI specification:
  535. *
  536. * "Although the bits can be split between the two register blocks (each
  537. * register block has a unique pointer within the FADT), the bit positions
  538. * are maintained. The register block with unimplemented bits (that is,
  539. * those implemented in the other register block) always returns zeros,
  540. * and writes have no side effects"
  541. */
  542. if (register_b->address) {
  543. status = acpi_hw_write(value, register_b);
  544. }
  545. return (status);
  546. }