Lines Matching refs:alloc
76 static u64 checksum(struct efi_pool_allocation *alloc) in checksum() argument
78 u64 addr = (uintptr_t)alloc; in checksum()
79 u64 ret = (addr >> 32) ^ (addr << 32) ^ alloc->num_pages ^ in checksum()
625 struct efi_pool_allocation *alloc; in efi_allocate_pool() local
640 alloc = (struct efi_pool_allocation *)(uintptr_t)addr; in efi_allocate_pool()
641 alloc->num_pages = num_pages; in efi_allocate_pool()
642 alloc->checksum = checksum(alloc); in efi_allocate_pool()
643 *buffer = alloc->data; in efi_allocate_pool()
684 struct efi_pool_allocation *alloc; in efi_realloc() local
700 alloc = container_of(*ptr, struct efi_pool_allocation, data); in efi_realloc()
703 if (((uintptr_t)alloc & EFI_PAGE_MASK) || in efi_realloc()
704 alloc->checksum != checksum(alloc)) { in efi_realloc()
710 if (alloc->num_pages == num_pages) in efi_realloc()
713 old_size = alloc->num_pages * EFI_PAGE_SIZE - in efi_realloc()
740 struct efi_pool_allocation *alloc; in efi_free_pool() local
749 alloc = container_of(buffer, struct efi_pool_allocation, data); in efi_free_pool()
752 if (((uintptr_t)alloc & EFI_PAGE_MASK) || in efi_free_pool()
753 alloc->checksum != checksum(alloc)) { in efi_free_pool()
758 alloc->checksum = 0; in efi_free_pool()
760 ret = efi_free_pages((uintptr_t)alloc, alloc->num_pages); in efi_free_pool()