 |
Index for Section 9 |
|
 |
Alphabetical listing for I |
|
 |
Bottom of page |
|
ioctl(9r)
NAME
ioctl - Graphics: Allows the screen to implement arbitrary I/O control
SYNOPSIS
int (*ws_screen_functions->ioctl)(
ws_screen_descriptor *screen,
int cmd,
caddr_t data,
int flag );
ARGUMENTS
screen
Specifies a pointer to the typedef structure ws_screen_descriptor,
which describes the attributes of the screen.
cmd Specifies the command to be executed.
data
Specifies the virtual address where the data is to reside.
flag
Specifies a flag that may be passed by the function.
DATA STRUCTURES
The ioctl function accesses the ws_screen_descriptor structure defined in
/usr/sys/include/sys/workstation.h.
DESCRIPTION
The ioctl function allows the specified screen to perform driver-specific
ioctl commands. As a result, this function allows you to implement
functions that the Workstation Subsystem does not provide. For example, you
might use this function to implement an ioctl command that blocks the
server until the graphics device is again free.
The definition of the ioctl command must be in a header file to be included
by the DDX component for the adapter. This is an optional function, and if
you provide a stub, it will never be called.
The ioctl function is grouped with the screen functions in the
ws_screen_functions structure in </sys/wsdevice.h>.
RETURN VALUES
The individual ioctl command determines the value that it returns.
EXAMPLES
The following example shows how the myvga example driver implements the
ioctl function:
int
myvga_ioctl(caddr_t screen_handle,
int request,
caddr_t data)
{
int i,j;
int status = 0;
struct myvga_ioc_type *ioctp =
(struct myvga_ioc_type *)data;
if (myvga_developer_debug)
printf("myvga_ioctl:\n");
switch(request) {
case MYVGA_IOC_FLASH:
if (myvga_developer_debug)
printf("\tMYVGA_IOC_FLASH\n");
myvga_video_off(screen_handle);
DELAY(10000);
myvga_video_on(screen_handle);
break;
default:
if (myvga_developer_debug)
printf("\tUnsupported ioctl command\n");
break;
}
return status;
}
FILES
/usr/sys/include/sys/workstation.h
/usr/sys/include/sys/wsdevice.h
SEE ALSO
Data Structures: ws_screen_functions(9s)
Driver Routines: close(9r), init_screen(9r), init_screen_handle(9r),
map_unmap_screen(9r)
 |
Index for Section 9 |
|
 |
Alphabetical listing for I |
|
 |
Top of page |
|