home *** CD-ROM | disk | FTP | other *** search
- #define __IN_VDI_C
- #include "common.h"
- /* vdi binding arrays (extern everywhere else) */
- unsigned short _contrl[CNTRLMAX];
- short _intin[INTINMAX];
- short _intout[INTOUTMAX];
- short _ptsin[2 * PTSINMAX]; /* upto PTSINMAX vertices are allowed
- - currently 1024 */
- short _ptsout[2 * PTSOUTMAX]; /* likewise */
-
- /*
- * aes binding arrays - we need only global, other overlapped with
- * arrays for vdi - see common.h
- */
-
- /* vdi binding params */
- void *_vdiparams[5] = { (void *)&_contrl[0],
- (void *)&_intin[0],
- (void *)&_ptsin[0],
- (void *)&_intout[0],
- (void *)&_ptsout[0] };
-
-
- /*
- * the common interface to vdi
- * void __vdi__(coded contrl, handle);
- * unsigned long coded contrl;
- * int handle;
- * coded contrl:
- * DD BB CC AA
- * DD : subfunc (_contrl[5]) 5 bits
- * BB : nvert. _ptsin (_contrl[1]) 11 (== # vertices, size = 2 * CC)
- * CC : sizeof _intin (_contrl[3]) 8 bits
- * AA : vdi opcode (_contrl[0]) 8
- *
- * output : void (because it is so inconsistent, individual binding funcs
- * will pull info out of the appro. binding arrays)
- */
-
- void __vdi__(unsigned long coded_contrl, int handle)
- {
- /* decode contrl */
- _contrl[0] = (unsigned short)(coded_contrl & 0xff);
- _contrl[3] = (unsigned short)((coded_contrl >>= 8) & 0xff);
- _contrl[1] = (unsigned short)((coded_contrl >>= 8) & 0x7ff);
- _contrl[5] = (unsigned short)(coded_contrl >> 11);
-
- _contrl[6] = handle;
-
- /* call vdi */
- __asm__ volatile
- (" movl %0, d1
- movq #0x73, d0
- trap #2"
- : /* no outputs */
- : "g"(&_vdiparams[0]) /* inputs */
- : "d0", "d1", "d2", "a0", "a1", "a2" /* clobbered regs */
- );
- }
-
- void vdi(void)
- {
- __asm__ volatile
- (" movl %0, d1
- movq #0x73, d0
- trap #2"
- : /* no outputs */
- : "g"(&_vdiparams[0]) /* inputs */
- : "d0", "d1", "d2", "a0", "a1", "a2" /* clobbered regs */
- );
- }
- /* -eof- */
-
-