Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/vax/boot/boot Search for include files in new locat...



details:   https://anonhg.NetBSD.org/src/rev/1edaecd3c29a
branches:  trunk
changeset: 474177:1edaecd3c29a
user:      ragge <ragge%NetBSD.org@localhost>
date:      Wed Jun 30 18:19:26 1999 +0000

description:
Search for include files in new locations.

diffstat:

 sys/arch/vax/boot/boot/if_qe.c |  105 +++++++++++++++++++---------------------
 sys/arch/vax/boot/boot/ra.c    |   32 ++++-------
 sys/arch/vax/boot/boot/tmscp.c |   23 ++++----
 3 files changed, 74 insertions(+), 86 deletions(-)

diffs (truncated from 386 to 300 lines):

diff -r e4ff9a3e377b -r 1edaecd3c29a sys/arch/vax/boot/boot/if_qe.c
--- a/sys/arch/vax/boot/boot/if_qe.c    Wed Jun 30 18:14:26 1999 +0000
+++ b/sys/arch/vax/boot/boot/if_qe.c    Wed Jun 30 18:19:26 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_qe.c,v 1.1 1999/03/06 16:36:05 ragge Exp $ */
+/*     $NetBSD: if_qe.c,v 1.2 1999/06/30 18:19:26 ragge Exp $ */
 
 /*
  * Copyright (c) 1998 Roar Thronæs.  All rights reserved.
@@ -39,7 +39,7 @@
 
 #include <lib/libsa/netif.h>
 
-#include <if/if_qereg.h>
+#include <dev/qbus/if_qereg.h>
 
 int qe_probe(), qe_match(), qe_get(), qe_put();
 void qe_init(), qe_end();
@@ -62,7 +62,6 @@
 
 #define NRCV    1                      /* Receive descriptors          */
 #define NXMT    1                       /* Transmit descriptors         */
-#define NTOT    (NXMT + NRCV)
 
 #define QE_INTS        (QE_RCV_INT | QE_XMIT_INT)
 #define MAXPACKETSIZE  0x800            /* Because of (buggy) DEQNA */
@@ -75,7 +74,15 @@
 };
 
 static volatile struct qe_softc *sc;
-static volatile struct qedevice *addr;
+static int addr;
+
+#define QE_WCSR(csr, val) \
+        (*((volatile u_short *)(addr + (csr))) = (val))
+#define QE_RCSR(csr) \
+        *((volatile u_short *)(addr + (csr)))
+#define DELAY(x)                {volatile int i = x;while (--i);}
+#define LOWORD(x)       ((int)(x) & 0xffff)
+#define HIWORD(x)       (((int)(x) >> 16) & 0x3f)
 
 int
 qe_match(nif, machdep_hint)
@@ -110,22 +117,21 @@
                qm[i] = PG_V | i;
 
        /* XXX hardcoded addr */
-       addr = (struct qedevice *)(0x20000000 + (0774440 & 017777));
+       addr = (0x20000000 + (0774440 & 017777));
 
-       addr->qe_csr = QE_RESET;
-       addr->qe_csr &= ~QE_RESET;
-       for(i=0x10000; i; i--) ;
+       QE_WCSR(QE_CSR_CSR, QE_RESET);
+       QE_WCSR(QE_CSR_CSR, QE_RCSR(QE_CSR_CSR) & ~QE_RESET);
 
         for (i = 0; i < 6; i++) {
-                sc->setup_pkt[i][1] = addr->qe_sta_addr[i];
-                sc->setup_pkt[i+8][1] = addr->qe_sta_addr[i];
+                sc->setup_pkt[i][1] = QE_RCSR(i * 2);
+                sc->setup_pkt[i+8][1] = QE_RCSR(i * 2);
                sc->setup_pkt[i][2] = 0xff;
-                sc->setup_pkt[i+8][2] = addr->qe_sta_addr[i];
+                sc->setup_pkt[i+8][2] = QE_RCSR(i * 2);
                for (j=3; j < 8; j++) {
-                               sc->setup_pkt[i][j] = addr->qe_sta_addr[i];
-                       sc->setup_pkt[i+8][j] = addr->qe_sta_addr[i];
+                               sc->setup_pkt[i][j] = QE_RCSR(i * 2);
+                       sc->setup_pkt[i+8][j] = QE_RCSR(i * 2);
                }
-               desc->myea[i] = addr->qe_sta_addr[i];
+               desc->myea[i] = QE_RCSR(i * 2);
        }
 
        bzero((caddr_t)sc->rring, sizeof(struct qe_ring));
