misc changes
authorBill Joy <wnj@ucbvax.Berkeley.EDU>
Fri, 30 Oct 1981 12:52:04 +0000 (04:52 -0800)
committerBill Joy <wnj@ucbvax.Berkeley.EDU>
Fri, 30 Oct 1981 12:52:04 +0000 (04:52 -0800)
SCCS-vsn: sys/sys/mbuf.h 4.2
SCCS-vsn: sys/sys/socket.h 4.2
SCCS-vsn: sys/vax/uba/ubareg.h 4.23
SCCS-vsn: sys/vax/uba/ubavar.h 4.20

usr/src/sys/sys/mbuf.h
usr/src/sys/sys/socket.h
usr/src/sys/vax/uba/ubareg.h
usr/src/sys/vax/uba/ubavar.h

index d18dda1..875f87d 100644 (file)
@@ -1,4 +1,4 @@
-/* mbuf.h 4.1 81/10/29 */
+/* mbuf.h 4.2 81/10/29 */
 
 /*
  * Constants related to memory allocator.
 
 /*
  * Constants related to memory allocator.
@@ -40,34 +40,38 @@ char        mprefcnt[NMPAGES];
 struct mbuf *m_get(), *m_free(), *m_more();
 
 #define        MGET(m, i) \
 struct mbuf *m_get(), *m_free(), *m_more();
 
 #define        MGET(m, i) \
-       { int ms = spl_imp(); \
+       { int ms = splimp(); \
          if ((m)=mfree) \
          if ((m)=mfree) \
-               { netcb.n_bufs--; mfree = (m)->m_next; (m)->m_next = 0; } \
+               { mbstat.m_bufs--; mfree = (m)->m_next; (m)->m_next = 0; } \
          else \
                (m) = m_more(i); \
          splx(ms); }
 #define        MPGET(m, i) \
          else \
                (m) = m_more(i); \
          splx(ms); }
 #define        MPGET(m, i) \
-       { int ms = spl_imp(); \
+       { int ms = splimp(); \
          if ((m)=mpfree) \
              { ++mprefcnt[mtopf(m)]; nmpfree--; mpfree = (m)->m_next; } \
          splx(ms); }
 #define        MFREE(m, n) \
          if ((m)=mpfree) \
              { ++mprefcnt[mtopf(m)]; nmpfree--; mpfree = (m)->m_next; } \
          splx(ms); }
 #define        MFREE(m, n) \
-       { int ms = spl_imp(); \
+       { int ms = splimp(); \
          if ((m)->m_off > MSIZE) { \
                (n) = (struct mbuf *)(mtod(m, int)&~0x3ff); \
                if (--mprefcnt[mtopf(n)] == 0) \
                    { (n)->m_next = mpfree; mpfree = (n); nmpfree++; } \
          } \
          (n) = (m)->m_next; (m)->m_next = mfree; \
          if ((m)->m_off > MSIZE) { \
                (n) = (struct mbuf *)(mtod(m, int)&~0x3ff); \
                if (--mprefcnt[mtopf(n)] == 0) \
                    { (n)->m_next = mpfree; mpfree = (n); nmpfree++; } \
          } \
          (n) = (m)->m_next; (m)->m_next = mfree; \
-         (m)->m_off = 0; (m)->m_act = 0; mfree = (m); netcb.n_bufs++; \
+         (m)->m_off = 0; (m)->m_act = 0; mfree = (m); mbstat.m_bufs++; \
          splx(ms); }
 #define        NMBPG (PGSIZE/MSIZE)            /* mbufs/page */
 
          splx(ms); }
 #define        NMBPG (PGSIZE/MSIZE)            /* mbufs/page */
 
