参照元

説明

引数

返り値

参考

実装

/**
 * cma_release() - release allocated pages
 * @cma:   Contiguous memory region for which the allocation is performed.
 * @pages: Allocated pages.
 * @count: Number of allocated pages.
 *
 * This function releases memory allocated by alloc_cma().
 * It returns false when provided pages do not belong to contiguous area and
 * true otherwise.
 */
bool cma_release(struct cma *cma, const struct page *pages, unsigned int count)
{
        unsigned long pfn;

        if (!cma || !pages)
                return false;

        pr_debug("%s(page %p)\n", __func__, (void *)pages);
        pfn = page_to_pfn(pages);
        if (pfn < cma->base_pfn || pfn >= cma->base_pfn + cma->count)
                return false;

        VM_BUG_ON(pfn + count > cma->base_pfn + cma->count);
        free_contig_range(pfn, count);
        cma_clear_bitmap(cma, pfn, count);
        trace_cma_release(pfn, pages, count);
        return true;
}

コメント


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2016-03-08 (火) 09:52:09