@@ -139,37 +145,31 @@
         sc->tring->qe_addr_hi = (short)((int)sc->setup_pkt >> 16);
 
         sc->rring[0].qe_flag = sc->rring[0].qe_status1 = QE_NOTYET;
-        sc->rring[0].qe_valid = 1;
+       sc->rring->qe_addr_hi |= QE_VALID;
 
-        sc->tring[0].qe_setup = 1;
-        sc->tring[0].qe_eomsg = 1;
         sc->tring[0].qe_flag = sc->tring[0].qe_status1 = QE_NOTYET;
-        sc->tring[0].qe_valid = 1;
+       sc->tring->qe_addr_hi |= QE_VALID | QE_SETUP | QE_EOMSG;
 
-       addr->qe_csr =  QE_XMIT_INT | QE_RCV_INT;
+       QE_WCSR(QE_CSR_CSR, QE_XMIT_INT | QE_RCV_INT);
 
-        addr->qe_rcvlist_lo = (short)((int)sc->rring & 0xffff);
-        addr->qe_rcvlist_hi = (short)((int)sc->rring >> 16);
-
-        addr->qe_xmtlist_lo = (short)((int)sc->tring & 0xffff);
-        addr->qe_xmtlist_hi = (short)((int)sc->tring >> 16);
+       QE_WCSR(QE_CSR_RCLL, LOWORD(sc->rring));
+       QE_WCSR(QE_CSR_RCLH, HIWORD(sc->rring));
+       QE_WCSR(QE_CSR_XMTL, LOWORD(sc->tring));
+       QE_WCSR(QE_CSR_XMTH, HIWORD(sc->tring));
 
-       while ((addr->qe_csr & QE_INTS) != QE_INTS)
+       while ((QE_RCSR(QE_CSR_CSR) & QE_INTS) != QE_INTS)
                ;
-       addr->qe_csr |= QE_INTS;
-
-       addr->qe_csr &= ~(QE_INT_ENABLE|QE_ELOOP);
-       addr->qe_csr |= QE_ILOOP;
+       QE_WCSR(QE_CSR_CSR, QE_RCSR(QE_CSR_CSR) | QE_INTS);
+       QE_WCSR(QE_CSR_CSR, QE_RCSR(QE_CSR_CSR) & ~(QE_INT_ENABLE|QE_ELOOP));
+       QE_WCSR(QE_CSR_CSR, QE_RCSR(QE_CSR_CSR) | QE_ILOOP);
 
         sc->rring[0].qe_addr_lo = (short)((int)sc->qein & 0xffff);
         sc->rring[0].qe_addr_hi = (short)((int)sc->qein >> 16);
-       sc->rring[0].qe_setup=0;
        sc->rring[0].qe_buf_len=-MAXPACKETSIZE/2;
-       sc->rring[0].qe_valid=1;
+       sc->rring[0].qe_addr_hi |= QE_VALID;
        sc->rring[0].qe_flag=sc->rring[0].qe_status1=QE_NOTYET;
        sc->rring[0].qe_status2=1;
 
-       sc->rring[1].qe_valid=0;
        sc->rring[1].qe_addr_lo = 0;
        sc->rring[1].qe_addr_hi = 0;
        sc->rring[1].qe_flag=sc->rring[1].qe_status1=QE_NOTYET;
@@ -177,20 +177,17 @@
 
         sc->tring[0].qe_addr_lo = (short)((int)sc->qeout & 0xffff);
         sc->tring[0].qe_addr_hi = (short)((int)sc->qeout >> 16);
-       sc->tring[0].qe_setup=0;
        sc->tring[0].qe_buf_len=0;
-       sc->tring[0].qe_eomsg=1;
        sc->tring[0].qe_flag=sc->tring[0].qe_status1=QE_NOTYET;
