	.file	"extr_amdgpu_dma_buf.c_amdgpu_gem_prime_mmap.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	amdgpu_gem_prime_mmap
	.type	amdgpu_gem_prime_mmap, @function
amdgpu_gem_prime_mmap:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rsi
	call	gem_to_amdgpu_bo@PLT
	mov	edi, DWORD PTR 8[rax]
	mov	rbp, rax
	call	amdgpu_ttm_adev@PLT
	mov	rdi, rbp
	mov	r14, rax
	call	amdgpu_bo_size@PLT
	cmp	QWORD PTR 16[rbx], 0
	je	.L4
	test	r14, r14
	je	.L4
	mov	edx, DWORD PTR [rbx]
	sub	edx, DWORD PTR 4[rbx]
	cmp	edx, eax
	jbe	.L5
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	edi, DWORD PTR 4[rbp]
	call	amdgpu_ttm_tt_get_usermm@PLT
	test	rax, rax
	jne	.L6
	mov	eax, DWORD PTR 0[rbp]
	test	DWORD PTR AMDGPU_GEM_CREATE_NO_CPU_ACCESS[rip], eax
	je	.L7
.L6:
	mov	r12d, DWORD PTR EPERM[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	neg	r12d
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	r12d, DWORD PTR ENODEV[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	neg	r12d
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	mov	rdi, rbp
	call	amdgpu_bo_mmap_offset@PLT
	mov	ecx, DWORD PTR PAGE_SHIFT[rip]
	mov	rdi, r13
	sar	eax, cl
	add	DWORD PTR 8[rbx], eax
	mov	rax, QWORD PTR 16[rbx]
	mov	esi, DWORD PTR [rax]
	call	drm_vma_node_allow@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	rdi, QWORD PTR 16[rbx]
	mov	rsi, rbx
	mov	rdx, r14
	call	ttm_bo_mmap@PLT
	mov	rdi, r13
	mov	r12d, eax
	mov	rax, QWORD PTR 16[rbx]
	mov	esi, DWORD PTR [rax]
	call	drm_vma_node_revoke@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	amdgpu_gem_prime_mmap, .-amdgpu_gem_prime_mmap
	.comm	PAGE_SHIFT,4,4
	.comm	EPERM,4,4
	.comm	ENODEV,4,4
	.comm	EINVAL,4,4
	.comm	AMDGPU_GEM_CREATE_NO_CPU_ACCESS,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_amdgpu_dma_buf.c_amdgpu_gem_prime_mmap.c"
	.text
	.align	2
	.global	amdgpu_gem_prime_mmap
	.syntax unified
	.arm
	.fpu softvfp
	.type	amdgpu_gem_prime_mmap, %function
amdgpu_gem_prime_mmap:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r1
	mov	r7, r0
	bl	gem_to_amdgpu_bo
	mov	r5, r0
	ldr	r0, [r0, #8]
	bl	amdgpu_ttm_adev
	mov	r6, r0
	mov	r0, r5
	bl	amdgpu_bo_size
	ldr	r3, [r4, #12]
	cmp	r3, #0
	beq	.L4
	cmp	r6, #0
	beq	.L4
	ldr	r3, [r4]
	ldr	r2, [r4, #4]
	sub	r3, r3, r2
	cmp	r3, r0
	bls	.L5
	ldr	r3, .L13
	ldr	r5, [r3]
	rsb	r5, r5, #0
.L1:
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L5:
	ldr	r0, [r5, #4]
	bl	amdgpu_ttm_tt_get_usermm
	cmp	r0, #0
	bne	.L6
	ldr	r3, .L13+4
	ldr	r2, [r5]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L7
.L6:
	ldr	r3, .L13+8
	ldr	r5, [r3]
	rsb	r5, r5, #0
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L4:
	ldr	r3, .L13+12
	ldr	r5, [r3]
	rsb	r5, r5, #0
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L7:
	mov	r0, r5
	bl	amdgpu_bo_mmap_offset
	ldr	r2, .L13+16
	ldr	r3, [r4, #8]
	ldr	r1, [r2]
	ldr	r2, [r4, #12]
	add	r3, r3, r0, asr r1
	str	r3, [r4, #8]
	mov	r0, r7
	ldr	r1, [r2]
	bl	drm_vma_node_allow
	subs	r5, r0, #0
	bne	.L1
	mov	r1, r4
	mov	r2, r6
	ldr	r0, [r4, #12]
	bl	ttm_bo_mmap
	ldr	r3, [r4, #12]
	mov	r5, r0
	ldr	r1, [r3]
	mov	r0, r7
	bl	drm_vma_node_revoke
	b	.L1
.L14:
	.align	2
.L13:
	.word	EINVAL
	.word	AMDGPU_GEM_CREATE_NO_CPU_ACCESS
	.word	EPERM
	.word	ENODEV
	.word	PAGE_SHIFT
	.size	amdgpu_gem_prime_mmap, .-amdgpu_gem_prime_mmap
	.comm	PAGE_SHIFT,4,4
	.comm	EPERM,4,4
	.comm	ENODEV,4,4
	.comm	EINVAL,4,4
	.comm	AMDGPU_GEM_CREATE_NO_CPU_ACCESS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
