This macro is copy/pasted to several files, more of the functionality should be moved soon too. Change-Id: If29eb8eec07508aa591758483be3dd189fe1cca8