-       sc->tring[0].qe_valid=1;
+       sc->tring[0].qe_addr_hi |= QE_EOMSG|QE_VALID;
 
        sc->tring[1].qe_flag=sc->tring[1].qe_status1=QE_NOTYET;
-       sc->tring[1].qe_valid=0;
        sc->tring[1].qe_addr_lo = 0;
        sc->tring[1].qe_addr_hi = 0;
 
-        addr->qe_csr|=QE_RCV_ENABLE;
-        addr->qe_rcvlist_lo = (short)((int)sc->rring & 0xffff);
-        addr->qe_rcvlist_hi = (short)((int)sc->rring >> 16);
+       QE_WCSR(QE_CSR_CSR, QE_RCSR(QE_CSR_CSR) | QE_RCV_ENABLE);
+       QE_WCSR(QE_CSR_RCLL, LOWORD(sc->rring));
+       QE_WCSR(QE_CSR_RCLH, HIWORD(sc->rring));
 }
 
 int
@@ -203,13 +200,13 @@
        int len, j;
 
 retry:
-       for(j = 0x10000;j && (addr->qe_csr & QE_RCV_INT) == 0; j--)
+       for(j = 0x10000;j && (QE_RCSR(QE_CSR_CSR) & QE_RCV_INT) == 0; j--)
                ;
 
-       if ((addr->qe_csr & QE_RCV_INT) == 0)
+       if ((QE_RCSR(QE_CSR_CSR) & QE_RCV_INT) == 0)
                goto fail;
 
-       addr->qe_csr &= ~(QE_RCV_ENABLE|QE_XMIT_INT);
+       QE_WCSR(QE_CSR_CSR, QE_RCSR(QE_CSR_CSR) & ~(QE_RCV_ENABLE|QE_XMIT_INT));
 
        len= ((sc->rring[0].qe_status1 & QE_RBL_HI) |
            (sc->rring[0].qe_status2 & QE_RBL_LO)) + 60;
@@ -227,9 +224,10 @@
        sc->rring[0].qe_status2 = sc->rring[1].qe_status2 = 1;
        sc->rring[0].qe_flag=sc->rring[0].qe_status1=QE_NOTYET;
        sc->rring[1].qe_flag=sc->rring[1].qe_status1=QE_NOTYET;
-        addr->qe_csr |= QE_RCV_ENABLE;
-        addr->qe_rcvlist_lo = (short)((int)sc->rring);
-        addr->qe_rcvlist_hi = (short)((int)sc->rring >> 16);
+       QE_WCSR(QE_CSR_CSR, QE_RCSR(QE_CSR_CSR) | QE_RCV_ENABLE);
+
+       QE_WCSR(QE_CSR_RCLL, LOWORD(sc->rring));
+       QE_WCSR(QE_CSR_RCLH, HIWORD(sc->rring));
        return len;
 
 fail:  len = -1;
@@ -249,17 +247,17 @@
         sc->tring[0].qe_flag=sc->tring[0].qe_status1=QE_NOTYET;
         sc->tring[1].qe_flag=sc->tring[1].qe_status1=QE_NOTYET;
 
-        addr->qe_xmtlist_lo = (short)((int)sc->tring & 0xffff);
-        addr->qe_xmtlist_hi = (short)((int)sc->tring >> 16);
+       QE_WCSR(QE_CSR_XMTL, LOWORD(sc->tring));
+       QE_WCSR(QE_CSR_XMTH, HIWORD(sc->tring));
 
-       for(j = 0; (j < 0x10000) && ((addr->qe_csr & QE_XMIT_INT) == 0); j++)
+       for(j = 0; (j < 0x10000) && ((QE_RCSR(QE_CSR_CSR) & QE_XMIT_INT) == 0); j++)
                ;
 
