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. acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags);
  228. if (ACPI_FAILURE(status))
  229. goto exit;
  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. exit:
  233. return_ACPI_STATUS(status);
  234. }
  235. /*******************************************************************************
  236. *
  237. * FUNCTION: acpi_hw_get_register_bit_mask
  238. *
  239. * PARAMETERS: register_id - Index of ACPI Register to access
  240. *
  241. * RETURN: The bitmask to be used when accessing the register
  242. *
  243. * DESCRIPTION: Map register_id into a register bitmask.
  244. *
  245. ******************************************************************************/
  246. struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id)
  247. {
  248. ACPI_FUNCTION_ENTRY();
  249. if (register_id > ACPI_BITREG_MAX) {
  250. ACPI_ERROR((AE_INFO, "Invalid BitRegister ID: 0x%X",
  251. register_id));
  252. return (NULL);
  253. }
  254. return (&acpi_gbl_bit_register_info[register_id]);
  255. }
  256. /******************************************************************************
  257. *
  258. * FUNCTION: acpi_hw_write_pm1_control
  259. *
  260. * PARAMETERS: pm1a_control - Value to be written to PM1A control
  261. * pm1b_control - Value to be written to PM1B control
  262. *
  263. * RETURN: Status
  264. *
  265. * DESCRIPTION: Write the PM1 A/B control registers. These registers are
  266. * different than than the PM1 A/B status and enable registers
  267. * in that different values can be written to the A/B registers.
  268. * Most notably, the SLP_TYP bits can be different, as per the
  269. * values returned from the _Sx predefined methods.
  270. *
  271. ******************************************************************************/
  272. acpi_status acpi_hw_write_pm1_control(u32 pm1a_control, u32 pm1b_control)
  273. {
  274. acpi_status status;
  275. ACPI_FUNCTION_TRACE(hw_write_pm1_control);
  276. status =
  277. acpi_hw_write(pm1a_control, &acpi_gbl_FADT.xpm1a_control_block);
  278. if (ACPI_FAILURE(status)) {
  279. return_ACPI_STATUS(status);
  280. }
  281. if (acpi_gbl_FADT.xpm1b_control_block.address) {
  282. status =
  283. acpi_hw_write(pm1b_control,
  284. &acpi_gbl_FADT.xpm1b_control_block);
  285. }
  286. return_ACPI_STATUS(status);
  287. }
  288. /******************************************************************************
  289. *
  290. * FUNCTION: acpi_hw_register_read
  291. *
  292. * PARAMETERS: register_id - ACPI Register ID
  293. * return_value - Where the register value is returned
  294. *
  295. * RETURN: Status and the value read.
  296. *
  297. * DESCRIPTION: Read from the specified ACPI register
  298. *
  299. ******************************************************************************/
  300. acpi_status
  301. acpi_hw_register_read(u32 register_id, u32 * return_value)
  302. {
  303. u32 value = 0;
  304. acpi_status status;
  305. ACPI_FUNCTION_TRACE(hw_register_read);
  306. switch (register_id) {
  307. case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */
  308. status = acpi_hw_read_multiple(&value,
  309. &acpi_gbl_xpm1a_status,
  310. &acpi_gbl_xpm1b_status);
  311. break;
  312. case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access each */
  313. status = acpi_hw_read_multiple(&value,
  314. &acpi_gbl_xpm1a_enable,
  315. &acpi_gbl_xpm1b_enable);
  316. break;
  317. case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */
  318. status = acpi_hw_read_multiple(&value,
  319. &acpi_gbl_FADT.
  320. xpm1a_control_block,
  321. &acpi_gbl_FADT.
  322. xpm1b_control_block);
  323. /*
  324. * Zero the write-only bits. From the ACPI specification, "Hardware
  325. * Write-Only Bits": "Upon reads to registers with write-only bits,
  326. * software masks out all write-only bits."
  327. */
  328. value &= ~ACPI_PM1_CONTROL_WRITEONLY_BITS;
  329. break;
  330. case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
  331. status =
  332. acpi_hw_read(&value, &acpi_gbl_FADT.xpm2_control_block);
  333. break;
  334. case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
  335. status = acpi_hw_read(&value, &acpi_gbl_FADT.xpm_timer_block);
  336. break;
  337. case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
  338. status =
  339. acpi_hw_read_port(acpi_gbl_FADT.smi_command, &value, 8);
  340. break;
  341. default:
  342. ACPI_ERROR((AE_INFO, "Unknown Register ID: 0x%X", register_id));
  343. status = AE_BAD_PARAMETER;
  344. break;
  345. }
  346. if (ACPI_SUCCESS(status)) {
  347. *return_value = value;
  348. }
  349. return_ACPI_STATUS(status);
  350. }
  351. /******************************************************************************
  352. *
  353. * FUNCTION: acpi_hw_register_write
  354. *
  355. * PARAMETERS: register_id - ACPI Register ID
  356. * Value - The value to write
  357. *
  358. * RETURN: Status
  359. *
  360. * DESCRIPTION: Write to the specified ACPI register
  361. *
  362. * NOTE: In accordance with the ACPI specification, this function automatically
  363. * preserves the value of the following bits, meaning that these bits cannot be
  364. * changed via this interface:
  365. *
  366. * PM1_CONTROL[0] = SCI_EN
  367. * PM1_CONTROL[9]
  368. * PM1_STATUS[11]
  369. *
  370. * ACPI References:
  371. * 1) Hardware Ignored Bits: When software writes to a register with ignored
  372. * bit fields, it preserves the ignored bit fields
  373. * 2) SCI_EN: OSPM always preserves this bit position
  374. *
  375. ******************************************************************************/
  376. acpi_status acpi_hw_register_write(u32 register_id, u32 value)
  377. {
  378. acpi_status status;
  379. u32 read_value;
  380. ACPI_FUNCTION_TRACE(hw_register_write);
  381. switch (register_id) {
  382. case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */
  383. /*
  384. * Handle the "ignored" bit in PM1 Status. According to the ACPI
  385. * specification, ignored bits are to be preserved when writing.
  386. * Normally, this would mean a read/modify/write sequence. However,
  387. * preserving a bit in the status register is different. Writing a
  388. * one clears the status, and writing a zero preserves the status.
  389. * Therefore, we must always write zero to the ignored bit.
  390. *
  391. * This behavior is clarified in the ACPI 4.0 specification.
  392. */
  393. value &= ~ACPI_PM1_STATUS_PRESERVED_BITS;
  394. status = acpi_hw_write_multiple(value,
  395. &acpi_gbl_xpm1a_status,
  396. &acpi_gbl_xpm1b_status);
  397. break;
  398. case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access */
  399. status = acpi_hw_write_multiple(value,
  400. &acpi_gbl_xpm1a_enable,
  401. &acpi_gbl_xpm1b_enable);
  402. break;
  403. case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */
  404. /*
  405. * Perform a read first to preserve certain bits (per ACPI spec)
  406. * Note: This includes SCI_EN, we never want to change this bit
  407. */
  408. status = acpi_hw_read_multiple(&read_value,
  409. &acpi_gbl_FADT.
  410. xpm1a_control_block,
  411. &acpi_gbl_FADT.
  412. xpm1b_control_block);
  413. if (ACPI_FAILURE(status)) {
  414. goto exit;
  415. }
  416. /* Insert the bits to be preserved */
  417. ACPI_INSERT_BITS(value, ACPI_PM1_CONTROL_PRESERVED_BITS,
  418. read_value);
  419. /* Now we can write the data */
  420. status = acpi_hw_write_multiple(value,
  421. &acpi_gbl_FADT.
  422. xpm1a_control_block,
  423. &acpi_gbl_FADT.
  424. xpm1b_control_block);
  425. break;
  426. case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
  427. /*
  428. * For control registers, all reserved bits must be preserved,
  429. * as per the ACPI spec.
  430. */
  431. status =
  432. acpi_hw_read(&read_value,
  433. &acpi_gbl_FADT.xpm2_control_block);
  434. if (ACPI_FAILURE(status)) {
  435. goto exit;
  436. }
  437. /* Insert the bits to be preserved */
  438. ACPI_INSERT_BITS(value, ACPI_PM2_CONTROL_PRESERVED_BITS,
  439. read_value);
  440. status =
  441. acpi_hw_write(value, &acpi_gbl_FADT.xpm2_control_block);
  442. break;
  443. case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
  444. status = acpi_hw_write(value, &acpi_gbl_FADT.xpm_timer_block);
  445. break;
  446. case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
  447. /* SMI_CMD is currently always in IO space */
  448. status =
  449. acpi_hw_write_port(acpi_gbl_FADT.smi_command, value, 8);
  450. break;
  451. default:
  452. ACPI_ERROR((AE_INFO, "Unknown Register ID: 0x%X", register_id));
  453. status = AE_BAD_PARAMETER;
  454. break;
  455. }
  456. exit:
  457. return_ACPI_STATUS(status);
  458. }
  459. /******************************************************************************
  460. *
  461. * FUNCTION: acpi_hw_read_multiple
  462. *
  463. * PARAMETERS: Value - Where the register value is returned
  464. * register_a - First ACPI register (required)
  465. * register_b - Second ACPI register (optional)
  466. *
  467. * RETURN: Status
  468. *
  469. * DESCRIPTION: Read from the specified two-part ACPI register (such as PM1 A/B)
  470. *
  471. ******************************************************************************/
  472. static acpi_status
  473. acpi_hw_read_multiple(u32 *value,
  474. struct acpi_generic_address *register_a,
  475. struct acpi_generic_address *register_b)
  476. {
  477. u32 value_a = 0;
  478. u32 value_b = 0;
  479. acpi_status status;
  480. /* The first register is always required */
  481. status = acpi_hw_read(&value_a, register_a);
  482. if (ACPI_FAILURE(status)) {
  483. return (status);
  484. }
  485. /* Second register is optional */
  486. if (register_b->address) {
  487. status = acpi_hw_read(&value_b, register_b);
  488. if (ACPI_FAILURE(status)) {
  489. return (status);
  490. }
  491. }
  492. /*
  493. * OR the two return values together. No shifting or masking is necessary,
  494. * because of how the PM1 registers are defined in the ACPI specification:
  495. *
  496. * "Although the bits can be split between the two register blocks (each
  497. * register block has a unique pointer within the FADT), the bit positions
  498. * are maintained. The register block with unimplemented bits (that is,
  499. * those implemented in the other register block) always returns zeros,
  500. * and writes have no side effects"
  501. */
  502. *value = (value_a | value_b);
  503. return (AE_OK);
  504. }
  505. /******************************************************************************
  506. *
  507. * FUNCTION: acpi_hw_write_multiple
  508. *
  509. * PARAMETERS: Value - The value to write
  510. * register_a - First ACPI register (required)
  511. * register_b - Second ACPI register (optional)
  512. *
  513. * RETURN: Status
  514. *
  515. * DESCRIPTION: Write to the specified two-part ACPI register (such as PM1 A/B)
  516. *
  517. ******************************************************************************/
  518. static acpi_status
  519. acpi_hw_write_multiple(u32 value,
  520. struct acpi_generic_address *register_a,
  521. struct acpi_generic_address *register_b)
  522. {
  523. acpi_status status;
  524. /* The first register is always required */
  525. status = acpi_hw_write(value, register_a);
  526. if (ACPI_FAILURE(status)) {
  527. return (status);
  528. }
  529. /*
  530. * Second register is optional
  531. *
  532. * No bit shifting or clearing is necessary, because of how the PM1
  533. * registers are defined in the ACPI specification:
  534. *
  535. * "Although the bits can be split between the two register blocks (each
  536. * register block has a unique pointer within the FADT), the bit positions
  537. * are maintained. The register block with unimplemented bits (that is,
  538. * those implemented in the other register block) always returns zeros,
  539. * and writes have no side effects"
  540. */
  541. if (register_b->address) {
  542. status = acpi_hw_write(value, register_b);
  543. }
  544. return (status);
  545. }