@@ -750,43 +750,41 @@ for swapping 64-bit quantities and another for 32-bit quantities.
750750
751751@table @code
752752@item aadd [rd + offset16], rs
753- @itemx *(u64 *)(rd + offset16) = rs
753+ @itemx lock *(u64 *)(rd + offset16) = rs
754754Atomic add instruction.
755755
756756@item aor [rd + offset16], rs
757- @itemx *(u64 *) (rd + offset16) |= rs
757+ @itemx lock *(u64 *) (rd + offset16) |= rs
758758Atomic or instruction.
759759
760760@item aand [rd + offset16], rs
761- @itemx *(u64 *) (rd + offset16) &= rs
761+ @itemx lock *(u64 *) (rd + offset16) &= rs
762762Atomic and instruction.
763763
764764@item axor [rd + offset16], rs
765- @itemx *(u64 *) (rd + offset16) ^= rs
766- Atomic xor instruction
767- @item xaddw [%d+offset16],%s
768- Exchange-and-add a 32-bit value at the specified location.
765+ @itemx lock *(u64 *) (rd + offset16) ^= rs
766+ Atomic xor instruction.
769767@end table
770768
771769@noindent
772770The following variants perform fetching before the atomic operation.
773771
774772@table @code
775- @item afadd [dr + offset16], rs
776- @itemx ???
773+ @item afadd [rd + offset16], rs
774+ @itemx rs = atomic_fetch_add ((u64 *)(rd + offset16), rs)
777775Atomic fetch-and-add instruction.
778776
779- @item afor [dr + offset16], rs
780- @itemx ???
777+ @item afor [rd + offset16], rs
778+ @itemx rs = atomic_fetch_or ((u64 *)(rd + offset16), rs)
781779Atomic fetch-and-or instruction.
782780
783- @item afand [dr + offset16], rs
784- @itemx ???
781+ @item afand [rd + offset16], rs
782+ @itemx rs = atomic_fetch_and ((u64 *)(rd + offset16), rs)
785783Atomic fetch-and-and instruction.
786784
787- @item afxor [dr + offset16], rs
788- @itemx ???
789- Atomic fetch-and-or instruction
785+ @item afxor [rd + offset16], rs
786+ @itemx rs = atomic_fetch_xor ((u64 *)(rd + offset16), rs)
787+ Atomic fetch-and-or instruction.
790788@end table
791789
792790The above instructions were introduced in the V3 of the BPF
@@ -805,19 +803,19 @@ for swapping 32-bit quantities and another for 32-bit quantities.
805803
806804@table @code
807805@item aadd32 [rd + offset16], rs
808- @itemx *(u32 *)(rd + offset16) = rs
806+ @itemx lock *(u32 *)(rd + offset16) = rs
809807Atomic add instruction.
810808
811809@item aor32 [rd + offset16], rs
812- @itemx *(u32 *) (rd + offset16) |= rs
810+ @itemx lock *(u32 *) (rd + offset16) |= rs
813811Atomic or instruction.
814812
815813@item aand32 [rd + offset16], rs
816- @itemx *(u32 *) (rd + offset16) &= rs
814+ @itemx lock *(u32 *) (rd + offset16) &= rs
817815Atomic and instruction.
818816
819817@item axor32 [rd + offset16], rs
820- @itemx *(u32 *) (rd + offset16) ^= rs
818+ @itemx lock *(u32 *) (rd + offset16) ^= rs
821819Atomic xor instruction
822820@end table
823821
@@ -826,19 +824,19 @@ The following variants perform fetching before the atomic operation.
826824
827825@table @code
828826@item afadd32 [dr + offset16], rs
829- @itemx ???
827+ @itemx ws = atomic_fetch_add ((u32 *)(rd + offset16), ws)
830828Atomic fetch-and-add instruction.
831829
832830@item afor32 [dr + offset16], rs
833- @itemx ???
831+ @itemx ws = atomic_fetch_or ((u32 *)(rd + offset16), ws)
834832Atomic fetch-and-or instruction.
835833
836834@item afand32 [dr + offset16], rs
837- @itemx ???
835+ @itemx ws = atomic_fetch_and ((u32 *)(rd + offset16), ws)
838836Atomic fetch-and-and instruction.
839837
840838@item afxor32 [dr + offset16], rs
841- @itemx ???
839+ @itemx ws = atomic_fetch_xor ((u32 *)(rd + offset16), ws)
842840Atomic fetch-and-or instruction
843841@end table
844842
0 commit comments