	.file	"extr_rockchip-iommu.c_rk_iommu_domain_alloc.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"DMA map error for DT\n"
	.text
	.p2align 4
	.type	rk_iommu_domain_alloc, @function
rk_iommu_domain_alloc:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	ebx, edi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	cmp	DWORD PTR IOMMU_DOMAIN_UNMANAGED[rip], edi
	je	.L2
	cmp	DWORD PTR IOMMU_DOMAIN_DMA[rip], edi
	jne	.L21
.L2:
	mov	edi, DWORD PTR dma_dev[rip]
	test	edi, edi
	je	.L21
	mov	edx, DWORD PTR GFP_KERNEL[rip]
	mov	esi, 40
	call	devm_kzalloc@PLT
	mov	rbp, rax
	test	rax, rax
	je	.L21
	cmp	DWORD PTR IOMMU_DOMAIN_DMA[rip], ebx
	je	.L5
.L8:
	mov	edi, DWORD PTR GFP_KERNEL[rip]
	or	edi, DWORD PTR GFP_DMA32[rip]
	call	get_zeroed_page@PLT
	mov	QWORD PTR 16[rbp], rax
	mov	rsi, rax
	test	rax, rax
	je	.L6
	mov	edi, DWORD PTR dma_dev[rip]
	mov	ecx, DWORD PTR DMA_TO_DEVICE[rip]
	mov	edx, DWORD PTR SPAGE_SIZE[rip]
	call	dma_map_single@PLT
	mov	edi, DWORD PTR dma_dev[rip]
	mov	DWORD PTR 36[rbp], eax
	mov	esi, eax
	call	dma_mapping_error@PLT
	test	rax, rax
	jne	.L23
	mov	esi, DWORD PTR 36[rbp]
	mov	edx, DWORD PTR NUM_DT_ENTRIES[rip]
	mov	rdi, rbp
	call	rk_table_flush@PLT
	lea	rdi, 32[rbp]
	call	spin_lock_init@PLT
	lea	rdi, 28[rbp]
	call	spin_lock_init@PLT
	lea	rdi, 24[rbp]
	call	INIT_LIST_HEAD@PLT
	mov	QWORD PTR 8[rbp], 0
	mov	edi, 32
	call	DMA_BIT_MASK@PLT
	mov	DWORD PTR 0[rbp], 1
	mov	DWORD PTR 4[rbp], eax
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rax, rbp
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	mov	edi, DWORD PTR dma_dev[rip]
	lea	rsi, .LC0[rip]
	call	dev_err@PLT
	mov	rdi, QWORD PTR 16[rbp]
	call	free_page@PLT
.L6:
	cmp	DWORD PTR IOMMU_DOMAIN_DMA[rip], ebx
	jne	.L21
	mov	rdi, rbp
	call	iommu_put_dma_cookie@PLT
.L21:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	rdi, rax
	call	iommu_get_dma_cookie@PLT
	test	rax, rax
	je	.L8
	jmp	.L21
	.cfi_endproc
.LFE0:
	.size	rk_iommu_domain_alloc, .-rk_iommu_domain_alloc
	.comm	dma_dev,4,4
	.comm	SPAGE_SIZE,4,4
	.comm	NUM_DT_ENTRIES,4,4
	.comm	IOMMU_DOMAIN_UNMANAGED,4,4
	.comm	IOMMU_DOMAIN_DMA,4,4
	.comm	GFP_KERNEL,4,4
	.comm	GFP_DMA32,4,4
	.comm	DMA_TO_DEVICE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_rockchip-iommu.c_rk_iommu_domain_alloc.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"DMA map error for DT\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rk_iommu_domain_alloc, %function
rk_iommu_domain_alloc:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L24
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, [r3]
	mov	r5, r0
	cmp	r3, r0
	beq	.L2
	ldr	r3, .L24+4
	ldr	r3, [r3]
	cmp	r3, r0
	bne	.L21
.L2:
	ldr	r6, .L24+8
	ldr	r0, [r6]
	cmp	r0, #0
	beq	.L21
	ldr	r8, .L24+12
	mov	r1, #32
	ldr	r2, [r8]
	bl	devm_kzalloc
	subs	r4, r0, #0
	beq	.L21
	ldr	r7, .L24+4
	ldr	r3, [r7]
	cmp	r3, r5
	beq	.L5
.L8:
	ldr	r3, .L24+16
	ldr	r0, [r8]
	ldr	r3, [r3]
	orr	r0, r0, r3
	bl	get_zeroed_page
	cmp	r0, #0
	mov	r1, r0
	str	r0, [r4, #12]
	beq	.L6
	ldr	r3, .L24+20
	ldr	r2, .L24+24
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r0, [r6]
	bl	dma_map_single
	mov	r1, r0
	ldr	r0, [r6]
	str	r1, [r4, #28]
	bl	dma_mapping_error
	subs	r8, r0, #0
	bne	.L23
	ldr	r3, .L24+28
	ldr	r1, [r4, #28]
	ldr	r2, [r3]
	mov	r0, r4
	bl	rk_table_flush
	add	r0, r4, #24
	bl	spin_lock_init
	add	r0, r4, #20
	bl	spin_lock_init
	add	r0, r4, #16
	bl	INIT_LIST_HEAD
	str	r8, [r4, #8]
	mov	r0, #32
	bl	DMA_BIT_MASK
	mov	r3, #1
	str	r0, [r4, #4]
	str	r3, [r4]
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L23:
	ldr	r0, [r6]
	ldr	r1, .L24+32
	bl	dev_err
	ldr	r0, [r4, #12]
	bl	free_page
.L6:
	ldr	r3, [r7]
	cmp	r3, r5
	bne	.L21
	mov	r0, r4
	bl	iommu_put_dma_cookie
.L21:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L5:
	bl	iommu_get_dma_cookie
	cmp	r0, #0
	beq	.L8
	b	.L21
.L25:
	.align	2
.L24:
	.word	IOMMU_DOMAIN_UNMANAGED
	.word	IOMMU_DOMAIN_DMA
	.word	dma_dev
	.word	GFP_KERNEL
	.word	GFP_DMA32
	.word	DMA_TO_DEVICE
	.word	SPAGE_SIZE
	.word	NUM_DT_ENTRIES
	.word	.LC0
	.size	rk_iommu_domain_alloc, .-rk_iommu_domain_alloc
	.comm	dma_dev,4,4
	.comm	SPAGE_SIZE,4,4
	.comm	NUM_DT_ENTRIES,4,4
	.comm	IOMMU_DOMAIN_UNMANAGED,4,4
	.comm	IOMMU_DOMAIN_DMA,4,4
	.comm	GFP_KERNEL,4,4
	.comm	GFP_DMA32,4,4
	.comm	DMA_TO_DEVICE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
