	.file	"extr_bnx2x_cmn.c_bnx2x_alloc_rx_sge.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Can't map sge\n"
	.text
	.p2align 4
	.type	bnx2x_alloc_rx_sge, @function
bnx2x_alloc_rx_sge:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	r13, QWORD PTR 24[rsi]
	mov	r14, QWORD PTR 16[rsi]
	mov	rsi, QWORD PTR 8[rsi]
	test	rsi, rsi
	je	.L2
	mov	rdx, QWORD PTR [rbx]
.L3:
	mov	r8d, DWORD PTR DMA_FROM_DEVICE[rip]
	mov	rcx, QWORD PTR SGE_PAGE_SIZE[rip]
	mov	rdi, QWORD PTR [r15]
	call	dma_map_page@PLT
	mov	rdi, QWORD PTR [r15]
	mov	esi, eax
	mov	ebp, eax
	call	dma_mapping_error@PLT
	mov	edi, eax
	call	unlikely@PLT
	test	rax, rax
	jne	.L11
	mov	rax, QWORD PTR 8[rbx]
	sal	r12, 4
	mov	edx, ebp
	mov	esi, ebp
	lea	rdi, 0[r13+r12]
	add	r12, r14
	mov	QWORD PTR 8[rdi], rax
	mov	rax, QWORD PTR [rbx]
	mov	QWORD PTR [rdi], rax
	call	dma_unmap_addr_set@PLT
	mov	edi, ebp
	call	U64_HI@PLT
	mov	edi, eax
	call	cpu_to_le32@PLT
	mov	edi, ebp
	mov	QWORD PTR 8[r12], rax
	call	U64_LO@PLT
	mov	edi, eax
	call	cpu_to_le32@PLT
	mov	rdx, QWORD PTR SGE_PAGE_SIZE[rip]
	mov	rcx, QWORD PTR PAGE_SIZE[rip]
	mov	QWORD PTR [r12], rax
	mov	rax, QWORD PTR [rbx]
	add	rax, rdx
	sub	rcx, rax
	mov	QWORD PTR [rbx], rax
	cmp	rdx, rcx
	jle	.L12
	mov	QWORD PTR 8[rbx], 0
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	lea	rdi, .LC0[rip]
	call	BNX2X_ERR@PLT
.L9:
	mov	eax, DWORD PTR ENOMEM[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	neg	eax
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	esi, DWORD PTR PAGES_PER_SGE_SHIFT[rip]
	mov	edi, ecx
	call	alloc_pages@PLT
	xor	edi, edi
	mov	QWORD PTR 8[rbx], rax
	test	rax, rax
	sete	dil
	call	unlikely@PLT
	mov	rdx, rax
	test	rax, rax
	jne	.L9
	mov	QWORD PTR [rbx], 0
	mov	rsi, QWORD PTR 8[rbx]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L12:
	mov	rdi, QWORD PTR 8[rbx]
	call	get_page@PLT
	add	rsp, 8
	.cfi_def_cfa_offset 56
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	bnx2x_alloc_rx_sge, .-bnx2x_alloc_rx_sge
	.comm	SGE_PAGE_SIZE,8,8
	.comm	PAGE_SIZE,8,8
	.comm	PAGES_PER_SGE_SHIFT,4,4
	.comm	ENOMEM,4,4
	.comm	DMA_FROM_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_bnx2x_cmn.c_bnx2x_alloc_rx_sge.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Can't map sge\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	bnx2x_alloc_rx_sge, %function
bnx2x_alloc_rx_sge:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r1
	ldr	r1, [r1, #4]
	mov	r5, r0
	cmp	r1, #0
	mov	r7, r2
	ldr	r9, [r4, #12]
	ldr	r8, [r4, #8]
	sub	sp, sp, #8
	beq	.L2
	ldr	r2, [r4]
.L3:
	ldr	r3, .L13
	ldr	r10, .L13+4
	ldr	r3, [r3]
	str	r3, [sp]
	ldr	r0, [r5]
	ldr	r3, [r10]
	bl	dma_map_page
	mov	r6, r0
	ldr	r0, [r5]
	mov	r1, r6
	bl	dma_mapping_error
	bl	unlikely
	subs	r5, r0, #0
	bne	.L11
	ldr	r3, [r4]
	ldr	r2, [r4, #4]
	add	r0, r9, r7, lsl #3
	mov	r1, r6
	str	r2, [r0, #4]
	mov	r2, r6
	str	r3, [r9, r7, lsl #3]
	bl	dma_unmap_addr_set
	mov	r0, r6
	bl	U64_HI
	bl	cpu_to_le32
	mov	r2, r0
	add	r3, r8, r7, lsl #3
	str	r2, [r3, #4]
	mov	r0, r6
	bl	U64_LO
	bl	cpu_to_le32
	ldr	r2, .L13+8
	ldr	r1, [r10]
	ldr	r3, [r4]
	ldr	r2, [r2]
	add	r3, r1, r3
	sub	r2, r2, r3
	cmp	r1, r2
	str	r0, [r8, r7, lsl #3]
	str	r3, [r4]
	strgt	r5, [r4, #4]
	ble	.L12
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L11:
	ldr	r0, .L13+12
	bl	BNX2X_ERR
.L9:
	ldr	r3, .L13+16
	ldr	r5, [r3]
	rsb	r5, r5, #0
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2:
	ldr	r2, .L13+20
	mov	r0, r3
	ldr	r1, [r2]
	bl	alloc_pages
	mov	r3, r0
	clz	r0, r0
	str	r3, [r4, #4]
	lsr	r0, r0, #5
	bl	unlikely
	subs	r2, r0, #0
	bne	.L9
	ldr	r1, [r4, #4]
	str	r2, [r4]
	b	.L3
.L12:
	ldr	r0, [r4, #4]
	bl	get_page
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L14:
	.align	2
.L13:
	.word	DMA_FROM_DEVICE
	.word	SGE_PAGE_SIZE
	.word	PAGE_SIZE
	.word	.LC0
	.word	ENOMEM
	.word	PAGES_PER_SGE_SHIFT
	.size	bnx2x_alloc_rx_sge, .-bnx2x_alloc_rx_sge
	.comm	SGE_PAGE_SIZE,4,4
	.comm	PAGE_SIZE,4,4
	.comm	PAGES_PER_SGE_SHIFT,4,4
	.comm	ENOMEM,4,4
	.comm	DMA_FROM_DEVICE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
