Attention is currently required from: Lance Zhao, Nico Huber, Tim Wawrzynczak, Maximilian Brune, Arthur Heymans, Werner Zeh.
Jakub Czapiga has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/74762 )
Change subject: acpigen: Add a runtime method to override exposed _Sx sleep states
......................................................................
Patch Set 10:
(1 comment)
File src/acpi/acpigen.c:
https://review.coreboot.org/c/coreboot/+/74762/comment/a4485d81_e96046bf
PS10, Line 2377: uint32_t sleep_enable = (enable_s1 << 0) | (enable_s2 << 1)
: | (enable_s3 << 2) | (enable_s4 << 3);
This is still not safe. It's easy to create buggy code by passing any non-zero value as enabled state instead of one. I think you should change `enable_sX` type to either `int` or `bool`. And then:
```
uint32_t sleep_enable = 0;
if (enable_s1)
sleep_enable |= BIT(0);
if (enable_s2)
sleep_enable |= BIT(1);
...
```
This will be compatible with asserts above, which check whether `enable_sX` is zero or non-zero.
--
To view, visit
https://review.coreboot.org/c/coreboot/+/74762
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic21830c1ef9c183b1e3005cc1f8b7daf7e9ea998
Gerrit-Change-Number: 74762
Gerrit-PatchSet: 10
Gerrit-Owner: Arthur Heymans
arthur@aheymans.xyz
Gerrit-Reviewer: Jan Samek
jan.samek@siemens.com
Gerrit-Reviewer: Lance Zhao
lance.zhao@gmail.com
Gerrit-Reviewer: Lean Sheng Tan
sheng.tan@9elements.com
Gerrit-Reviewer: Maximilian Brune
maximilian.brune@9elements.com
Gerrit-Reviewer: Nico Huber
nico.h@gmx.de
Gerrit-Reviewer: Tim Wawrzynczak
inforichland@gmail.com
Gerrit-Reviewer: Werner Zeh
werner.zeh@siemens.com
Gerrit-Reviewer: build bot (Jenkins)
no-reply@coreboot.org
Gerrit-CC: Jakub Czapiga
jacz@semihalf.com
Gerrit-CC: Paul Menzel
paulepanter@mailbox.org
Gerrit-Attention: Lance Zhao
lance.zhao@gmail.com
Gerrit-Attention: Nico Huber
nico.h@gmx.de
Gerrit-Attention: Tim Wawrzynczak
inforichland@gmail.com
Gerrit-Attention: Maximilian Brune
maximilian.brune@9elements.com
Gerrit-Attention: Arthur Heymans
arthur@aheymans.xyz
Gerrit-Attention: Werner Zeh
werner.zeh@siemens.com
Gerrit-Comment-Date: Fri, 28 Apr 2023 09:56:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment