Mark Johnson wrote:
>
> James Carlson wrote:
>>
>> I might have chosen something like "bp_kern2buf" and "bp_buf2kern" to
>> make the operation clearer, if the standard copyin {to the caller} and
>> copyout {from the caller} semantics can't be followed for some reason.
>
> OK. I'll switch them around to match ddi_copyin()
> ddi_copyout() then.. Case material will be updated
> later today.
Updated man pages below...
Thanks,
MRJ
A.1 man page for bp_copyin(9F)
Kernel Functions for Drivers bp_copyin(9F)
NAME
bp_copyin - copy from a buf(9S) into a driver buffer
SYNOPSIS
#include <sys/types.h>
#include <sys/buf.h>
int bp_copyin(struct buf *bp, caddr_t vaddr,
offset_t offset, size_t size);
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
PARAMETERS
bp Pointer to the buffer header structure to copy from.
vaddr Kernel virtual address to copy to.
offset Offset into bp where to start copying.
size Size of copy.
DESCRIPTION
bp_copyin() copies 'size' bytes starting at 'offset' bytes
into the memory associated with 'bp' to the destination
kernel virtual address 'vaddr'. The 'offset' only
applies to 'bp'.
RETURN VALUES
Under normal conditions, 0 is returned to indicate a
successful copy. Otherwise, -1 is returned if 'bp' references
invalid pages.
CONTEXT
bp_copyin() can be called from user or kernel context only.
SEE ALSO
bp_copyout(9F), buf(9S), ddi_copyout(9F), bp_mapin(9F),
bp_mapout(9F).
A.2 man page for bp_copyout(9F)
Kernel Functions for Drivers bp_copyout(9F)
NAME
bp_copyout - copy from a driver buffer into a buf(9S)
SYNOPSIS
#include <sys/types.h>
#include <sys/buf.h>
int bp_copyout(caddr_t vaddr, struct buf *bp,
offset_t offset, size_t size);
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
PARAMETERS
vaddr Kernel virtual address to copy from.
bp Pointer to the buffer header structure to copy to.
offset Offset into bp where to start copying.
size Size of copy.
DESCRIPTION
bp_copyout() copies 'size' bytes starting from kernel virtual
address 'vaddr' to 'offset' bytes into the memory associated
with 'bp'. The 'offset' only applies to 'bp'.
RETURN VALUES
Under normal conditions, 0 is returned to indicate a
successful copy. Otherwise, -1 is returned if 'bp' references
invalid pages.
CONTEXT
bp_copyout() can be called from user or kernel context only.
SEE ALSO
bp_copyin(9F), buf(9S), ddi_copyin(9F), bp_mapin(9F),
bp_mapout(9F).