	.file	"extr_pmb.c_pmb_bolt_mapping.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	pmb_bolt_mapping
	.type	pmb_bolt_mapping, @function
pmb_bolt_mapping:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	cmp	QWORD PTR SZ_16M[rip], rdx
	mov	QWORD PTR 32[rsp], rdi
	jbe	.L2
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
.L1:
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L2:
	.cfi_restore_state
	mov	rdi, QWORD PTR 32[rsp]
	mov	r13, rsi
	mov	rsi, rdx
	mov	rbx, rdx
	mov	ebp, ecx
	call	pmb_addr_valid@PLT
	test	eax, eax
	jne	.L4
	mov	eax, DWORD PTR EFAULT[rip]
	add	rsp, 56
	.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
.L4:
	.cfi_restore_state
	mov	r14, QWORD PTR 32[rsp]
	mov	rdx, rbx
	mov	rsi, r13
	mov	rdi, r14
	call	pmb_mapping_exists@PLT
	mov	r8, rax
	xor	eax, eax
	test	r8, r8
	jne	.L1
	lea	rax, [rbx+r14]
	mov	rdi, r14
	xor	r15d, r15d
	mov	rsi, rax
	mov	QWORD PTR 40[rsp], rax
	call	flush_tlb_kernel_range@PLT
	mov	edi, ebp
	call	pgprot_to_pmb_flags@PLT
	mov	QWORD PTR 24[rsp], rax
.L11:
	mov	DWORD PTR 20[rsp], 0
	mov	rdi, QWORD PTR pmb_sizes[rip]
	xor	r12d, r12d
	.p2align 4,,10
	.p2align 3
.L5:
	call	ARRAY_SIZE@PLT
	cmp	eax, r12d
	jle	.L19
.L10:
	mov	rdi, QWORD PTR pmb_sizes[rip]
	movsx	r8, r12d
	sal	r8, 4
	lea	rax, [rdi+r8]
	cmp	QWORD PTR [rax], rbx
	jbe	.L6
	add	r12d, 1
	call	ARRAY_SIZE@PLT
	cmp	eax, r12d
	jg	.L10
.L19:
	cmp	QWORD PTR SZ_16M[rip], rbx
	jbe	.L11
	mov	rsi, QWORD PTR 40[rsp]
	mov	rdi, QWORD PTR 32[rsp]
	call	flush_cache_vmap@PLT
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L6:
	mov	ecx, DWORD PTR PMB_NO_ENTRY[rip]
	mov	rsi, r13
	mov	rdi, r14
	mov	QWORD PTR [rsp], r8
	mov	rdx, QWORD PTR 24[rsp]
	or	rdx, QWORD PTR 8[rax]
	call	pmb_alloc@PLT
	mov	rdi, rax
	mov	rbp, rax
	call	IS_ERR@PLT
	mov	r8, QWORD PTR [rsp]
	test	rax, rax
	jne	.L20
	lea	r9, 8[rbp]
	xor	esi, esi
	mov	QWORD PTR 8[rsp], r8
	mov	rdi, r9
	mov	QWORD PTR [rsp], r9
	call	raw_spin_lock_irqsave@PLT
	mov	rax, QWORD PTR pmb_sizes[rip]
	mov	r8, QWORD PTR 8[rsp]
	mov	rdi, rbp
	mov	rax, QWORD PTR [rax+r8]
	mov	QWORD PTR 0[rbp], rax
	call	__set_pmb_entry@PLT
	mov	rax, QWORD PTR 0[rbp]
	mov	rdi, r15
	add	r13, rax
	add	r14, rax
	sub	rbx, rax
	call	likely@PLT
	mov	r9, QWORD PTR [rsp]
	test	rax, rax
	jne	.L21
.L9:
	mov	rdi, r9
	xor	esi, esi
	add	DWORD PTR 20[rsp], 1
	mov	r15, rbp
	call	raw_spin_unlock_irqrestore@PLT
	mov	rdi, QWORD PTR pmb_sizes[rip]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L21:
	mov	esi, DWORD PTR SINGLE_DEPTH_NESTING[rip]
	lea	rdi, 8[r15]
	mov	QWORD PTR 8[rsp], r9
	mov	QWORD PTR [rsp], rdi
	call	raw_spin_lock_nested@PLT
	mov	QWORD PTR 16[r15], rbp
	mov	rdi, QWORD PTR [rsp]
	call	raw_spin_unlock@PLT
	mov	r9, QWORD PTR 8[rsp]
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L20:
	mov	esi, DWORD PTR 20[rsp]
	mov	rdi, r15
	call	pmb_unmap_entry@PLT
	add	rsp, 56
	.cfi_def_cfa_offset 56
	mov	rdi, rbp
	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
	jmp	PTR_ERR@PLT
	.cfi_endproc
