	.file	"extr_dma.c_rsxx_dma_setup.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Initializing %d DMA targets\n"
	.text
	.p2align 4
	.globl	rsxx_dma_setup
	.type	rsxx_dma_setup, @function
rsxx_dma_setup:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	r12d, DWORD PTR [rdi]
	call	CARD_TO_DEV@PLT
	lea	rsi, .LC0[rip]
	mov	edi, eax
	mov	edx, r12d
	call	dev_info@PLT
	mov	eax, DWORD PTR 0[rbp]
	test	eax, eax
	jle	.L6
	mov	rcx, QWORD PTR 48[rbp]
	lea	esi, -1[rax]
	mov	rdx, QWORD PTR 16[rbp]
	sal	rsi, 12
	lea	rax, 4096[rcx]
	add	rdx, 72
	add	rsi, rax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L45:
	add	rax, 4096
.L5:
	mov	QWORD PTR [rdx], rcx
	mov	rcx, rax
	add	rdx, 80
	cmp	rax, rsi
	jne	.L45
.L6:
	mov	QWORD PTR 40[rbp], 0
	mov	rdi, rbp
	call	rsxx_dma_queue_reset@PLT
	mov	ecx, DWORD PTR 0[rbp]
	test	ecx, ecx
	jle	.L4
	mov	rsi, QWORD PTR 16[rbp]
	xor	r12d, r12d
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rsi, QWORD PTR 16[rbp]
	add	rbx, rsi
	mov	DWORD PTR [rbx], r12d
	add	r12, 1
	mov	QWORD PTR 64[rbx], rbp
	cmp	DWORD PTR 0[rbp], r12d
	jle	.L4
.L12:
	lea	rbx, [r12+r12*4]
	mov	rdi, QWORD PTR 8[rbp]
	sal	rbx, 4
	add	rsi, rbx
	call	rsxx_dma_ctrl_init@PLT
	mov	r13d, eax
	test	eax, eax
	je	.L9
	mov	edx, DWORD PTR 0[rbp]
	xor	r12d, r12d
	test	edx, edx
	jg	.L10
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rdx, QWORD PTR 32[rbx]
	test	rdx, rdx
	jne	.L46
.L19:
	mov	rdx, QWORD PTR 16[rbx]
	test	rdx, rdx
	jne	.L47
.L20:
	add	r12, 1
	cmp	DWORD PTR 0[rbp], r12d
	jle	.L1
.L10:
	lea	rbx, [r12+r12*4]
	sal	rbx, 4
	add	rbx, QWORD PTR 16[rbp]
	mov	rdi, QWORD PTR 56[rbx]
	test	rdi, rdi
	je	.L16
	call	destroy_workqueue@PLT
	mov	QWORD PTR 56[rbx], 0
.L16:
	mov	rdi, QWORD PTR 48[rbx]
	test	rdi, rdi
	je	.L17
	call	destroy_workqueue@PLT
	mov	QWORD PTR 48[rbx], 0
.L17:
	mov	rdi, QWORD PTR 40[rbx]
	test	rdi, rdi
	je	.L18
	call	vfree@PLT
	mov	rdx, QWORD PTR 32[rbx]
	test	rdx, rdx
	je	.L19
.L46:
	mov	ecx, DWORD PTR 24[rbx]
	mov	rdi, QWORD PTR 8[rbp]
	mov	esi, DWORD PTR STATUS_BUFFER_SIZE8[rip]
	call	dma_free_coherent@PLT
	mov	rdx, QWORD PTR 16[rbx]
	test	rdx, rdx
	je	.L20
.L47:
	mov	ecx, DWORD PTR 8[rbx]
	mov	rdi, QWORD PTR 8[rbp]
	mov	esi, DWORD PTR COMMAND_BUFFER_SIZE8[rip]
	call	dma_free_coherent@PLT
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L4:
	cmp	QWORD PTR 32[rbp], 0
	mov	DWORD PTR 4[rbp], 1
	jne	.L48
	mov	eax, DWORD PTR 0[rbp]
	lea	r13, 24[rbp]
	xor	ebx, ebx
	test	eax, eax
	jle	.L15
	.p2align 4,,10
	.p2align 3
.L14:
	xor	r12d, r12d
	mov	rdi, r13
	mov	rsi, r12
	call	spin_lock_irqsave@PLT
	mov	edi, ebx
	add	ebx, 1
	call	CR_INTR_DMA@PLT
	mov	rdi, rbp
	mov	esi, eax
	call	rsxx_enable_ier_and_isr@PLT
	mov	rsi, r12
	mov	rdi, r13
	call	spin_unlock_irqrestore@PLT
	cmp	DWORD PTR 0[rbp], ebx
	jg	.L14
.L15:
	xor	r13d, r13d
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L48:
	.cfi_restore_state
	mov	rdi, rbp
	lea	r13, 24[rbp]
	xor	ebx, ebx
	call	rsxx_dma_configure@PLT
	mov	eax, DWORD PTR 0[rbp]
	test	eax, eax
	jg	.L14
	jmp	.L15
	.cfi_endproc
