kernel - Move mplock to machine-independent C