	.file	"extr_das1800.c_setup_dma.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	setup_dma, @function
setup_dma:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	mov	rbp, QWORD PTR devpriv[rip]
	mov	DWORD PTR 12[rsp], esi
	mov	ebx, DWORD PTR 0[rbp]
	test	DWORD PTR DMA_ENABLED[rip], ebx
	jne	.L12
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	lea	rdi, 12[rsp]
	mov	r12d, DWORD PTR DMA_DUAL[rip]
	call	suggest_transfer_size@PLT
	mov	DWORD PTR 8[rbp], eax
	xor	eax, eax
	call	claim_dma_lock@PLT
	mov	rbp, rax
	mov	rax, QWORD PTR devpriv[rip]
	mov	edi, DWORD PTR 16[rax]
	call	disable_dma@PLT
	mov	rax, QWORD PTR devpriv[rip]
	mov	edi, DWORD PTR 16[rax]
	call	clear_dma_ff@PLT
	mov	rax, QWORD PTR devpriv[rip]
	mov	edi, DWORD PTR 20[rax]
	call	virt_to_bus@PLT
	mov	esi, eax
	mov	rax, QWORD PTR devpriv[rip]
	mov	edi, DWORD PTR 16[rax]
	call	set_dma_addr@PLT
	mov	rax, QWORD PTR devpriv[rip]
	mov	edi, DWORD PTR 16[rax]
	mov	esi, DWORD PTR 8[rax]
	call	set_dma_count@PLT
	mov	rax, QWORD PTR devpriv[rip]
	mov	edi, DWORD PTR 16[rax]
	mov	edx, DWORD PTR 20[rax]
	mov	DWORD PTR 28[rax], edi
	mov	DWORD PTR 24[rax], edx
	call	enable_dma@PLT
	test	ebx, r12d
	jne	.L13
.L3:
	mov	rdi, rbp
	call	release_dma_lock@PLT
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	mov	rax, QWORD PTR devpriv[rip]
	mov	edi, DWORD PTR 4[rax]
	call	disable_dma@PLT
	mov	rax, QWORD PTR devpriv[rip]
	mov	edi, DWORD PTR 4[rax]
	call	clear_dma_ff@PLT
	mov	rax, QWORD PTR devpriv[rip]
	mov	edi, DWORD PTR 12[rax]
	call	virt_to_bus@PLT
	mov	esi, eax
	mov	rax, QWORD PTR devpriv[rip]
	mov	edi, DWORD PTR 4[rax]
	call	set_dma_addr@PLT
	mov	rax, QWORD PTR devpriv[rip]
	mov	esi, DWORD PTR 8[rax]
	mov	edi, DWORD PTR 4[rax]
	call	set_dma_count@PLT
	mov	rax, QWORD PTR devpriv[rip]
	mov	edi, DWORD PTR 4[rax]
	call	enable_dma@PLT
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	setup_dma, .-setup_dma
	.comm	devpriv,8,8
	.comm	DMA_ENABLED,4,4
	.comm	DMA_DUAL,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_das1800.c_setup_dma.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	setup_dma, %function
setup_dma:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r4, .L14
	ldr	r3, .L14+4
	ldr	r6, [r4]
	ldr	r3, [r3]
	ldr	r5, [r6]
	sub	sp, sp, #8
	tst	r5, r3
	str	r1, [sp, #4]
	bne	.L12
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L12:
	ldr	r3, .L14+8
	add	r0, sp, #4
	ldr	r7, [r3]
	bl	suggest_transfer_size
	str	r0, [r6, #8]
	bl	claim_dma_lock
	ldr	r3, [r4]
	mov	r6, r0
	ldr	r0, [r3, #16]
	bl	disable_dma
	ldr	r3, [r4]
	ldr	r0, [r3, #16]
	bl	clear_dma_ff
	ldr	r3, [r4]
	ldr	r0, [r3, #20]
	ldr	r8, [r3, #16]
	bl	virt_to_bus
	mov	r1, r0
	mov	r0, r8
	bl	set_dma_addr
	ldr	r3, [r4]
	ldr	r1, [r3, #8]
	ldr	r0, [r3, #16]
	bl	set_dma_count
	ldr	r3, [r4]
	ldr	r2, [r3, #20]
	ldr	r0, [r3, #16]
	str	r2, [r3, #24]
	str	r0, [r3, #28]
	bl	enable_dma
	tst	r5, r7
	bne	.L13
.L3:
	mov	r0, r6
	bl	release_dma_lock
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L13:
	ldr	r3, [r4]
	ldr	r0, [r3, #4]
	bl	disable_dma
	ldr	r3, [r4]
	ldr	r0, [r3, #4]
	bl	clear_dma_ff
	ldr	r3, [r4]
	ldr	r0, [r3, #12]
	ldr	r5, [r3, #4]
	bl	virt_to_bus
	mov	r1, r0
	mov	r0, r5
	bl	set_dma_addr
	ldr	r3, [r4]
	ldmib	r3, {r0, r1}
	bl	set_dma_count
	ldr	r3, [r4]
	ldr	r0, [r3, #4]
	bl	enable_dma
	b	.L3
.L15:
	.align	2
.L14:
	.word	devpriv
	.word	DMA_ENABLED
	.word	DMA_DUAL
	.size	setup_dma, .-setup_dma
	.comm	devpriv,4,4
	.comm	DMA_ENABLED,4,4
	.comm	DMA_DUAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