-       if ((addr->qe_csr & QE_XMIT_INT) == 0) {
+       if ((QE_RCSR(QE_CSR_CSR) & QE_XMIT_INT) == 0) {
                qe_init(desc,0);
                return -1;
        }
-       addr->qe_csr &= ~QE_RCV_INT;
+       QE_WCSR(QE_CSR_CSR, QE_RCSR(QE_CSR_CSR) & ~QE_RCV_INT);
 
        if (sc->tring[0].qe_status1 & 0xc000) {
                qe_init(desc,0);
@@ -272,9 +270,6 @@
 qe_end(nif)
      struct netif *nif;
 {
-       int i;
-
-       addr->qe_csr = QE_RESET;
-       addr->qe_csr &= ~QE_RESET;
-       for(i=0x10000; i; i--) ;
+       QE_WCSR(QE_CSR_CSR, QE_RESET);
+       QE_WCSR(QE_CSR_CSR, QE_RCSR(QE_CSR_CSR) & ~QE_RESET);
 }
diff -r e4ff9a3e377b -r 1edaecd3c29a sys/arch/vax/boot/boot/ra.c
--- a/sys/arch/vax/boot/boot/ra.c       Wed Jun 30 18:14:26 1999 +0000
+++ b/sys/arch/vax/boot/boot/ra.c       Wed Jun 30 18:19:26 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ra.c,v 1.2 1999/04/01 20:40:07 ragge Exp $ */
+/*     $NetBSD: ra.c,v 1.3 1999/06/30 18:19:26 ragge Exp $ */
 /*
  * Copyright (c) 1995 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -40,14 +40,10 @@
 #include "lib/libsa/stand.h"
 
 #include "../include/pte.h"
-/*#include "../include/macros.h"*/
 #include "../include/sid.h"
 
-#include "../uba/ubareg.h"
-#include "../uba/udareg.h"
-
-#include "../mscp/mscp.h"
-#include "../mscp/mscpreg.h"
+#include "dev/mscp/mscp.h"
+#include "dev/mscp/mscpreg.h"
 
 #include "../bi/bireg.h"
 #include "../bi/kdbreg.h"
@@ -56,6 +52,8 @@
 
 static command(int);
 
+
+
 /*
  * These routines for RA disk standalone boot is wery simple,
  * assuming a lots of thing like that we only working at one ra disk
@@ -81,7 +79,6 @@
 } uda;
 
 volatile struct uda *ubauda;
-volatile struct udadevice *udacsr;
 struct disklabel ralabel;
 struct ra_softc ra_softc;
 char io_buf[MAXBSIZE];
@@ -93,10 +90,9 @@
        char *msg;
        struct disklabel *lp = &ralabel;
        volatile struct ra_softc *ra = &ra_softc;
-       volatile struct uba_regs *mr = (void *)ubaaddr[adapt];
        volatile u_int *nisse;
        unsigned short johan, johan2;
-       int i,err;
+       int i,err, udacsr;
 
 #ifdef DEV_DEBUG
        printf("raopen: adapter %d ctlr %d unit %d part %d\n", 
@@ -110,17 +106,17 @@
                        return(EADAPT);
                if (ctlr > nuda)
                        return(ECTLR);
-               nisse = (u_int *)&mr->uba_map[0];
+               nisse = ((u_int *)ubaaddr[adapt]) + 512;
                nisse[494] = PG_V | (((u_int)&uda) >> 9);
                nisse[495] = nisse[494] + 1;
-               udacsr = (void*)uioaddr[adapt] + udaaddr[ctlr];
+               udacsr = (int)uioaddr[adapt] + udaaddr[ctlr];
                ubauda = (void*)0x3dc00 + (((u_int)(&uda))&0x1ff);
                johan = (((u_int)ubauda) & 0xffff) + 8;
                johan2 = 3;
-               ra->ra_ip = (short *)&udacsr->udaip;
-               ra->ra_sa = ra->ra_sw = (short *)&udacsr->udasa;
+               ra->ra_ip = (short *)udacsr;
+               ra->ra_sa = ra->ra_sw = (short *)udacsr + 1;
                ra->udaddr = uioaddr[adapt] + udaaddr[ctlr];
-               ra->ubaddr = (int)mr;
+               ra->ubaddr = (int)ubaaddr[adapt];
                *ra->ra_ip = 0; /* Start init */
        } else {
                struct bi_node *bi = (void *)biaddr[adapt];
@@ -221,17 +217,13 @@
        char    *buf;
        u_int   size, *rsize;
 {
-       volatile struct uba_regs *ur;
-       volatile struct udadevice *udadev;



Home | Main Index | Thread Index | Old Index