Index: sys/dev/wscons/wsdisplayvar.h
===================================================================
RCS file: /cvsroot/src/sys/dev/wscons/wsdisplayvar.h,v
retrieving revision 1.53
diff -p -u -r1.53 wsdisplayvar.h
--- sys/dev/wscons/wsdisplayvar.h       26 Sep 2018 09:04:12 -0000      1.53
+++ sys/dev/wscons/wsdisplayvar.h       4 Dec 2018 09:14:05 -0000
@@ -83,6 +83,12 @@ struct wsdisplay_emulops {
#define WSATTR_BLINK   4
#define WSATTR_UNDERLINE 8
#define WSATTR_WSCOLORS 16
+#define WSATTR_USERMASK 0x0fff
+/* private flags used by the driver */
+#define WSATTR_PRIVATE1  4096
+#define WSATTR_PRIVATE2  8192
+#define WSATTR_PRIVATE3 16384
+#define WSATTR_PRIVATE4 32768
       /* XXX need a free_attr() ??? */
       void    (*replaceattr)(void *, long, long);
};
Index: sys/dev/rasops/rasops.c
===================================================================
RCS file: /cvsroot/src/sys/dev/rasops/rasops.c,v
retrieving revision 1.78
diff -p -u -r1.78 rasops.c
--- sys/dev/rasops/rasops.c     29 Nov 2018 23:44:50 -0000      1.78
+++ sys/dev/rasops/rasops.c     4 Dec 2018 09:14:05 -0000
@@ -570,13 +570,13 @@ rasops_allocattr_color(void *cookie, int
       if ((flg & WSATTR_HILIT) != 0)
               fg += 8;

-       flg = ((flg & WSATTR_UNDERLINE) ? 1 : 0);
+       flg = flg & WSATTR_USERMASK;

       if (rasops_isgray[fg])
-               flg |= 2;
+               flg |= WSATTR_PRIVATE1;

       if (rasops_isgray[bg])
-               flg |= 4;
+               flg |= WSATTR_PRIVATE2;

       *attr = (bg << 16) | (fg << 24) | flg;
       return (0);
@@ -903,7 +903,7 @@ rasops_unpack_attr(long attr, int *fg, i
       *fg = ((u_int)attr >> 24) & 0xf;
       *bg = ((u_int)attr >> 16) & 0xf;
       if (underline != NULL)
-               *underline = (u_int)attr & 1;
+               *underline = (u_int)attr & WSATTR_UNDERLINE;
}

/*
@@ -1366,7 +1366,7 @@ rasops_putchar_rotated_cw(void *cookie,

       /* Do rotated char sans (side)underline */
       ri->ri_real_ops.putchar(cookie, col, ri->ri_rows - row - 1, uc,
-           attr & ~1);
+           attr & ~WSATTR_UNDERLINE);

       /* Do rotated underline */
       rp = ri->ri_bits + col * ri->ri_yscale + (ri->ri_rows - row - 1) *
