Page MenuHomePhabricator

[scudo] Read ARM feature bits using Fuchsia APIs.

Authored by flowerhack on Apr 20 2018, 12:29 PM.


Fuchsia uses zx_system_get_features in lieu of getauxval.

Use this call when checking for CRC32 support.

Diff Detail

Event Timeline

flowerhack created this revision.Apr 20 2018, 12:29 PM
cryptoad added inline comments.Apr 20 2018, 1:10 PM
26 ↗(On Diff #143362)

I would move this in the arm #if with an else for the rest, so we don't even have to include getauxval.
Adjust the # spacing accordingly.

118 ↗(On Diff #143362)

Same here, I would move this under the arm #if, as a whole function, and put all the rest in the #else.

119 ↗(On Diff #143362)

We could probably use u32 here instead for consistency.
To stick with the LLVM standard, please capitalize the variable name (eg: HWCap probably or something like that).
Same for rc under.

flowerhack marked 3 inline comments as done.
cryptoad added inline comments.Apr 20 2018, 2:29 PM
25 ↗(On Diff #143387)

So Fuchsia is not POSIX, that block can go in the #else as well.

106 ↗(On Diff #143387)

Same here, everything in the #else.

flowerhack marked 2 inline comments as done.
flowerhack added inline comments.
25 ↗(On Diff #143387)

I actually find the nested preprocessor if/elses a little trickier to read, personally o.o;;;

but, made the changes!

cryptoad updated this revision to Diff 143456.Apr 21 2018, 9:45 AM

Sorry, you were right! The initial version was less complicated.
I'm updating this to fallback to it, with the style changes included.

Herald added subscribers: Restricted Project, llvm-commits, delcypher. · View Herald TranscriptApr 21 2018, 9:45 AM
cryptoad accepted this revision.Apr 21 2018, 2:31 PM
This revision is now accepted and ready to land.Apr 21 2018, 2:31 PM
This revision was automatically updated to reflect the committed changes.