FreeBSD kernel kern code
subr_uio.c File Reference
#include <sys/cdefs.h>
#include "opt_zero.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/limits.h>
#include <sys/lock.h>
#include <sys/mman.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/resourcevar.h>
#include <sys/sched.h>
#include <sys/sysctl.h>
#include <sys/vnode.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/vm_extern.h>
#include <vm/vm_page.h>
#include <vm/vm_map.h>
Include dependency graph for subr_uio.c:

Go to the source code of this file.

Macros

#define PHYS_PAGE_COUNT(len)   (howmany(len, PAGE_SIZE) + 1)
 

Functions

 __FBSDID ("$BSDSUniX$")
 
 SYSCTL_INT (_kern, KERN_IOV_MAX, iov_max, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, UIO_MAXIOV,"Maximum number of elements in an I/O vector; sysconf(_SC_IOV_MAX)")
 
static int uiomove_faultflag (void *cp, int n, struct uio *uio, int nofault)
 
int copyin_nofault (const void *udaddr, void *kaddr, size_t len)
 
int copyout_nofault (const void *kaddr, void *udaddr, size_t len)
 
int physcopyin (void *src, vm_paddr_t dst, size_t len)
 
int physcopyout (vm_paddr_t src, void *dst, size_t len)
 
int uiomove (void *cp, int n, struct uio *uio)
 
int uiomove_nofault (void *cp, int n, struct uio *uio)
 
int uiomove_frombuf (void *buf, int buflen, struct uio *uio)
 
int ureadc (int c, struct uio *uio)
 
int copyinfrom (const void *__restrict src, void *__restrict dst, size_t len, int seg)
 
int copyinstrfrom (const void *__restrict src, void *__restrict dst, size_t len, size_t *__restrict copied, int seg)
 
int copyiniov (struct iovec *iovp, u_int iovcnt, struct iovec **iov, int error)
 
int copyinuio (struct iovec *iovp, u_int iovcnt, struct uio **uiop)
 
struct uio * cloneuio (struct uio *uiop)
 
int copyout_map (struct thread *td, vm_offset_t *addr, size_t sz)
 
int copyout_unmap (struct thread *td, vm_offset_t addr, size_t sz)
 

Macro Definition Documentation

#define PHYS_PAGE_COUNT (   len)    (howmany(len, PAGE_SIZE) + 1)

Definition at line 155 of file subr_uio.c.

Referenced by physcopyin(), and physcopyout().

Function Documentation

__FBSDID ( "$BSDSUniX$"  )
struct uio* cloneuio ( struct uio *  uiop)

Definition at line 544 of file subr_uio.c.

References malloc().

Referenced by dofileread(), dofilewrite(), kern_recvit(), kern_sendit(), log_console(), sys_kevent(), sys_sctp_generic_recvmsg(), and vn_io_fault().

Here is the call graph for this function:

Here is the caller graph for this function:

int copyin_nofault ( const void *  udaddr,
void *  kaddr,
size_t  len 
)

Definition at line 134 of file subr_uio.c.

int copyinfrom ( const void *__restrict  src,
void *__restrict  dst,
size_t  len,
int  seg 
)

Definition at line 452 of file subr_uio.c.

References panic().

Here is the call graph for this function:

int copyiniov ( struct iovec *  iovp,
u_int  iovcnt,
struct iovec **  iov,
int  error 
)

Definition at line 490 of file subr_uio.c.

References free(), and malloc().

Referenced by sys_recvmsg(), sys_sctp_generic_recvmsg(), sys_sctp_generic_sendmsg_iov(), and sys_sendmsg().

Here is the call graph for this function:

Here is the caller graph for this function:

int copyinstrfrom ( const void *__restrict  src,
void *__restrict  dst,
size_t  len,
size_t *__restrict  copied,
int  seg 
)

Definition at line 471 of file subr_uio.c.

References panic().

Here is the call graph for this function:

int copyinuio ( struct iovec *  iovp,
u_int  iovcnt,
struct uio **  uiop 
)

Definition at line 508 of file subr_uio.c.

References free(), and malloc().

Referenced by do_sendfile(), sys_jail_get(), sys_jail_set(), sys_nmount(), sys_preadv(), sys_pwritev(), sys_readv(), and sys_writev().

Here is the call graph for this function:

Here is the caller graph for this function:

int copyout_map ( struct thread *  td,
vm_offset_t *  addr,
size_t  sz 
)

Definition at line 562 of file subr_uio.c.

References lim_max().

Here is the call graph for this function:

int copyout_nofault ( const void *  kaddr,
void *  udaddr,
size_t  len 
)

Definition at line 145 of file subr_uio.c.

Referenced by sysctl_old_user().

Here is the caller graph for this function:

int copyout_unmap ( struct thread *  td,
vm_offset_t  addr,
size_t  sz 
)

Definition at line 591 of file subr_uio.c.

int physcopyin ( void *  src,
vm_paddr_t  dst,
size_t  len 
)

Definition at line 158 of file subr_uio.c.

References PHYS_PAGE_COUNT.

int physcopyout ( vm_paddr_t  src,
void *  dst,
size_t  len 
)

Definition at line 179 of file subr_uio.c.

References PHYS_PAGE_COUNT.

SYSCTL_INT ( _kern  ,
KERN_IOV_MAX  ,
iov_max  ,
CTLFLAG_RD  ,
SYSCTL_NULL_INT_PTR  ,
UIO_MAXIOV  ,
"Maximum number of elements in an I/O vector; sysconf(_SC_IOV_MAX)"   
)
int uiomove ( void *  cp,
int  n,
struct uio *  uio 
)
static int uiomove_faultflag ( void *  cp,
int  n,
struct uio *  uio,
int  nofault 
)
static

Definition at line 216 of file subr_uio.c.

References maybe_yield().

Referenced by uiomove(), and uiomove_nofault().

Here is the call graph for this function:

Here is the caller graph for this function:

int uiomove_frombuf ( void *  buf,
int  buflen,
struct uio *  uio 
)

Definition at line 296 of file subr_uio.c.

References uiomove().

Referenced by mqfs_read().

Here is the call graph for this function:

Here is the caller graph for this function:

int uiomove_nofault ( void *  cp,
int  n,
struct uio *  uio 
)

Definition at line 209 of file subr_uio.c.

References uiomove_faultflag().

Here is the call graph for this function:

int ureadc ( int  c,
struct uio *  uio 
)

Definition at line 411 of file subr_uio.c.

References panic().

Referenced by ptsdev_read().

Here is the call graph for this function:

Here is the caller graph for this function: