--- Cannot embed stylesheet: [Errno 2] No such file or directory: '../../../aros.css' --->
| AllocPotBits() | FreePotBits() | WritePotgo() |
UWORD AllocPotBits(
UWORD bits );
Reserve the currently unallocated bits from a requested POTGO bit mask. Partial allocation is possible: bits already reserved by other callers are excluded from the returned mask.
bits - Mask of POTGO bits to reserve.
The mask of bits actually reserved, which may be a proper subset of bits or zero. If the caller requires the entire mask, compare the result with bits and release any partial allocation with FreePotBits().
Allocation tracks bits, not task ownership. Release the returned mask with FreePotBits() when finished. Allocation does not write the hardware register. This describes the native Amiga implementation. The allocation bitmap is updated without an internal critical section. Callers must serialize competing allocation and release operations; the function itself does not wait.
The implementation does not implement special allocation rules for the START bit; it treats it like any other requested bit.
void FreePotBits(
UWORD allocated );
Release the specified POTGO bits. The bits are cleared in both the allocation bitmap and the resource's saved output value, and the updated output value is immediately written to POTGO.
allocated - Mask of bits previously obtained by AllocPotBits()
and still owned by the caller.
None.
Releasing bits changes their hardware output state; this is not merely an allocation operation. The resource does not track task ownership or reject bits allocated by another caller. This describes the native Amiga implementation. No internal critical section protects the bitmap, saved output value or hardware write. Callers must serialize competing operations; the function itself does not wait.
void WritePotgo(
UWORD word,
UWORD mask );
Update the saved POTGO output value and write it to the Amiga custom chip. For output bits 8 through 15, mask selects the bits to replace and word supplies their new values. Unselected output bits retain the resource's saved values. Bit 0 of word is the START command. When set, it is included in the hardware write independently of mask and is not latched in the saved output value. Bits 1 through 7 of word are ignored.
word - New output values and optional START command.
mask - Mask of output bits to update. Use only bits reserved by
the caller with AllocPotBits().
None.
The resource does not check mask against its allocation bitmap or track task ownership. Setting START requires coordination with other users even when mask is zero. Direct writes to POTGO do not update the resource's saved output value and can be overwritten by subsequent resource calls. This describes the native Amiga implementation. No internal critical section protects the saved value or hardware write. Callers must serialize competing operations.