	.file	"extr_cxllib.c_cxllib_switch_phb_mode.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	cxllib_switch_phb_mode
	.type	cxllib_switch_phb_mode, @function
cxllib_switch_phb_mode:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	mov	edi, DWORD PTR CPU_FTR_HVMODE[rip]
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	ebx, esi
	call	cpu_has_feature@PLT
	test	eax, eax
	je	.L9
	cmp	ebx, 128
	je	.L4
	cmp	ebx, 129
	je	.L5
.L9:
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	cmp	QWORD PTR CXL_MODE_DMA_TVT1[rip], r12
	jne	.L9
	mov	esi, DWORD PTR OPAL_PHB_CAPI_MODE_DMA_TVT1[rip]
	mov	rdi, rbp
	call	pnv_phb_to_cxl_mode@PLT
	test	eax, eax
	jne	.L1
	mov	esi, DWORD PTR OPAL_PHB_CAPI_MODE_SNOOP_ON[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	pnv_phb_to_cxl_mode@PLT
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	esi, DWORD PTR OPAL_PHB_CAPI_MODE_SNOOP_OFF[rip]
	mov	rdi, rbp
	call	pnv_phb_to_cxl_mode@PLT
	test	eax, eax
	je	.L7
	mov	eax, DWORD PTR EBUSY[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	mov	eax, DWORD PTR EPERM[rip]
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.cfi_endproc
.LFE0:
	.size	cxllib_switch_phb_mode, .-cxllib_switch_phb_mode
	.comm	OPAL_PHB_CAPI_MODE_SNOOP_ON,4,4
	.comm	OPAL_PHB_CAPI_MODE_SNOOP_OFF,4,4
	.comm	OPAL_PHB_CAPI_MODE_DMA_TVT1,4,4
	.comm	EPERM,4,4
	.comm	EINVAL,4,4
	.comm	EBUSY,4,4
	.comm	CXL_MODE_DMA_TVT1,8,8
	.comm	CPU_FTR_HVMODE,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_cxllib.c_cxllib_switch_phb_mode.c"
	.text
	.align	2
	.global	cxllib_switch_phb_mode
	.syntax unified
	.arm
	.fpu softvfp
	.type	cxllib_switch_phb_mode, %function
cxllib_switch_phb_mode:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L12
	push	{r4, r5, r6, lr}
	mov	r5, r0
	ldr	r0, [r3]
	mov	r4, r1
	mov	r6, r2
	bl	cpu_has_feature
	cmp	r0, #0
	beq	.L9
	cmp	r4, #128
	beq	.L4
	cmp	r4, #129
	beq	.L5
.L9:
	ldr	r3, .L12+4
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, pc}
.L5:
	ldr	r3, .L12+8
	ldr	r3, [r3]
	cmp	r3, r6
	bne	.L9
	ldr	r3, .L12+12
	mov	r0, r5
	ldr	r1, [r3]
	bl	pnv_phb_to_cxl_mode
	cmp	r0, #0
	popne	{r4, r5, r6, pc}
	ldr	r3, .L12+16
	mov	r0, r5
	pop	{r4, r5, r6, lr}
	ldr	r1, [r3]
	b	pnv_phb_to_cxl_mode
.L4:
	ldr	r3, .L12+20
	mov	r0, r5
	ldr	r1, [r3]
	bl	pnv_phb_to_cxl_mode
	cmp	r0, #0
	ldrne	r3, .L12+24
	ldreq	r3, .L12+28
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, pc}
.L13:
	.align	2
.L12:
	.word	CPU_FTR_HVMODE
	.word	EINVAL
	.word	CXL_MODE_DMA_TVT1
	.word	OPAL_PHB_CAPI_MODE_DMA_TVT1
	.word	OPAL_PHB_CAPI_MODE_SNOOP_ON
	.word	OPAL_PHB_CAPI_MODE_SNOOP_OFF
	.word	EBUSY
	.word	EPERM
	.size	cxllib_switch_phb_mode, .-cxllib_switch_phb_mode
	.comm	OPAL_PHB_CAPI_MODE_SNOOP_ON,4,4
	.comm	OPAL_PHB_CAPI_MODE_SNOOP_OFF,4,4
	.comm	OPAL_PHB_CAPI_MODE_DMA_TVT1,4,4
	.comm	EPERM,4,4
	.comm	EINVAL,4,4
	.comm	EBUSY,4,4
	.comm	CXL_MODE_DMA_TVT1,4,4
	.comm	CPU_FTR_HVMODE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
