FreeBSD kernel kern code
subr_uio.c File Reference
#include <sys/cdefs.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/proc.h>
#include <sys/resourcevar.h>
#include <sys/rwlock.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_pageout.h>
#include <vm/vm_map.h>
#include <machine/bus.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 ("$FreeBSD$")
 
 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 physcopyin_vlist (bus_dma_segment_t *src, off_t offset, vm_paddr_t dst, size_t len)
 
int physcopyout_vlist (vm_paddr_t src, bus_dma_segment_t *dst, off_t offset, 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 copyiniov (const struct iovec *iovp, u_int iovcnt, struct iovec **iov, int error)
 
int copyinuio (const 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)
 
int32_t fuword32 (volatile const void *addr)
 
long fuword (volatile const void *addr)
 
uint32_t casuword32 (volatile uint32_t *addr, uint32_t old, uint32_t new)
 
u_long casuword (volatile u_long *addr, u_long old, u_long new)
 

Macro Definition Documentation

◆ PHYS_PAGE_COUNT

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

Definition at line 96 of file subr_uio.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ casuword()

u_long casuword ( volatile u_long *  addr,
u_long  old,
u_long  new 
)

Definition at line 507 of file subr_uio.c.

References addr.

◆ casuword32()

uint32_t casuword32 ( volatile uint32_t *  addr,
uint32_t  old,
uint32_t  new 
)

Definition at line 497 of file subr_uio.c.

References addr.

Referenced by do_lock_pi().

Here is the caller graph for this function:

◆ cloneuio()

struct uio * cloneuio ( struct uio *  uiop)

Definition at line 401 of file subr_uio.c.

References malloc().

Referenced by dofileread(), dofilewrite(), kern_recvit(), kern_sendit(), log_console(), and vn_io_fault1().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyin_nofault()

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

Definition at line 75 of file subr_uio.c.

◆ copyiniov()

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

Definition at line 347 of file subr_uio.c.

References free(), and malloc().

Referenced by sys_recvmsg(), and sys_sendmsg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyinuio()

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

Definition at line 365 of file subr_uio.c.

References free(), and malloc().

Referenced by aiocb_copyin(), 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:

◆ copyout_map()

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

Definition at line 419 of file subr_uio.c.

References addr, and lim_max().

Here is the call graph for this function:

◆ copyout_nofault()

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

Definition at line 86 of file subr_uio.c.

Referenced by stats_v1_blob_clone(), and sysctl_old_user().

Here is the caller graph for this function:

◆ copyout_unmap()

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

Definition at line 447 of file subr_uio.c.

References addr.

◆ fuword()

long fuword ( volatile const void *  addr)

Definition at line 487 of file subr_uio.c.

References addr.

Referenced by aiocb_fetch_error(), and aiocb_fetch_status().

Here is the caller graph for this function:

◆ fuword32()

int32_t fuword32 ( volatile const void *  addr)

Definition at line 465 of file subr_uio.c.

References addr.

Referenced by do_sem2_wait().

Here is the caller graph for this function:

◆ physcopyin()

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

Definition at line 99 of file subr_uio.c.

References PHYS_PAGE_COUNT, and src.

Referenced by physcopyin_vlist().

Here is the caller graph for this function:

◆ physcopyin_vlist()

int physcopyin_vlist ( bus_dma_segment_t *  src,
off_t  offset,
vm_paddr_t  dst,
size_t  len 
)

Definition at line 143 of file subr_uio.c.

References physcopyin(), and src.

Here is the call graph for this function:

◆ physcopyout()

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

Definition at line 120 of file subr_uio.c.

References PHYS_PAGE_COUNT, and src.

Referenced by physcopyout_vlist().

Here is the caller graph for this function:

◆ physcopyout_vlist()

int physcopyout_vlist ( vm_paddr_t  src,
bus_dma_segment_t *  dst,
off_t  offset,
size_t  len 
)

Definition at line 169 of file subr_uio.c.

References physcopyout(), and src.

Here is the call graph for this function:

◆ SYSCTL_INT()

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)"   
)

◆ uiomove()

◆ uiomove_faultflag()

static int uiomove_faultflag ( void *  cp,
int  n,
struct uio *  uio,
int  nofault 
)
static

Definition at line 209 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:

◆ uiomove_frombuf()

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

Definition at line 290 of file subr_uio.c.

References buf, and uiomove().

Referenced by mqfs_read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uiomove_nofault()

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

Definition at line 202 of file subr_uio.c.

References uiomove_faultflag().

Here is the call graph for this function:

◆ ureadc()

int ureadc ( int  c,
struct uio *  uio 
)

Definition at line 308 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: