Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/microcode/siop - handle INTFLY (interrupt on the fly...



details:   https://anonhg.NetBSD.org/src/rev/e46fbd7869b1
branches:  trunk
changeset: 525931:e46fbd7869b1
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sun Apr 21 22:40:10 2002 +0000

description:
- handle INTFLY (interrupt on the fly) command
- hanlde set/clear carry
- handle shl, shr (shift left and rigth) and xor operators

diffstat:

 sys/dev/microcode/siop/ncr53cxxx.c |  91 ++++++++++++++++++++++++++++---------
 1 files changed, 68 insertions(+), 23 deletions(-)

diffs (166 lines):

diff -r 33c057b3a3dc -r e46fbd7869b1 sys/dev/microcode/siop/ncr53cxxx.c
--- a/sys/dev/microcode/siop/ncr53cxxx.c        Sun Apr 21 22:05:45 2002 +0000
+++ b/sys/dev/microcode/siop/ncr53cxxx.c        Sun Apr 21 22:40:10 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ncr53cxxx.c,v 1.9 2002/04/20 20:56:25 bouyer Exp $     */
+/*     $NetBSD: ncr53cxxx.c,v 1.10 2002/04/21 22:40:10 bouyer Exp $    */
 
 /*
  * Copyright (c) 1995,1999 Michael L. Hitch
@@ -61,6 +61,7 @@
 void   f_call (void);
 void   f_return (void);
 void   f_int (void);
+void   f_intfly (void);
 void   f_select (void);
 void   f_reselect (void);
 void   f_wait (void);
@@ -88,6 +89,7 @@
        {"CALL",        f_call},
        {"RETURN",      f_return},
        {"INT",         f_int},
+       {"INTFLY",      f_intfly},
        {"SELECT",      f_select},
        {"RESELECT",    f_reselect},
        {"WAIT",        f_wait},
@@ -412,7 +414,7 @@
        if (outfp) {
                time_t cur_time;
 
-               fprintf(outfp, "/*\t$NetBSD: ncr53cxxx.c,v 1.9 2002/04/20 20:56:25 bouyer Exp $\t*/\n");
+               fprintf(outfp, "/*\t$NetBSD: ncr53cxxx.c,v 1.10 2002/04/21 22:40:10 bouyer Exp $\t*/\n");
                fprintf(outfp, "/*\n");
                fprintf(outfp, " *\tDO NOT EDIT - this file is automatically generated.\n");
                time(&cur_time);
@@ -997,6 +999,11 @@
        transfer (0x98000000, 2);
 }
 
+void   f_intfly (void)
+{
+       transfer (0x98100000, 2);
+}
+
 void   f_select (void)
 {
        int     t = tokenix;
@@ -1270,8 +1277,12 @@
                        inst0 |= 0x0200;
                        ++i;
                }
+               else if (reserved ("carry", i)) {
+                       inst0 |= 0x0400;
+                       ++i;
+               }
                else
-                       errout ("Expected ATN, ACK, or TARGET");
+                       errout ("Expected ATN, ACK, TARGET or CARRY");
                need_and = 1;
        }
        store_inst ();
@@ -1323,8 +1334,14 @@
 
        if (reserved ("to", tokenix+1))
                op = 0;
+       else if (reserved ("shl", tokenix+1))
+               op = 1;
+       else if (reserved ("shr", tokenix+1))
+               op = 5;
        else if (tokens[tokenix+1].type == '|')
                op = 2;
+       else if (reserved ("xor", tokenix+1))
+               op = 3;
        else if (tokens[tokenix+1].type == '&')
                op = 4;
        else if (tokens[tokenix+1].type == '+')
@@ -1333,8 +1350,16 @@
                op = 8;
        else
                errout ("Unknown register operator");
-       if (op && reserved ("to", tokenix+3) == 0)
-               errout ("Register command expected TO");
+       switch (op) {
+       case 2:
+       case 3:
+       case 4:
+       case 6:
+       case 8:
+               if (reserved ("to", tokenix+3) == 0)
+                       errout ("Register command expected TO");
+       default:
+       }
        reg = CheckRegister (tokenix);
        if (reg < 0) {                  /* Not register, must be data */
                data = evaluate (tokenix);
@@ -1347,24 +1372,45 @@
 #if 0
 fprintf (listfp, "Move data to register: %02x %d\n", data, reg);
 #endif
-       }
-       else if (op) {                  /* A register read/write operator */
-               data = evaluate (tokenix+2);
-               if (tokenix+5 < ntokens) {
-                       if (!reserved("with", tokenix+5) ||
-                           !reserved("carry", tokenix+6)) {
-                               errout("Expected 'WITH CARRY'");
-                       } else if (op != 6) {
-                               errout("'WITH CARRY' only valide with '+'");
+       } else if (op) {
+               switch (op) {
+               case 2:
+               case 3:
+               case 4:
+               case 6:
+               case 8:
+                       inst0 = 0;
+                       /* A register read/write operator */
+                       if (reserved("sfbr", tokenix+2)) {
+                               if (arch < ARCH825)
+                                       errout("wrong arch for add with SFBR");
+                               if (op == 8)
+                                       errout("can't substract SFBR");
+                               inst0 |= 0x00800000;
+                               data = 0;
+                       } else
+                               data = evaluate (tokenix+2);
+                       if (tokenix+5 < ntokens) {
+                               if (!reserved("with", tokenix+5) ||
+                                   !reserved("carry", tokenix+6)) {
+                                       errout("Expected 'WITH CARRY'");
+                               } else if (op != 6) {
+                                       errout("'WITH CARRY' only valide "
+                                           "with '+'");
+                               }
+                               op = 7;
                        }
-                       op = 7;
+                       if (op == 8) {
+                               data = -data;
+                               op = 6;
+                       }
+                       inst0 |= (data & 0xff) << 8;
+                       data = CheckRegister (tokenix+4);
+                       break;
+               default:
+                       data = CheckRegister (tokenix+2);
+                       break;
                }
-               if (op == 8) {
-                       data = -data;
-                       op = 6;
-               }
-               inst0 = (data & 0xff) << 8;
-               data = CheckRegister (tokenix+4);
                if (data < 0)
                        errout ("Expected register");
                if (reg != data && reg != 8 && data != 8)
@@ -1389,8 +1435,7 @@
                                inst0 |= 0x70000000 | (op << 24) | (reg << 16);
                        }
                }
-       }
-       else {                          /* register to register */
+       } else {                                /* register to register */
                data = CheckRegister (tokenix+2);
                if (data < 0)
                        errout ("Expected register");



Home | Main Index | Thread Index | Old Index