The basic thing to do is either mark it as IOPL or surround it in a 16-bit module. emx/gcc and other compilers include some macros and functions to assist you in doing this.
Check the file IOPL32.ZIP at ftp.cdrom.com:/pub/os2/os2_x/programs