device.h File Reference

Implements the functions: isbaddev. More...

#include <conf.h>
#include <stddef.h>

Include dependency graph for device.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define isbaddev(f)   ( !(0 <= (f) && (f) < NDEVS) )
 Check that device id is between 0 and NDEVS.

Functions

devcall close (int)
 close - close a device
devcall control (int, int, long, long)
 control - control a device (e.g., set the mode)
devcall getc (int)
 getc - get one character from a device
devcall open (int,...)
 open - open a connection to a device/file (params 2 & 3 are optional)
devcall putc (int, char)
 putc - write a single character to a device
devcall read (int, void *, uint)
 read - read one or more bytes from a device
devcall write (int, void *, uint)
 write - write 1 or more bytes to a device
devcall seek (int, long)
 seek - position a device (very common special case of control)
syscall getdev (char *)
 Returns the numerical identifier for the given device.


Detailed Description

Implements the functions: isbaddev.

Contains all definitions relating to the XINU device subsystem.

Id
device.h 1447 2008-08-12 19:23:34Z mschul

Definition in file device.h.


Define Documentation

#define isbaddev (  )     ( !(0 <= (f) && (f) < NDEVS) )

Check that device id is between 0 and NDEVS.

All calls to isbaddev will be ushort, so no need to check f < 0.

Parameters:
f id number to test

Definition at line 24 of file device.h.

Referenced by close(), control(), getc(), open(), putc(), read(), seek(), sysinit(), ttyOpen(), and write().


Function Documentation

devcall close ( int  descrp  ) 

close - close a device

Parameters:
descrp definition of device to close
Returns:
function to close device on success, SYSERR on failure

Definition at line 17 of file close.c.

References isbaddev, and SYSERR.

devcall control ( int  descrp,
int  func,
long  arg1,
long  arg2 
)

control - control a device (e.g., set the mode)

Parameters:
descrp definition of device to control
func specific control function for device
arg1 specific argument for func
arg2 specific argument for func
Returns:
function to control device on success, SYSERR on failure

Definition at line 20 of file control.c.

References isbaddev, and SYSERR.

Referenced by etherWrite(), and shell().

Here is the caller graph for this function:

devcall getc ( int  descrp  ) 

getc - get one character from a device

Parameters:
descrp definition of device from which to acquire character
Returns:
function to get character on success, SYSERR on failure

Definition at line 17 of file getc.c.

Referenced by fgetc(), fgets(), and getch().

Here is the caller graph for this function:

syscall getdev ( char *  dev  ) 

Returns the numerical identifier for the given device.

Parameters:
*dev device name
Returns:
device number

Definition at line 18 of file getdev.c.

References strcmp(), and SYSERR.

Referenced by shell().

Here is the call graph for this function:

Here is the caller graph for this function:

devcall open ( int  descrp,
  ... 
)

open - open a connection to a device/file (params 2 & 3 are optional)

Parameters:
descrp definition of device to open
Returns:
function to open device on success, SYSERR on failure

Definition at line 18 of file open.c.

References isbaddev, and SYSERR.

Referenced by etherStart(), and nulluser().

Here is the caller graph for this function:

devcall putc ( int  descrp,
char  ch 
)

putc - write a single character to a device

Parameters:
descrp definition of device on which to write
ch character to write
Returns:
function to write character on success, SYSERR on failure

Definition at line 18 of file putc.c.

Referenced by fprintf(), fputc(), and fputs().

Here is the caller graph for this function:

devcall read ( int  descrp,
void *  buffer,
uint  count 
)

read - read one or more bytes from a device

Parameters:
descrp definition of device from which to read
*buffer pointer into read-to location
count length of buffer
Returns:
function to read from device on success, SYSERR on failure

Definition at line 19 of file read.c.

References isbaddev, and SYSERR.

Referenced by shell().

Here is the caller graph for this function:

devcall seek ( int  descrp,
long  pos 
)

seek - position a device (very common special case of control)

Parameters:
descrp definition of device on which to seek
pos requested position to seek
Returns:
function to seek on device on success, SYSERR on failure

Definition at line 18 of file seek.c.

References isbaddev, and SYSERR.

devcall write ( int  descrp,
void *  buffer,
uint  count 
)

write - write 1 or more bytes to a device

Parameters:
descrp definition of device on which to write
*buffer pointer to data to be written
count length of data to be written
Returns:
function to write data on success, SYSERR on failure

Definition at line 19 of file write.c.

References isbaddev, and SYSERR.


Generated on Wed Aug 27 06:08:02 2008 for Embedded XINU by  doxygen 1.5.5