---
title: OSAddAtomic16
framework: kernel
role: symbol
role_heading: Function
path: kernel/1576475-osaddatomic16
---

# OSAddAtomic16

16-bit add operation, performed atomically with respect to all devices that participate in the coherency architecture of the platform.

## Declaration

```occ
SInt16 OSAddAtomic16(SInt32 amount, volatile SInt16 *address);
```

## Parameters

- `address`: The 2-byte aligned address of the value to update atomically.

## Return Value

Return Value The value before the addition

## Discussion

Discussion The OSAddAtomic16 function adds the specified amount to the value at the specified address and returns the original value. This function guarantees atomicity only with main system memory. It is specifically unsuitable for use on noncacheable memory such as that in devices; this function cannot guarantee atomicity, for example, on memory mapped from a PCI device. Previous incarnations of this function incorporated a memory barrier on systems with weakly-ordered memory architectures, but current versions contain no barriers.

## See Also

### Additions

- [OSAddAtomic](kernel/1576452-osaddatomic.md)
- [OSAddAtomic8](kernel/1576483-osaddatomic8.md)
- [OSAddAtomic64](kernel/1576451-osaddatomic64.md)
