#include <kernel.h>
Go to the source code of this file.
Data Structures | |
struct | dentry |
Defines | |
#define | SERIAL0 0 |
#define | SERIAL1 1 |
#define | CONSOLE 2 |
#define | TTY0 2 |
#define | TTY1 3 |
#define | NUART 2 |
#define | NTTY 2 |
#define | NWIN 0 |
#define | NFRAMBUF 0 |
#define | NDEVS ( NUART + NTTY + NFRAMBUF + NWIN ) |
#define | isbaddev(f) ( (ushort)(f)>=NDEVS ) |
Typedefs | |
typedef struct dentry | device |
Functions | |
devcall | close (ushort) |
devcall | control (ushort, ushort, long, long) |
devcall | getc (ushort) |
devcall | open (ushort,...) |
devcall | putc (ushort, char) |
devcall | read (ushort, void *, long) |
devcall | write (ushort, void *, long) |
devcall | seek (ushort, long) |
Variables | |
struct dentry | devtab [] |
Contains all definitions relating to the XINU device subsystem.
Definition in file device.h.
#define CONSOLE 2 |
#define isbaddev | ( | f | ) | ( (ushort)(f)>=NDEVS ) |
#define NDEVS ( NUART + NTTY + NFRAMBUF + NWIN ) |
#define NTTY 2 |
#define NUART 2 |
number of UART
Definition at line 50 of file device.h.
Referenced by uartIntr(), and xsh_uartstat().
#define SERIAL0 0 |
devcall close | ( | ushort | descrp | ) |
control - control a device (e.g., set the mode)
descrp | definition of device to control | |
func | specific control function for device | |
arg1 | specific argument for func | |
arg2 | specific argument for func |
Definition at line 20 of file control.c.
References dentry::control, devtab, isbaddev, and SYSERR.
devcall getc | ( | ushort | descrp | ) |
devcall open | ( | ushort | descrp, | |
... | ||||
) |
open - open a connection to a device/file (params 2 & 3 are optional)
descrp | definition of device to open |
Definition at line 18 of file open.c.
References devcall, devtab, isbaddev, dentry::open, SYSERR, va_end, and va_start.
Referenced by main(), and nulluser().
devcall putc | ( | ushort | descrp, | |
char | ch | |||
) |
devcall read | ( | ushort | descrp, | |
void * | buffer, | |||
long | count | |||
) |
read - read one or more bytes from a device
descrp | definition of device from which to read | |
*buffer | pointer into read-to location | |
count | length of buffer |
Definition at line 19 of file read.c.
References devtab, isbaddev, dentry::read, and SYSERR.
Referenced by shell().
devcall seek | ( | ushort | descrp, | |
long | pos | |||
) |
seek - position a device (very common special case of control)
descrp | definition of device on which to seek | |
pos | requested position to seek |
Definition at line 18 of file seek.c.
References devtab, isbaddev, dentry::seek, and SYSERR.
devcall write | ( | ushort | descrp, | |
void * | buffer, | |||
long | count | |||
) |
write - write 1 or more bytes to a device
descrp | definition of device on which to write | |
*buffer | pointer to data to be written | |
count | length of data to be written |
Definition at line 19 of file write.c.
References devtab, isbaddev, SYSERR, and dentry::write.