.LFE0:
	.size	pmb_bolt_mapping, .-pmb_bolt_mapping
	.comm	pmb_sizes,8,8
	.comm	SZ_16M,8,8
	.comm	SINGLE_DEPTH_NESTING,4,4
	.comm	PMB_NO_ENTRY,4,4
	.comm	EINVAL,4,4
	.comm	EFAULT,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_pmb.c_pmb_bolt_mapping.c"
	.text
	.align	2
	.global	pmb_bolt_mapping
	.syntax unified
	.arm
	.fpu softvfp
	.type	pmb_bolt_mapping, %function
pmb_bolt_mapping:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, r2
	ldr	r2, .L22
	sub	sp, sp, #28
	ldr	r2, [r2]
	str	r0, [sp, #16]
	cmp	r2, r6
	bls	.L2
	ldr	r3, .L22+4
	ldr	r0, [r3]
	rsb	r3, r0, #0
	str	r3, [sp, #12]
.L1:
	ldr	r0, [sp, #12]
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	mov	r7, r1
	mov	r1, r6
	mov	r4, r3
	bl	pmb_addr_valid
	cmp	r0, #0
	bne	.L4
	ldr	r3, .L22+8
	ldr	r0, [r3]
	rsb	r3, r0, #0
	str	r3, [sp, #12]
	ldr	r0, [sp, #12]
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	ldr	fp, [sp, #16]
	mov	r2, r6
	mov	r1, r7
	mov	r0, fp
	bl	pmb_mapping_exists
	subs	r8, r0, #0
	movne	r3, #0
	str	r8, [sp, #12]
	strne	r3, [sp, #12]
	bne	.L1
	add	r2, r6, fp
	mov	r1, r2
	mov	r0, fp
	str	r2, [sp, #20]
	bl	flush_tlb_kernel_range
	mov	r0, r4
	bl	pgprot_to_pmb_flags
	str	r8, [sp]
	ldr	r8, .L22+12
	str	r0, [sp, #8]
.L11:
	mov	r3, #0
	mov	r4, r3
	ldr	r0, [r8]
	str	r3, [sp, #4]
.L5:
	bl	ARRAY_SIZE
	cmp	r0, r4
	ble	.L19
.L10:
	ldr	r0, [r8]
	lsl	r9, r4, #3
	ldr	r3, [r0, r4, lsl #3]
	add	r2, r0, r4, lsl #3
	cmp	r3, r6
	addhi	r4, r4, #1
	bhi	.L5
	ldr	r1, [sp, #8]
	ldr	r2, [r2, #4]
	ldr	r3, .L22+16
	orr	r2, r1, r2
	ldr	r3, [r3]
	mov	r1, r7
	mov	r0, fp
	bl	pmb_alloc
	mov	r5, r0
	add	r10, r0, #4
	bl	IS_ERR
	cmp	r0, #0
	bne	.L20
	mov	r1, #0
	mov	r0, r10
	bl	raw_spin_lock_irqsave
	ldr	r3, [r8]
	ldr	r2, [sp, #4]
	ldr	r3, [r3, r9]
	add	r2, r2, #1
	str	r3, [r5]
	mov	r0, r5
	str	r2, [sp, #4]
	bl	__set_pmb_entry
	ldr	r3, [r5]
	ldr	r0, [sp]
	add	r7, r7, r3
	add	fp, fp, r3
	sub	r6, r6, r3
	bl	likely
	cmp	r0, #0
	bne	.L21
.L9:
	mov	r1, #0
	mov	r0, r10
	str	r5, [sp]
	bl	raw_spin_unlock_irqrestore
	ldr	r0, [r8]
	bl	ARRAY_SIZE
	cmp	r0, r4
	bgt	.L10
.L19:
	ldr	r3, .L22
	ldr	r3, [r3]
	cmp	r3, r6
	bls	.L11
	ldr	r1, [sp, #20]
	ldr	r0, [sp, #16]
	bl	flush_cache_vmap
	b	.L1
.L21:
	ldr	r3, [sp]
	ldr	r2, .L22+20
	add	r9, r3, #4
	mov	r0, r9
	ldr	r1, [r2]
	bl	raw_spin_lock_nested
	ldr	r3, [sp]
	mov	r0, r9
	str	r5, [r3, #8]
	bl	raw_spin_unlock
	b	.L9
.L20:
	ldm	sp, {r0, r1}
	bl	pmb_unmap_entry
	mov	r0, r5
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	PTR_ERR
.L23:
	.align	2
.L22:
	.word	SZ_16M
	.word	EINVAL
	.word	EFAULT
	.word	pmb_sizes
	.word	PMB_NO_ENTRY
	.word	SINGLE_DEPTH_NESTING
	.size	pmb_bolt_mapping, .-pmb_bolt_mapping
	.comm	pmb_sizes,4,4
	.comm	SZ_16M,4,4
	.comm	SINGLE_DEPTH_NESTING,4,4
	.comm	PMB_NO_ENTRY,4,4
	.comm	EINVAL,4,4
	.comm	EFAULT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