.LFE0:
	.size	rsxx_dma_setup, .-rsxx_dma_setup
	.comm	STATUS_BUFFER_SIZE8,4,4
	.comm	COMMAND_BUFFER_SIZE8,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_dma.c_rsxx_dma_setup.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Initializing %d DMA targets\012\000"
	.text
	.align	2
	.global	rsxx_dma_setup
	.syntax unified
	.arm
	.fpu softvfp
	.type	rsxx_dma_setup, %function
rsxx_dma_setup:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	bl	CARD_TO_DEV
	ldr	r1, .L46
	ldr	r2, [r4]
	bl	dev_info
	ldr	r1, [r4]
	cmp	r1, #0
	ble	.L6
	ldr	r3, [r4, #28]
	ldr	r2, [r4, #12]
	add	r1, r3, r1, lsl #12
.L5:
	str	r3, [r2, #36]
	add	r3, r3, #4096
	cmp	r3, r1
	add	r2, r2, #40
	bne	.L5
.L6:
	mov	r5, #0
	mov	r0, r4
	str	r5, [r4, #24]
	bl	rsxx_dma_queue_reset
	ldr	r2, [r4]
	cmp	r2, r5
	ldrgt	r1, [r4, #12]
	bgt	.L12
	b	.L4
.L9:
	ldr	r1, [r4, #12]
	ldr	r2, [r4]
	add	r3, r1, r3
	str	r4, [r3, #32]
	str	r5, [r1, r6, lsl #3]
	add	r5, r5, #1
	cmp	r2, r5
	ble	.L4
.L12:
	add	r6, r5, r5, lsl #2
	ldr	r0, [r4, #8]
	add	r1, r1, r6, lsl #3
	bl	rsxx_dma_ctrl_init
	subs	r7, r0, #0
	lsl	r3, r6, #3
	beq	.L9
	ldr	r3, [r4]
	cmp	r3, #0
	ble	.L1
	mov	r6, #0
	ldr	fp, .L46+4
	mov	r8, r6
	mov	r9, r6
	ldr	r10, .L46+8
	b	.L10
.L18:
	ldr	r2, [r5, #16]
	cmp	r2, #0
	bne	.L43
.L19:
	ldr	r2, [r5, #8]
	cmp	r2, #0
	bne	.L44
.L20:
	ldr	r3, [r4]
	add	r8, r8, #1
	cmp	r3, r8
	add	r6, r6, #40
	ble	.L1
.L10:
	ldr	r5, [r4, #12]
	add	r5, r5, r6
	ldr	r0, [r5, #28]
	cmp	r0, #0
	beq	.L16
	bl	destroy_workqueue
	str	r9, [r5, #28]
.L16:
	ldr	r0, [r5, #24]
	cmp	r0, #0
	beq	.L17
	bl	destroy_workqueue
	str	r9, [r5, #24]
.L17:
	ldr	r0, [r5, #20]
	cmp	r0, #0
	beq	.L18
	bl	vfree
	ldr	r2, [r5, #16]
	cmp	r2, #0
	beq	.L19
.L43:
	ldr	r3, [r5, #12]
	ldr	r1, [fp]
	ldr	r0, [r4, #8]
	bl	dma_free_coherent
	ldr	r2, [r5, #8]
	cmp	r2, #0
	beq	.L20
.L44:
	ldr	r3, [r5, #4]
	ldr	r1, [r10]
	ldr	r0, [r4, #8]
	bl	dma_free_coherent
	b	.L20
.L4:
	mov	r1, #1
	ldr	r3, [r4, #20]
	str	r1, [r4, #4]
	cmp	r3, #0
	bne	.L45
	cmp	r2, #0
	movgt	r5, #0
	addgt	r7, r4, #16
	ble	.L15
.L14:
	mov	r6, #0
	mov	r0, r7
	mov	r1, r6
	bl	spin_lock_irqsave
	mov	r0, r5
	bl	CR_INTR_DMA
	mov	r1, r0
	mov	r0, r4
	bl	rsxx_enable_ier_and_isr
	mov	r1, r6
	mov	r0, r7
	bl	spin_unlock_irqrestore
	ldr	r3, [r4]
	add	r5, r5, #1
	cmp	r3, r5
	bgt	.L14
.L15:
	mov	r7, #0
.L1:
	mov	r0, r7
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L45:
	mov	r0, r4
	bl	rsxx_dma_configure
	ldr	r2, [r4]
	cmp	r2, #0
	movgt	r5, #0
	addgt	r7, r4, #16
	bgt	.L14
	b	.L15
.L47:
	.align	2
.L46:
	.word	.LC0
	.word	STATUS_BUFFER_SIZE8
	.word	COMMAND_BUFFER_SIZE8
	.size	rsxx_dma_setup, .-rsxx_dma_setup
	.comm	STATUS_BUFFER_SIZE8,4,4
	.comm	COMMAND_BUFFER_SIZE8,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