+struct mbstat {
+       short   m_bufs;                         /* # free msg buffers */
+       short   m_hiwat;                        /* # free mbufs allocated */
+       short   m_lowat;                        /* min. # free mbufs */
+       short   m_pages;                        /* # pages owned by network */
+};
+
 #ifdef KERNEL
 extern struct mbuf netutl[];           /* virtual address of net free mem */
 extern struct pte Netmap[];            /* page tables to map Netutl */
 #ifdef KERNEL
 extern struct mbuf netutl[];           /* virtual address of net free mem */
 extern struct pte Netmap[];            /* page tables to map Netutl */
+struct mbstat mbstat;
 #endif
 #endif
-       short   n_bufs;                         /* # free msg buffers */
-       short   n_hiwat;                        /* # free mbufs allocated */
-       short   n_lowat;                        /* min. # free mbufs */
-       short   n_pages;                        /* # pages owned by network */
index b834fe0..e7b3791 100644 (file)
@@ -1,4 +1,4 @@
-/* socket.h 4.1 81/10/29 */
+/* socket.h 4.2 81/10/29 */
 
 /*
  * User connection block
 
 /*
  * User connection block
index ab28c7b..603e05c 100644 (file)
@@ -1,4 +1,4 @@
-/*     ubareg.h        4.22    81/04/03        */
+/*     ubareg.h        4.23    81/10/29        */
 
 /*
  * VAX UNIBUS adapter registers
 
 /*
  * VAX UNIBUS adapter registers
@@ -77,12 +77,16 @@ struct uba_regs
 #define        UBADPR_DPF      0x20000000      /* DP function (RO) */
 #define        UBADPR_BS       0x007f0000      /* buffer state field */
 #define        UBADPR_BUBA     0x0000ffff      /* buffered UNIBUS address */
 #define        UBADPR_DPF      0x20000000      /* DP function (RO) */
 #define        UBADPR_BS       0x007f0000      /* buffer state field */
 #define        UBADPR_BUBA     0x0000ffff      /* buffered UNIBUS address */
+#define        UBA_PURGE780(uba, bdp) \
+    ((uba)->uba_dpr[bdp] |= UBADPR_BNE)
 #endif VAX780
 #if VAX750
 #define        UBADPR_ERROR    0x80000000      /* error occurred */
 #define        UBADPR_NXM      0x40000000      /* nxm from memory */
 #define        UBADPR_UCE      0x20000000      /* uncorrectable error */
 #define        UBADPR_PURGE    0x00000001      /* purge bdp */
 #endif VAX780
 #if VAX750
 #define        UBADPR_ERROR    0x80000000      /* error occurred */
 #define        UBADPR_NXM      0x40000000      /* nxm from memory */
 #define        UBADPR_UCE      0x20000000      /* uncorrectable error */
 #define        UBADPR_PURGE    0x00000001      /* purge bdp */
+#define        UBA_PURGE750(uba, bdp) \
+    ((uba)->uba_dpr[bdp] |= (UBADPR_PURGE|UBADPR_NXM|UBADPR_UCE))
 #endif VAX750
  
 /* uba_mr[] */
 #endif VAX750
  
 /* uba_mr[] */
index 0619211..307bed3 100644 (file)
@@ -1,4 +1,4 @@
-/*     ubavar.h        4.19    81/08/31        */
+/*     ubavar.h        4.20    81/10/29        */
 
 /*
  * This file contains definitions related to the kernel structures
 
 /*
  * This file contains definitions related to the kernel structures
@@ -136,9 +136,9 @@ struct uba_driver {
 /*
  * Flags to UBA map/bdp allocation routines
  */
 /*
  * Flags to UBA map/bdp allocation routines
  */
-#define        UBA_NEEDBDP     1               /* transfer needs a bdp */
-#define        UBA_CANTWAIT    2               /* don't block me */
-#define        UBA_NEED16      3               /* need 16 bit addresses only */
+#define        UBA_NEEDBDP     0x1             /* transfer needs a bdp */
+#define        UBA_CANTWAIT    0x2             /* don't block me */
+#define        UBA_NEED16      0x4             /* need 16 bit addresses only */
 
 #ifndef LOCORE
 #ifdef KERNEL
 
 #ifndef LOCORE
 #ifdef KERNEL