diff options
-rw-r--r-- | sys/dev/syscons/syscons.c | 18 | ||||
-rw-r--r-- | sys/sys/consio.h | 10 |
2 files changed, 28 insertions, 0 deletions
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index da11de9..f3305c4 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -838,6 +838,24 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) splx(s); return 0; + case CONS_SCRSHOT: /* get a screen shot */ + { + scrshot_t *ptr = (scrshot_t*)data; + s = spltty(); + if (ISGRAPHSC(scp)) { + splx(s); + return EOPNOTSUPP; + } + if (scp->xsize != ptr->xsize || scp->ysize != ptr->ysize) { + splx(s); + return EINVAL; + } + copyout ((void*)scp->vtb.vtb_buffer, ptr->buf, + ptr->xsize * ptr->ysize * sizeof(u_int16_t)); + splx(s); + return 0; + } + case VT_SETMODE: /* set screen switcher mode */ { struct vt_mode *mode; diff --git a/sys/sys/consio.h b/sys/sys/consio.h index 7a9fb02..5cb599a 100644 --- a/sys/sys/consio.h +++ b/sys/sys/consio.h @@ -239,6 +239,16 @@ typedef struct vid_info vid_info_t; /* release the current keyboard */ #define CONS_RELKBD _IO('c', 111) +/* Snapshot the current video buffer */ +#define CONS_SCRSHOT _IOWR('c', 105, scrshot_t) + +struct scrshot { + int xsize; + int ysize; + u_int16_t* buf; +}; +typedef struct scrshot scrshot_t; + /* get/set the current terminal emulator info. */ #define TI_NAME_LEN 32 #define TI_DESC_LEN 64 |