	.file	"extr_plxsata_ide.c_wait_dma_not_busy.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"wait_dma_not_busy() Timed out of wait for DMA not busy\n"
	.align 8
.LC1:
	.string	"wait_dma_not_busy() Timed out of wait for DMA channel abort\n"
	.text
	.p2align 4
	.type	wait_dma_not_busy, @function
wait_dma_not_busy:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	ebx, DWORD PTR MAX_DMA_XFER_LOOPS[rip]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L20:
	mov	edi, 100
	call	udelay@PLT
	sub	ebx, 1
	je	.L5
.L3:
	xor	eax, eax
	call	dma_busy@PLT
	test	eax, eax
	jne	.L20
	test	ebx, ebx
	je	.L5
	mov	r12d, 1
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	lea	rdi, .LC0[rip]
	call	printf@PLT
	mov	rdi, QWORD PTR DMA_CTRL_STATUS[rip]
	add	rdi, QWORD PTR SATA_DMA_CHANNEL[rip]
	call	readl@PLT
	or	eax, DWORD PTR DMA_CTRL_STATUS_RESET[rip]
	mov	rsi, QWORD PTR DMA_CTRL_STATUS[rip]
	mov	edi, eax
	add	rsi, QWORD PTR SATA_DMA_CHANNEL[rip]
	call	writel@PLT
	mov	ebx, DWORD PTR MAX_DMA_ABORT_LOOPS[rip]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L21:
	mov	edi, 10
	call	udelay@PLT
	sub	ebx, 1
	je	.L9
.L4:
	xor	eax, eax
	call	dma_busy@PLT
	test	eax, eax
	jne	.L21
	test	ebx, ebx
	je	.L9
	mov	r12d, 1
.L8:
	mov	rdi, QWORD PTR DMA_CTRL_STATUS[rip]
	add	rdi, QWORD PTR SATA_DMA_CHANNEL[rip]
	call	readl@PLT
	mov	edi, DWORD PTR DMA_CTRL_STATUS_RESET[rip]
	mov	rsi, QWORD PTR DMA_CTRL_STATUS[rip]
	add	rsi, QWORD PTR SATA_DMA_CHANNEL[rip]
	not	edi
	and	edi, eax
	call	writel@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	lea	rdi, .LC1[rip]
	xor	r12d, r12d
	call	printf@PLT
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	wait_dma_not_busy, .-wait_dma_not_busy
	.comm	SATA_DMA_CHANNEL,8,8
	.comm	MAX_DMA_XFER_LOOPS,4,4
	.comm	MAX_DMA_ABORT_LOOPS,4,4
	.comm	DMA_CTRL_STATUS_RESET,4,4
	.comm	DMA_CTRL_STATUS,8,8
	.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_plxsata_ide.c_wait_dma_not_busy.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"wait_dma_not_busy() Timed out of wait for DMA not b"
	.ascii	"usy\012\000"
	.align	2
.LC1:
	.ascii	"wait_dma_not_busy() Timed out of wait for DMA chann"
	.ascii	"el abort\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	wait_dma_not_busy, %function
wait_dma_not_busy:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L22
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r4, [r3]
	b	.L3
.L20:
	mov	r0, #100
	bl	udelay
	subs	r4, r4, #1
	beq	.L5
.L3:
	bl	dma_busy
	cmp	r0, #0
	bne	.L20
	cmp	r4, #0
	beq	.L5
	mov	r4, #1
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L5:
	ldr	r6, .L22+4
	ldr	r5, .L22+8
	ldr	r0, .L22+12
	bl	printf
	ldr	r3, [r5]
	ldr	r0, [r6]
	ldr	r7, .L22+16
	add	r0, r0, r3
	bl	readl
	ldr	r3, [r5]
	ldr	r2, [r7]
	ldr	r1, [r6]
	orr	r0, r0, r2
	add	r1, r1, r3
	bl	writel
	ldr	r3, .L22+20
	ldr	r4, [r3]
	b	.L4
.L21:
	mov	r0, #10
	bl	udelay
	subs	r4, r4, #1
	beq	.L9
.L4:
	bl	dma_busy
	cmp	r0, #0
	bne	.L21
	cmp	r4, #0
	beq	.L9
	mov	r4, #1
.L8:
	ldr	r3, [r5]
	ldr	r0, [r6]
	add	r0, r0, r3
	bl	readl
	ldr	r1, [r6]
	ldr	r2, [r5]
	ldr	r3, [r7]
	add	r1, r1, r2
	bic	r0, r0, r3
	bl	writel
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L9:
	ldr	r0, .L22+24
	bl	printf
	mov	r4, #0
	b	.L8
.L23:
	.align	2
.L22:
	.word	MAX_DMA_XFER_LOOPS
	.word	SATA_DMA_CHANNEL
	.word	DMA_CTRL_STATUS
	.word	.LC0
	.word	DMA_CTRL_STATUS_RESET
	.word	MAX_DMA_ABORT_LOOPS
	.word	.LC1
	.size	wait_dma_not_busy, .-wait_dma_not_busy
	.comm	SATA_DMA_CHANNEL,4,4
	.comm	MAX_DMA_XFER_LOOPS,4,4
	.comm	MAX_DMA_ABORT_LOOPS,4,4
	.comm	DMA_CTRL_STATUS_RESET,4,4
	.comm	DMA_CTRL_STATUS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
