DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

sptfree(D3oddi)


sptfree -- release memory previously allocated with sptalloc(D3oddi)

Synopsis

void sptfree(caddr_t va, int npages, int freeflg);

Description

sptfree frees memory obtained using sptalloc(D3oddi).

Arguments


va
Virtual address returned from a previous call to sptalloc(D3oddi).

npages
Number of pages to free. This should be the same number of pages allocated by a previous call to sptalloc.

freeflg
Indicates the type of allocation that is being freed:

0
Free memory-mapped I/O space.

1
(or any non-zero value) Free allocated memory and place the freed pages into he free page list.

Return values

None.

Usage

For example, to release the memory obtained by a call to the sptalloc routine, and free it completely, use the following statement:
   sptfree(caddr_t va, int npages, int 1);

Context and synchronization

Non-blockable, interrupt, user, or blockable context.

Hardware applicability

All.

Version applicability

oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

SVR5 DDI compatibility

The sptfree( ) function is not supported for DDI drivers. For DDI 7 and earlier versions, use the physmap_free(D3) function to free memory-mapped I/O space. For DDI 8 and later versions, use the devmem_mapout(D3) function for this purpose. DDI drivers use the kmem_free(D3) and related functions to free allocated memory

See ``Memory allocation'' in HDK Technical Reference for information about allocating memory and ``Memory-mapped I/O'' in HDK Technical Reference for information about memory-mapped I/O.

References

sptalloc(D3oddi)

``Memory allocation'' in HDK Technical Reference
``Memory-mapped I/O'' in HDK Technical Reference
``ODDI driver interface version for SCO OpenServer 5'' in HDK Technical Reference


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005