mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
include/exec/memop: Introduce memop_atomicity_bits
Split out of mmu_lookup. Reviewed-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
c5809eee45
commit
e5b063e81f
2 changed files with 26 additions and 14 deletions
|
@ -193,4 +193,28 @@ static inline unsigned memop_alignment_bits(MemOp memop)
|
|||
return a;
|
||||
}
|
||||
|
||||
/*
|
||||
* memop_atomicity_bits:
|
||||
* @memop: MemOp value
|
||||
*
|
||||
* Extract the atomicity size from the memop.
|
||||
*/
|
||||
static inline unsigned memop_atomicity_bits(MemOp memop)
|
||||
{
|
||||
unsigned size = memop & MO_SIZE;
|
||||
|
||||
switch (memop & MO_ATOM_MASK) {
|
||||
case MO_ATOM_NONE:
|
||||
size = MO_8;
|
||||
break;
|
||||
case MO_ATOM_IFALIGN_PAIR:
|
||||
case MO_ATOM_WITHIN16_PAIR:
|
||||
size = size ? size - 1 : 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue