Mali Platform Edits
Based on Andreilux rewrite commit