Added an ioctl header. Move some MACRO to makefile header.