/*1* This program is free software; you can redistribute it and/or2* modify it under the terms of the GNU General Public License3* as published by the Free Software Foundation; version 24* of the License.5*6*/78#include <linux/linkage.h>9#include <asm/alternative-asm.h>10#include <asm/frame.h>11#include <asm/dwarf2.h>121314.text1516/*17* Inputs:18* %esi : memory location to compare19* %eax : low 32 bits of old value20* %edx : high 32 bits of old value21* %ebx : low 32 bits of new value22* %ecx : high 32 bits of new value23*/24ENTRY(cmpxchg8b_emu)25CFI_STARTPROC2627#28# Emulate 'cmpxchg8b (%esi)' on UP except we don't29# set the whole ZF thing (caller will just compare30# eax:edx with the expected value)31#32cmpxchg8b_emu:33pushfl34cli3536cmpl (%esi), %eax37jne not_same38cmpl 4(%esi), %edx39jne half_same4041movl %ebx, (%esi)42movl %ecx, 4(%esi)4344popfl45ret4647not_same:48movl (%esi), %eax49half_same:50movl 4(%esi), %edx5152popfl53ret5455CFI_ENDPROC56ENDPROC(cmpxchg8b_emu)575859