#ifndef WS_DEFAULT_FG
#if defined(__sparc64__)
#define WS_DEFAULT_FG WSCOL_BLACK
#else
#define WS_DEFAULT_FG WSCOL_WHITE
#endif
#endif
#ifndef WS_DEFAULT_BG
#if defined(__sparc64__)
#define WS_DEFAULT_BG WSCOL_WHITE
#else
#define WS_DEFAULT_BG WSCOL_BLACK
#endif
#endif
struct device;
#define WSDISPLAY_MAXSCREEN 12
struct wsdisplay_emulops {
int (*cursor)(void *c, int on, int row, int col);
int (*mapchar)(void *, int, unsigned int *);
int (*putchar)(void *c, int row, int col, u_int uc, uint32_t attr);
int (*copycols)(void *c, int row, int srccol, int dstcol,
int ncols);
int (*erasecols)(void *c, int row, int startcol, int ncols,
uint32_t);
int (*copyrows)(void *c, int srcrow, int dstrow, int nrows);
int (*eraserows)(void *c, int row, int nrows, uint32_t attr);
int (*pack_attr)(void *c, int fg, int bg, int flags,
uint32_t *attrp);
void (*unpack_attr)(void *c, uint32_t attr, int *fg, int *bg,
int *ul);
#define WSCOL_BLACK 0
#define WSCOL_RED 1
#define WSCOL_GREEN 2
#define WSCOL_BROWN 3
#define WSCOL_BLUE 4
#define WSCOL_MAGENTA 5
#define WSCOL_CYAN 6
#define WSCOL_WHITE 7
#define WSATTR_REVERSE 1
#define WSATTR_HILIT 2
#define WSATTR_BLINK 4
#define WSATTR_UNDERLINE 8
#define WSATTR_WSCOLORS 16
};
#define WSSCREEN_NAME_SIZE 16
struct wsscreen_descr {
char name[WSSCREEN_NAME_SIZE];
int ncols, nrows;
const struct wsdisplay_emulops *textops;
int fontwidth, fontheight;
int capabilities;
#define WSSCREEN_WSCOLORS 1
#define WSSCREEN_REVERSE 2
#define WSSCREEN_HILIT 4
#define WSSCREEN_BLINK 8
#define WSSCREEN_UNDERLINE 16
};
struct wsdisplay_charcell {
u_int uc;
uint32_t attr;
};
struct wsdisplay_font;
struct wsdisplay_accessops {
int (*ioctl)(void *v, u_long cmd, caddr_t data, int flag,
struct proc *p);
paddr_t (*mmap)(void *v, off_t off, int prot);
int (*alloc_screen)(void *, const struct wsscreen_descr *,
void **, int *, int *, uint32_t *);
void (*free_screen)(void *, void *);
int (*show_screen)(void *, void *, int,
void (*) (void *, int, int), void *);
int (*load_font)(void *, void *, struct wsdisplay_font *);
int (*list_font)(void *, struct wsdisplay_font *);
void (*scrollback)(void *, void *, int);
int (*getchar)(void *, int, int, struct wsdisplay_charcell *);
void (*burn_screen)(void *, u_int, u_int);
void (*pollc)(void *, int);
void (*enter_ddb)(void *, void *);
};
struct wsscreen_list {
int nscreens;
const struct wsscreen_descr **screens;
};
struct wsemuldisplaydev_attach_args {
int console;
int primary;
const struct wsscreen_list *scrdata;
const struct wsdisplay_accessops *accessops;
void *accesscookie;
u_int defaultscreens;
};
#define WSEMULDISPLAYDEVCF_CONSOLE 0
#define wsemuldisplaydevcf_console cf_loc[WSEMULDISPLAYDEVCF_CONSOLE]
#define WSEMULDISPLAYDEVCF_CONSOLE_UNK -1
#define WSEMULDISPLAYDEVCF_PRIMARY 1
#define wsemuldisplaydevcf_primary cf_loc[WSEMULDISPLAYDEVCF_PRIMARY]
#define WSEMULDISPLAYDEVCF_PRIMARY_UNK -1
#define WSEMULDISPLAYDEVCF_MUX 2
#define wsemuldisplaydevcf_mux cf_loc[WSEMULDISPLAYDEVCF_MUX]
#define WSDISPLAYDEVCF_MUX 0
#define wsdisplaydevcf_mux cf_loc[WSDISPLAYDEVCF_MUX]
struct wscons_syncops {
int (*detach)(void *, int, void (*)(void *, int, int), void *);
int (*attach)(void *, int, void (*)(void *, int, int), void *);
int (*check)(void *);
void (*destroy)(void *);
};
void wsdisplay_cnattach(const struct wsscreen_descr *, void *,
int, int, uint32_t);
int wsemuldisplaydevprint(void *, const char *);
int wsemuldisplaydevsubmatch(struct device *, void *, void *);
void wsdisplay_cnputc(dev_t dev, int i);
struct wsdisplay_softc;
struct wsscreen;
int wsscreen_attach_sync(struct wsscreen *,
const struct wscons_syncops *, void *);
int wsscreen_detach_sync(struct wsscreen *);
int wsscreen_lookup_sync(struct wsscreen *,
const struct wscons_syncops *, void **);
int wsdisplay_maxscreenidx(struct wsdisplay_softc *);
int wsdisplay_screenstate(struct wsdisplay_softc *, int);
int wsdisplay_getactivescreen(struct wsdisplay_softc *);
int wsscreen_switchwait(struct wsdisplay_softc *, int);
int wsdisplay_internal_ioctl(struct wsdisplay_softc *sc,
struct wsscreen *,
u_long cmd, caddr_t data,
int flag, struct proc *p);
int wsdisplay_usl_ioctl1(struct wsdisplay_softc *,
u_long, caddr_t, int, struct proc *);
int wsdisplay_usl_ioctl2(struct wsdisplay_softc *, struct wsscreen *,
u_long, caddr_t, int, struct proc *);
int wsdisplay_cfg_ioctl(struct wsdisplay_softc *sc,
u_long cmd, caddr_t data,
int flag, struct proc *p);
#define WSDISPLAY_NULLSCREEN -1
void wsdisplay_switchtoconsole(void);
void wsdisplay_enter_ddb(void);
void wsdisplay_suspend(void);
void wsdisplay_resume(void);
const struct wsscreen_descr *
wsdisplay_screentype_pick(const struct wsscreen_list *, const char *);
struct wsdisplay_param;
extern int (*ws_get_param)(struct wsdisplay_param *);
extern int (*ws_set_param)(struct wsdisplay_param *);
void wsdisplay_brightness_step(struct device *, int);
void wsdisplay_brightness_zero(struct device *);
void wsdisplay_brightness_cycle(struct device *);
void wsdisplay_burn(void *v, u_int flags);
void wsscrollback(void *v, int op);
#define WSDISPLAY_SCROLL_BACKWARD 0
#define WSDISPLAY_SCROLL_FORWARD 1
#define WSDISPLAY_SCROLL_RESET 2
#define WSDISPLAY_DEFBURNOUT_MSEC 0
#define WSDISPLAY_DEFBURNIN_MSEC 250