Index Index for
Section 9
Index Alphabetical
listing for I
Bottom of page Bottom of
page

init_color_map(9r)

NAME

init_color_map - Graphics: Resets the colormap to a state where console output can be read on the screen

SYNOPSIS

int (*ws_color_map_functions->init_color_map)( caddr_t colormap_handle );

ARGUMENTS

colormap_handle Specifies the virtual address (handle) of device-specific information. Typically this is a pointer to a private data structure that may contain information such as the address of the hardware, state information, and other information that may be shared between drivers. The Workstation Subsystem allows separate handles for the cursor, colormap, and the screen functions.

DESCRIPTION

The Workstation Subsystem calls the init_color_map function whenever the Workstation Subsystem is opened, closed, or whenever the console screen is initialized. The function resets the colormap so that output to the console can be read on the console screen.

RETURN VALUES

If successful, the init_color_map function returns 0 (zero). If unsuccessful, it returns -1.

EXAMPLES

The following code is from the Compaq implementation of init_color_map in the myvga example driver: int myvga_init_color_map(caddr_t colormap_handle) { register struct myvga_type *scp = (struct myvga_type *)colormap_handle; register unsigned char *cp = &((vgaHWPtr)scp->new_state)->DAC[0]; register int i; if (myvga_developer_debug) printf("myvga_init_color_map: entry\n"); /* NOTE: using 8-bit values */ OUTB(MYVGA_PEL_MASK, 0xff); OUTB(MYVGA_PEL_ADDR_WMODE, 0); for (i = 0; i < 768; i++) OUTB(MYVGA_PEL_DATA, *cp++); return(0); }

FILES

/usr/sys/include/sys/workstation.h /usr/sys/include/sys/wsdevice.h

SEE ALSO

Data Structures: ws_color_map_functions(9s)

Index Index for
Section 9
Index Alphabetical
listing for I
Top of page Top of
page