@@ -1374,7 +1374,7 @@ rasops_putchar_rotated_cw(void *cookie,
       height = ri->ri_font->fontheight;

       /* XXX this assumes 16-bit color depth */
-       if ((attr & 1) != 0) {
+       if ((attr & WSATTR_UNDERLINE) != 0) {
               int16_t c = (int16_t)ri->ri_devcmap[((u_int)attr >> 24) & 0xf];

               while (height--) {
@@ -1493,7 +1493,7 @@ rasops_putchar_rotated_ccw(void *cookie,

       /* Do rotated char sans (side)underline */
       ri->ri_real_ops.putchar(cookie, ri->ri_cols - col - 1, row, uc,
-           attr & ~1);
+           attr & ~WSATTR_UNDERLINE);

       /* Do rotated underline */
       rp = ri->ri_bits + (ri->ri_cols - col - 1) * ri->ri_yscale +
@@ -1502,7 +1502,7 @@ rasops_putchar_rotated_ccw(void *cookie,
       height = ri->ri_font->fontheight;

       /* XXX this assumes 16-bit color depth */
-       if ((attr & 1) != 0) {
+       if ((attr & WSATTR_UNDERLINE) != 0) {
               int16_t c = (int16_t)ri->ri_devcmap[((u_int)attr >> 24) & 0xf];

               while (height--) {
Index: sys/dev/rasops/rasops1.c
===================================================================
RCS file: /cvsroot/src/sys/dev/rasops/rasops1.c,v
retrieving revision 1.23
diff -p -u -r1.23 rasops1.c
--- sys/dev/rasops/rasops1.c    4 May 2010 04:57:34 -0000       1.23
+++ sys/dev/rasops/rasops1.c    4 Dec 2018 09:14:05 -0000
@@ -180,7 +180,7 @@ rasops1_putchar(void *cookie, int row, i
               }

               /* Do underline */
-               if ((attr & 1) != 0) {
+               if ((attr & WSATTR_UNDERLINE) != 0) {
                       DELTA(rp, -(ri->ri_stride << 1), int32_t *);
                       tmp = (*rp & lmask) | (fg & rmask);
                       *rp = tmp;
@@ -257,7 +257,7 @@ rasops1_putchar(void *cookie, int row, i
               }

               /* Do underline */
-               if ((attr & 1) != 0) {
+               if ((attr & WSATTR_UNDERLINE) != 0) {
                       DELTA(rp, -(ri->ri_stride << 1), int32_t *);
                       tmp = (rp[0] & lmask) | (fg & ~lmask);
                       tmp2 = (rp[1] & rmask) | (fg & ~rmask);
@@ -344,7 +344,7 @@ rasops1_putchar8(void *cookie, int row,
       }

       /* Do underline */
-       if ((attr & 1) != 0) {
+       if ((attr & WSATTR_UNDERLINE) != 0) {
               rp[-(ri->ri_stride << 1)] = fg;
               if (ri->ri_hwbits) {
                       hrp[-(ri->ri_stride << 1)] = fg;
@@ -426,7 +426,7 @@ rasops1_putchar16(void *cookie, int row,
       }

       /* Do underline */
-       if ((attr & 1) != 0) {
+       if ((attr & WSATTR_UNDERLINE) != 0) {
               /* XXX alignment?! */
               *(int16_t *)(rp - (ri->ri_stride << 1)) = fg;
               if (ri->ri_hwbits) {
Index: sys/dev/rasops/rasops15.c
===================================================================
RCS file: /cvsroot/src/sys/dev/rasops/rasops15.c,v
retrieving revision 1.21
diff -p -u -r1.21 rasops15.c
--- sys/dev/rasops/rasops15.c   25 Jan 2017 14:53:43 -0000      1.21
+++ sys/dev/rasops/rasops15.c   4 Dec 2018 09:14:05 -0000
@@ -191,7 +191,7 @@ rasops15_putchar(void *cookie, int row,
       }

       /* Do underline */
-       if ((attr & 1) != 0) {
+       if ((attr & WSATTR_UNDERLINE) != 0) {
               int16_t c = (int16_t)clr[1];
               rp -= ri->ri_stride << 1;
               if (ri->ri_hwbits)
@@ -292,7 +292,7 @@ rasops15_putchar_aa(void *cookie, int ro
       }

       /* Do underline */
-       if ((attr & 1) != 0) {
+       if ((attr & WSATTR_UNDERLINE) != 0) {
               rp = (uint16_t *)rrp;
               DELTA(rp, (ri->ri_stride * (height - 2)), int16_t *);
               while (width--)
@@ -412,7 +412,7 @@ rasops15_putchar8(void *cookie, int row,
       }

       /* Do underline */
-       if ((attr & 1) != 0) {
+       if ((attr & WSATTR_UNDERLINE) != 0) {
               int32_t c = STAMP_READ(28);

               DELTA(rp, -(ri->ri_stride << 1), int32_t *);
@@ -518,7 +518,7 @@ rasops15_putchar12(void *cookie, int row
       }

       /* Do underline */
-       if (attr & 1) {
+       if (attr & WSATTR_UNDERLINE) {
               int32_t c = STAMP_READ(28);

               DELTA(rp, -(ri->ri_stride << 1), int32_t *);
@@ -633,7 +633,7 @@ rasops15_putchar16(void *cookie, int row
       }

       /* Do underline */
-       if (attr & 1) {
+       if (attr & WSATTR_UNDERLINE) {
               int32_t c = STAMP_READ(28);

               DELTA(rp, -(ri->ri_stride << 1), int32_t *);
Index: sys/dev/rasops/rasops2.c
===================================================================
RCS file: /cvsroot/src/sys/dev/rasops/rasops2.c,v
retrieving revision 1.18
diff -p -u -r1.18 rasops2.c
--- sys/dev/rasops/rasops2.c    21 Apr 2013 04:28:05 -0000      1.18
+++ sys/dev/rasops/rasops2.c    4 Dec 2018 09:14:05 -0000
@@ -159,7 +159,7 @@ rasops2_putchar(void *cookie, int row, i
               }

               /* Do underline */
-               if (attr & 1) {
+               if (attr & WSATTR_UNDERLINE) {
                       DELTA(rp, -(ri->ri_stride << 1), int32_t *);
                       *rp = (*rp & lmask) | (fg & rmask);
               }
@@ -196,7 +196,7 @@ rasops2_putchar(void *cookie, int row, i
               }

               /* Do underline */
-               if (attr & 1) {
+               if (attr & WSATTR_UNDERLINE) {
                       DELTA(rp, -(ri->ri_stride << 1), int32_t *);
                       rp[0] = (rp[0] & lmask) | (fg & ~lmask);
                       rp[1] = (rp[1] & rmask) | (fg & ~rmask);
@@ -309,7 +309,7 @@ rasops2_putchar8(void *cookie, int row,
       }

       /* Do underline */
-       if ((attr & 1) != 0)
+       if ((attr & WSATTR_UNDERLINE) != 0)
               *(int16_t *)(rp - (ri->ri_stride << 1)) = stamp[15];

       stamp_mutex--;
@@ -375,7 +375,7 @@ rasops2_putchar12(void *cookie, int row,
       }

       /* Do underline */
-       if ((attr & 1) != 0) {
+       if ((attr & WSATTR_UNDERLINE) != 0) {
               rp -= ri->ri_stride << 1;
               rp[0] = rp[1] = rp[2] = stamp[15];
       }
@@ -444,7 +444,7 @@ rasops2_putchar16(void *cookie, int row,
       }

       /* Do underline */
-       if ((attr & 1) != 0)
+       if ((attr & WSATTR_UNDERLINE) != 0)
               *(int32_t *)(rp - (ri->ri_stride << 1)) = stamp[15];

       stamp_mutex--;
Index: sys/dev/rasops/rasops24.c
===================================================================
RCS file: /cvsroot/src/sys/dev/rasops/rasops24.c,v
retrieving revision 1.29
diff -p -u -r1.29 rasops24.c
--- sys/dev/rasops/rasops24.c   25 Jul 2011 18:02:47 -0000      1.29
+++ sys/dev/rasops/rasops24.c   4 Dec 2018 09:14:05 -0000
@@ -178,7 +178,7 @@ rasops24_putchar(void *cookie, int row,
       }

       /* Do underline */
-       if ((attr & 1) != 0) {
+       if ((attr & WSATTR_UNDERLINE) != 0) {
               u_char c = clr[1];

               rp -= ri->ri_stride << 1;
@@ -299,7 +299,7 @@ rasops24_putchar8(void *cookie, int row,
       }

       /* Do underline */
-       if ((attr & 1) != 0) {
+       if ((attr & WSATTR_UNDERLINE) != 0) {
               int32_t c = STAMP_READ(52);

               DELTA(rp, -(ri->ri_stride << 1), int32_t *);
@@ -381,7 +381,7 @@ rasops24_putchar12(void *cookie, int row
       }

       /* Do underline */
-       if ((attr & 1) != 0) {
+       if ((attr & WSATTR_UNDERLINE) != 0) {
               int32_t c = STAMP_READ(52);

               DELTA(rp, -(ri->ri_stride << 1), int32_t *);
@@ -470,7 +470,7 @@ rasops24_putchar16(void *cookie, int row
       }

       /* Do underline */
-       if ((attr & 1) != 0) {
+       if ((attr & WSATTR_UNDERLINE) != 0) {
               int32_t c = STAMP_READ(52);

               DELTA(rp, -(ri->ri_stride << 1), int32_t *);
@@ -497,7 +497,7 @@ rasops24_eraserows(void *cookie, int row
        * If the color is gray, we can cheat and use the generic routines
        * (which are faster, hopefully) since the r,g,b values are the same.
        */
-       if ((attr & 4) != 0) {
+       if ((attr & WSATTR_PRIVATE2) != 0) {
               rasops_eraserows(cookie, row, num, attr);
               return;
       }
@@ -599,7 +599,7 @@ rasops24_erasecols(void *cookie, int row
        * If the color is gray, we can cheat and use the generic routines
        * (which are faster, hopefully) since the r,g,b values are the same.
        */
-       if ((attr & 4) != 0) {
+       if ((attr & WSATTR_PRIVATE2) != 0) {
               rasops_erasecols(cookie, row, col, num, attr);
               return;
       }
Index: sys/dev/rasops/rasops4.c
===================================================================
RCS file: /cvsroot/src/sys/dev/rasops/rasops4.c,v
retrieving revision 1.11
diff -p -u -r1.11 rasops4.c
--- sys/dev/rasops/rasops4.c    21 Apr 2013 04:28:05 -0000      1.11
+++ sys/dev/rasops/rasops4.c    4 Dec 2018 09:14:05 -0000
@@ -159,7 +159,7 @@ rasops4_putchar(void *cookie, int row, i
               }

               /* Do underline */
-               if (attr & 1) {
+               if (attr & WS_UNDERLINE) {
                       DELTA(rp, -(ri->ri_stride << 1), int32_t *);
                       *rp = (*rp & lmask) | (fg & rmask);
               }
@@ -196,7 +196,7 @@ rasops4_putchar(void *cookie, int row, i
               }

               /* Do underline */
-               if (attr & 1) {
+               if (attr & WS_UNDERLINE) {
                       DELTA(rp, -(ri->ri_stride << 1), int32_t *);
                       rp[0] = (rp[0] & lmask) | (fg & ~lmask);
                       rp[1] = (rp[1] & rmask) | (fg & ~rmask);
@@ -311,7 +311,7 @@ rasops4_putchar8(void *cookie, int row,
       }

       /* Do underline */
-       if ((attr & 1) != 0) {
+       if ((attr & WS_UNDERLINE) != 0) {
               rp -= (rs << 1);
               rp[0] = stamp[15];
               rp[1] = stamp[15];
@@ -383,7 +383,7 @@ rasops4_putchar12(void *cookie, int row,
       }

       /* Do underline */
-       if ((attr & 1) != 0) {
+       if ((attr & WS_UNDERLINE) != 0) {
               rp -= (rs << 1);
               rp[0] = stamp[15];
               rp[1] = stamp[15];
@@ -458,7 +458,7 @@ rasops4_putchar16(void *cookie, int row,
       }

       /* Do underline */
-       if ((attr & 1) != 0) {
+       if ((attr & WS_UNDERLINE) != 0) {
               rp -= (rs << 1);
               rp[0] = stamp[15];
               rp[1] = stamp[15];
Index: sys/dev/rasops/rasops8.c
===================================================================
RCS file: /cvsroot/src/sys/dev/rasops/rasops8.c,v
retrieving revision 1.34
diff -p -u -r1.34 rasops8.c
--- sys/dev/rasops/rasops8.c    15 Sep 2013 09:41:55 -0000      1.34
+++ sys/dev/rasops/rasops8.c    4 Dec 2018 09:14:05 -0000
@@ -175,7 +175,7 @@ rasops8_putchar(void *cookie, int row, i
       }

       /* Do underline */
-       if ((attr & 1) != 0) {
+       if ((attr & WSATTR_UNDERLINE) != 0) {
               u_char c = clr[1];

               rp -= (ri->ri_stride << 1);
@@ -278,7 +278,7 @@ rasops8_putchar_aa(void *cookie, int row
       }

       /* Do underline */
-       if ((attr & 1) != 0) {
+       if ((attr & WSATTR_UNDERLINE) != 0) {

               rp -= (ri->ri_stride << 1);
               if (ri->ri_hwbits)
@@ -406,7 +406,7 @@ rasops8_putchar8(void *cookie, int row,
       }

       /* Do underline */
-       if ((attr & 1) != 0) {
+       if ((attr & WSATTR_UNDERLINE) != 0) {
               DELTA(rp, -(ri->ri_stride << 1), int32_t *);
               rp[0] = rp[1] = stamp[15];
               if (ri->ri_hwbits) {
@@ -500,7 +500,7 @@ rasops8_putchar12(void *cookie, int row,
       }

       /* Do underline */
-       if ((attr & 1) != 0) {
+       if ((attr & WSATTR_UNDERLINE) != 0) {
               DELTA(rp, -(ri->ri_stride << 1), int32_t *);
               rp[0] = rp[1] = rp[2] = stamp[15];
               if (ri->ri_hwbits) {
@@ -595,7 +595,7 @@ rasops8_putchar16(void *cookie, int row,
       }

       /* Do underline */
-       if ((attr & 1) != 0) {
+       if ((attr & WSATTR_UNDERLINE) != 0) {
               DELTA(rp, -(ri->ri_stride << 1), int32_t *);
               rp[0] = rp[1] = rp[2] = rp[3] = stamp[15];
               if (ri->ri_hwbits) {