mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-26 06:04:14 +08:00
b886d83c5b
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation version 2 of the license extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 315 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Armijn Hemel <armijn@tjaldur.nl> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190531190115.503150771@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
47 lines
737 B
ArmAsm
47 lines
737 B
ArmAsm
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
#include <linux/linkage.h>
|
|
#include <asm/export.h>
|
|
|
|
.text
|
|
|
|
/*
|
|
* Inputs:
|
|
* %esi : memory location to compare
|
|
* %eax : low 32 bits of old value
|
|
* %edx : high 32 bits of old value
|
|
* %ebx : low 32 bits of new value
|
|
* %ecx : high 32 bits of new value
|
|
*/
|
|
ENTRY(cmpxchg8b_emu)
|
|
|
|
#
|
|
# Emulate 'cmpxchg8b (%esi)' on UP except we don't
|
|
# set the whole ZF thing (caller will just compare
|
|
# eax:edx with the expected value)
|
|
#
|
|
pushfl
|
|
cli
|
|
|
|
cmpl (%esi), %eax
|
|
jne .Lnot_same
|
|
cmpl 4(%esi), %edx
|
|
jne .Lhalf_same
|
|
|
|
movl %ebx, (%esi)
|
|
movl %ecx, 4(%esi)
|
|
|
|
popfl
|
|
ret
|
|
|
|
.Lnot_same:
|
|
movl (%esi), %eax
|
|
.Lhalf_same:
|
|
movl 4(%esi), %edx
|
|
|
|
popfl
|
|
ret
|
|
|
|
ENDPROC(cmpxchg8b_emu)
|
|
EXPORT_SYMBOL(cmpxchg8b_emu)
|