DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

db_write(D3oddi)


db_write -- transfer data from a user address to contiguous memory

Synopsis

   void db_write(struct devbuf *dv, paddr_t va, unsigned count);

Description

db_write transfers data from a virtual user address to physical contiguous memory that was previously allocated with the db_alloc(D3oddi) function.

Arguments


dv
Pointer to a devbuf structure allocated with the db_alloc(D3oddi) function.

va
Virtual user address from which to transfer data.

count
Amount of data, in bytes, to be transferred.

Return values

None.

Usage

Only use this routine after the requested pages are locked into memory by a previous call to the physio(D3oddi) function. Using db_write( ) under any other circumstances results in a panic.

Context and synchronization

User context.

Hardware applicability

All

Version applicability

oddi: 1, 2

Differences between versions

Current drivers that allocate memory with the getcpages(D3oddi) function can use the copyin(D3oddi) function to transfer the data.

SVR5 DDI compatibility

This function is not supported in DDI. Rewrite the driver to use a different memory allocation scheme, then use the copyin(D3) function to move the data.

Examples

The following example illustrates how to transfer data from a buffer to physically contiguous memory pointed to by dv:
   struct buf *bp;
   struct devbuf dv;
   

db_write( &dv, paddr(bp), bp->b_count );

References

db_alloc(D3oddi), db_read(D3oddi)

``Memory allocation'' in HDK Technical Reference


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005