The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Интерактивная система просмотра системных руководств (man-ов)

 ТемаНаборКатегория 
 
 [Cписок руководств | Печать]

contigfree (9)
  • >> contigfree (9) ( FreeBSD man: Ядро )

  • BSD mandoc
     

    NAME

    
    
    contigmalloc , contigfree
    
     - manage contiguous kernel physical memory
    
     
    

    SYNOPSIS

       #include <sys/types.h>
       #include <sys/malloc.h>
    void * Fo contigmalloc Fa unsigned long size Fa struct malloc_type *type Fa int flags Fa vm_paddr_t low Fa vm_paddr_t high Fa unsigned long alignment Fa unsigned long boundary Fc Ft void Fo contigfree Fa void *addr Fa unsigned long size Fa struct malloc_type *type Fc  

    DESCRIPTION

    The contigmalloc ();
    function allocates Fa size bytes of contiguous physical memory that is aligned to Fa alignment bytes, and which does not cross a boundary of Fa boundary bytes. If successful, the allocation will reside between physical addresses Fa low and Fa high . The returned pointer points to a wired kernel virtual address range of Fa size bytes allocated from the kernel virtual address (KVA) map.

    The Fa flags parameter modifies contigmalloc (Ns 's);
    behaviour as follows:

    M_ZERO
    Causes the allocated physical memory to be zero filled.
    M_NOWAIT
    Causes contigmalloc ();
    to return NULL if the request cannot be immediately fulfilled due to resource shortage.

    Other flags (if present) are ignored.

    The contigfree ();
    function deallocates memory allocated by a previous call to contigmalloc (.);
     

    IMPLEMENTATION NOTES

    The contigmalloc ();
    function does not sleep waiting for memory resources to be freed up, but instead actively reclaims pages before giving up. However, unless M_NOWAIT is specified, it may select a page for reclamation that must first be written to backing storage, causing it to sleep.  

    RETURN VALUES

    The contigmalloc ();
    function returns a kernel virtual address if allocation succeeds, or NULL otherwise.  

    EXAMPLES

    void *p;
    p = contigmalloc(8192, M_DEVBUF, M_ZERO, 0, (1L << 22),
        32 * 1024, 1024 * 1024);
    

    Ask for 8192 bytes of zero-filled memory residing between physical address 0 and 4194303 inclusive, aligned to a 32K boundary and not crossing a 1M address boundary.  

    DIAGNOSTICS

    The contigmalloc ();
    function will panic if Fa size is zero, or if Fa alignment or Fa boundary is not a power of two.  

    SEE ALSO

    malloc(9), memguard(9)


     

    Index

    NAME
    SYNOPSIS
    DESCRIPTION
    IMPLEMENTATION NOTES
    RETURN VALUES
    EXAMPLES
    DIAGNOSTICS
    SEE ALSO


    Поиск по тексту MAN-ов: 




    Партнёры:
    PostgresPro
    Inferno Solutions
    Hosting by Hoster.ru
    Хостинг:

    Закладки на сайте
    Проследить за страницей
    Created 1996-2024 by Maxim Chirkov
    Добавить, Поддержать, Вебмастеру