Ported some macroses from linux kernel