vm_segmap Kernel Service

Purpose

Creates the segments associated with a range of bytes in a file and attaches them to the kernel's address space.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/vmuser.h>

int vm_segmap ( basesid, pfirst, flags, basepp)
vmid_t basesid;
vpn_t pfirst;
uint flags;
caddr_t * basepp;

Parameters

Item Description
basesid Identifies the base segment.
pfirst The first page number within the range. The pfirst parameter is non-negative.
flags Optional flags passed in by the user. .
basepp The offset of the object to be attached.

Description

The vm_segmap kernel service routine creates segments associated with a range of bytes in a file. Afterwards, it uses the vm_att kernel service to map the specified virtual memory object to a region in the virtual address space and returns the effective address of that object in the basepp parameter.

Execution Environment

The vm_segmap kernel service can be called from either the process or interrupt environment.

Return Values

Item Description
caddr_t The effective address of the attached object.
EINVAL Indicates one of the following errors:
  • pfirst < 0.
  • Invalid sid parameter.
EFBIG Indicates the range of values is too large to create.