vm_gfree Kernel Service

Purpose

Frees a region of global memory in the kernel previously allocated with the vm_galloc kernel service.

Syntax

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

int vm_gfree (ulong  eaddr, vmsize_t  size)

Description

The vm_gfree kernel service frees up a global memory region previously allocated with the vm_galloc kernel service. The start address and size must exactly match what was previously allocated by the vm_galloc kernel service. It is not valid to free part of a previously allocated region in the vm_galloc area.

Any I/O to or from the region being freed up must be quiesced before calling the vm_gfree kernel service.

Parameters

Item Description
eaddr Start address of the region to free.
size Size in bytes of the region to free.

Execution Environment

The vm_gfree kernel service can be called from the process environment only.

Return Values

Item Description
0 Successful completion. The region was freed.
EINVAL Invalid size or start address specified. This could mean that the region is out of range of the vm_galloc heap, was not previously allocated with vm_galloc, or does not exactly match a previous allocation from vm_galloc.