--- a/src/ast_vgatool.h	Wed Nov 12 12:43:18 2014
+++ b/src/ast_vgatool.h	Wed Nov 12 12:48:31 2014
@@ -86,33 +86,30 @@
 #define GetIndexReg(off, index, val)   do {                            \
                        struct vis_io_reg   io_reg = {                  \
                               .offset = off,                           \
-                              .value = index                           \
+                              .value = index,                          \
+                              .offset1 = off+1                         \
                        };                                              \
-                       ioctl(pAST->fd, VIS_SETIOREG, &io_reg);         \
-                       io_reg.offset = off+1;                          \
-                       ioctl(pAST->fd, VIS_GETIOREG, &io_reg);         \
+		       ioctl(pAST->fd, AST_GET_INDEX, &io_reg);        \
                        val = io_reg.value;                             \
                        } while (0)
 
 #define SetIndexReg(off, index, val) do {                              \
                        struct vis_io_reg   io_reg = {                  \
-                             .offset = off,                           \
-                              .value = index                           \
+                              .offset = off,                           \
+                              .value = index,                          \
+                              .offset1 = off+1,			       \
+                              .value1 = val			       \
                        };                                              \
-                       ioctl(pAST->fd, VIS_SETIOREG, &io_reg);         \
-                       io_reg.offset = off+1;                          \
-                       io_reg.value = val;                             \
-                       ioctl(pAST->fd, VIS_SETIOREG, &io_reg);         \
+                       ioctl(pAST->fd, AST_SET_INDEX, &io_reg);        \
                        } while (0)
 
 #define GetIndexRegMask(off, index, and, val) do {                     \
                        struct vis_io_reg   io_reg = {                  \
                               .offset = off,                           \
-                              .value = index                           \
+                              .value = index,                          \
+                              .offset1 = off+1                         \
                        };                                              \
-                       ioctl(pAST->fd, VIS_SETIOREG, &io_reg);         \
-                       io_reg.offset = off+1;                          \
-                       ioctl(pAST->fd, VIS_GETIOREG, &io_reg);         \
+                       ioctl(pAST->fd, AST_GET_INDEX, &io_reg);        \
                        val = io_reg.value & and;                       \
                        } while (0)
 
@@ -120,18 +117,16 @@
                        UCHAR __Temp;                                   \
                        struct vis_io_reg   io_reg = {                  \
                               .offset = off,                           \
-                              .value = index                           \
+                              .value = index,                          \
+                              .offset1 = off+1                         \
                        };                                              \
-                       ioctl(pAST->fd, VIS_SETIOREG, &io_reg);         \
-                       io_reg.offset = off + 1;                        \
-                       ioctl(pAST->fd, VIS_GETIOREG, &io_reg);         \
+		       ioctl(pAST->fd, AST_GET_INDEX, &io_reg);        \
                        __Temp = (io_reg.value & and) | val;            \
                        io_reg.offset = off;                            \
                        io_reg.value = index;                           \
-                       ioctl(pAST->fd, VIS_SETIOREG, &io_reg);         \
-                       io_reg.offset = off+1;                          \
-                       io_reg.value = __Temp;                          \
-                       ioctl(pAST->fd, VIS_SETIOREG, &io_reg);         \
+		       io_reg.offset1 = off+1;                         \
+                       io_reg.value1 = __Temp;                         \
+                       ioctl(pAST->fd, AST_SET_INDEX, &io_reg);        \
                        } while (0)
 
 #else /* !__sparc__ */
--- a/src/ast.h	Wed Nov 12 12:42:27 2014
+++ b/src/ast.h	Wed Nov 12 12:43:02 2014
@@ -376,9 +376,19 @@
 #define VIS_SETIOREG                    (VIOC | 17)
 #define VIS_GETIOREG                    (VIOC | 18)
 
+#ifdef __sparc
+#define ASTIOC                  ('Y' << 8)
+#define AST_GET_INDEX          (ASTIOC | 14)
+#define AST_SET_INDEX          (ASTIOC | 15)
+#endif
+
 typedef struct vis_io_reg {
         uchar_t         offset;
         uchar_t         value;
+#ifdef __sparc
+        uchar_t         offset1;
+        uchar_t         value1;
+#endif
 } vis_io_reg_t;
 #endif
 
