Skip to content

Commit 41fe478

Browse files
committed
AML: respect the table revision in DefFindSetLeftBit
1 parent 4b077d6 commit 41fe478

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Diff for: src/aml/mod.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -1378,11 +1378,14 @@ where
13781378
0
13791379
} else {
13801380
/*
1381-
* TODO: this is a particular instance where not respecting integers being
1382-
* 32-bit on revision 1 tables does cause properly incorrect behaviour...
1383-
* TODO: we can fix this now we have the DSDT revision
1381+
* This is a particularly important place to respect the integer width as set
1382+
* by the DSDT revision.
13841383
*/
1385-
(operand.leading_zeros() + 1) as u64
1384+
if self.dsdt_revision >= 2 {
1385+
(operand.leading_zeros() + 1) as u64
1386+
} else {
1387+
((operand as u32).leading_zeros() + 1) as u64
1388+
}
13861389
}
13871390
}
13881391
Opcode::FindSetRightBit => {

0 commit comments

Comments
 (0)