	.file	"extr_mthca_cmd.c_mthca_cmd_init.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Couldn't map command register."
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"mthca_cmd"
	.text
	.p2align 4
	.globl	mthca_cmd_init
	.type	mthca_cmd_init, @function
mthca_cmd_init:
.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
	mov	rbp, rdi
	add	rdi, 28
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	mutex_init@PLT
	lea	rdi, 24[rbp]
	mov	esi, 1
	call	sema_init@PLT
	mov	QWORD PTR 16[rbp], 0
	mov	rdi, QWORD PTR 32[rbp]
	xor	esi, esi
	mov	r12d, DWORD PTR MTHCA_HCR_SIZE[rip]
	call	pci_resource_start@PLT
	add	rax, QWORD PTR MTHCA_HCR_BASE[rip]
	mov	esi, r12d
	mov	rdi, rax
	call	ioremap@PLT
	mov	DWORD PTR 0[rbp], eax
	test	eax, eax
	je	.L7
	mov	edx, DWORD PTR MTHCA_MAILBOX_SIZE[rip]
	mov	rsi, QWORD PTR 32[rbp]
	xor	r8d, r8d
	lea	rdi, .LC1[rip]
	mov	ecx, edx
	call	dma_pool_create@PLT
	xor	r8d, r8d
	mov	DWORD PTR 8[rbp], eax
	test	eax, eax
	je	.L8
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r8d
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	mov	rdi, rbp
	lea	rsi, .LC0[rip]
	call	mthca_err@PLT
	mov	r8d, DWORD PTR ENOMEM[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	neg	r8d
	mov	eax, r8d
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	mov	edi, DWORD PTR 0[rbp]
	call	iounmap@PLT
	mov	r8d, DWORD PTR ENOMEM[rip]
	add	rsp, 8
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	neg	r8d
	mov	eax, r8d
	ret
	.cfi_endproc
.LFE0:
	.size	mthca_cmd_init, .-mthca_cmd_init
	.comm	MTHCA_MAILBOX_SIZE,4,4
	.comm	MTHCA_HCR_SIZE,4,4
	.comm	MTHCA_HCR_BASE,8,8
	.comm	ENOMEM,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_mthca_cmd.c_mthca_cmd_init.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Couldn't map command register.\000"
	.align	2
.LC1:
	.ascii	"mthca_cmd\000"
	.text
	.align	2
	.global	mthca_cmd_init
	.syntax unified
	.arm
	.fpu softvfp
	.type	mthca_cmd_init, %function
mthca_cmd_init:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, lr}
	mov	r4, r0
	mov	r5, #0
	sub	sp, sp, #12
	add	r0, r0, #16
	bl	mutex_init
	mov	r1, #1
	add	r0, r4, #12
	bl	sema_init
	mov	r1, r5
	ldr	r0, [r4, #20]
	str	r5, [r4, #8]
	bl	pci_resource_start
	ldr	r3, .L9
	ldr	r2, .L9+4
	ldr	r3, [r3]
	ldr	r1, [r2]
	add	r0, r0, r3
	bl	ioremap
	cmp	r0, r5
	str	r0, [r4]
	beq	.L7
	ldr	r3, .L9+8
	str	r5, [sp]
	ldr	r3, [r3]
	ldr	r1, [r4, #20]
	mov	r2, r3
	ldr	r0, .L9+12
	bl	dma_pool_create
	cmp	r0, #0
	str	r0, [r4, #4]
	movne	r0, r5
	beq	.L8
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, pc}
.L7:
	mov	r0, r4
	ldr	r1, .L9+16
	bl	mthca_err
	ldr	r3, .L9+20
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, pc}
.L8:
	ldr	r0, [r4]
	bl	iounmap
	ldr	r3, .L9+20
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, pc}
.L10:
	.align	2
.L9:
	.word	MTHCA_HCR_BASE
	.word	MTHCA_HCR_SIZE
	.word	MTHCA_MAILBOX_SIZE
	.word	.LC1
	.word	.LC0
	.word	ENOMEM
	.size	mthca_cmd_init, .-mthca_cmd_init
	.comm	MTHCA_MAILBOX_SIZE,4,4
	.comm	MTHCA_HCR_SIZE,4,4
	.comm	MTHCA_HCR_BASE,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
