Lines Matching defs:bytes

261 	unsigned long bytes;
265 bytes = PAGE_ALIGN(mem->nslabs << IO_TLB_SHIFT);
266 set_memory_decrypted((unsigned long)mem->vaddr, bytes >> PAGE_SHIFT);
273 unsigned long bytes = nslabs << IO_TLB_SHIFT, i;
277 mem->end = mem->start + bytes;
296 memset(vaddr, 0, bytes);
322 size_t bytes = PAGE_ALIGN(nslabs << IO_TLB_SHIFT);
331 tlb = memblock_alloc(bytes, PAGE_SIZE);
333 tlb = memblock_alloc_low(bytes, PAGE_SIZE);
336 pr_warn("%s: Failed to allocate %zu bytes tlb structure\n",
337 __func__, bytes);
342 memblock_free(tlb, PAGE_ALIGN(bytes));
343 pr_warn("%s: Failed to remap %zu bytes\n", __func__, bytes);
401 pr_warn("%s: Failed to allocate %zu bytes align=0x%lx\n",
565 * @bytes: Size of the buffer.
574 static struct page *alloc_dma_pages(gfp_t gfp, size_t bytes, u64 phys_limit)
576 unsigned int order = get_order(bytes);
586 if (paddr + bytes - 1 > phys_limit) {
592 if (set_memory_decrypted((unsigned long)vaddr, PFN_UP(bytes)))
598 if (!set_memory_encrypted((unsigned long)vaddr, PFN_UP(bytes)))
606 * @bytes: Size of the buffer.
612 static struct page *swiotlb_alloc_tlb(struct device *dev, size_t bytes,
627 return dma_alloc_from_pool(dev, bytes, &vaddr, gfp,
637 while (IS_ERR(page = alloc_dma_pages(gfp, bytes, phys_limit))) {
655 * @bytes: Size of the buffer.
657 static void swiotlb_free_tlb(void *vaddr, size_t bytes)
660 dma_free_from_pool(NULL, vaddr, bytes))
664 if (!set_memory_encrypted((unsigned long)vaddr, PFN_UP(bytes)))
665 __free_pages(virt_to_page(vaddr), get_order(bytes));
843 * padding bytes before the bounce buffer.
847 * offset (in bytes) from the first such padding slot is returned.
875 * tlb_addr is pointing within the first "offset" bytes of the second
877 * valid for tlb_addr to be pointing within the first "offset" bytes
1365 * mapping_size bytes is initialized to the contents of the original IO buffer
1407 "swiotlb buffer is full (sz: %zd bytes), total %lu (slots), used %lu (slots)\n",
1437 * i.e. swiotlb must not corrupt memory by clobbering unwritten bytes.