--- Cannot embed stylesheet: [Errno 2] No such file or directory: '../../../aros.css' --->
BOOL BeginCardAccess( struct CardHandle *handle)
Test whether handle owns a card currently marked present by the m68k-Amiga resource.
handle - Non-NULL CardHandle used for the ownership request.
TRUE if handle equals the current owner and the card is not marked removed; otherwise FALSE.
This call does not acquire or release a lock, change ownership, map memory or reserve access. TRUE is a snapshot, not a guarantee that the card remains present. Continue to handle removal notifications.
ULONG CardAccessSpeed( struct CardHandle *handle, ULONG nanoseconds)
Set the m68k-Amiga card-memory access timing.
handle - Current card owner. nanoseconds - Requested access time. Values 0-100 select 100 ns; 101-150 select 150 ns; 151-250 select 250 ns; 251-720 select 720 ns.
The selected access time in nanoseconds, or zero if the request exceeds 720 ns or the ownership/presence check fails.
Requires a non-NULL handle that currently owns the inserted card. The ownership test does not protect against subsequent removal. Rejected requests leave the configuration unchanged. The programming-voltage bits are preserved. A zero request selects 100 ns; it does not query the current timing.
ULONG CardChangeCount( )
Read the m68k-Amiga resource's processed-change counter.
The current ULONG counter value.
The resource task increments the counter after waking for a change, before debouncing and processing it. Multiple signals may coalesce. CardForceChange() does not increment it directly, and counter equality does not prove that the same card is still present. Use the value as a change indicator; it can wrap.
BOOL CardForceChange( )
Initiate a simulated m68k-Amiga card removal and, if still present, reinsertion.
FALSE if removal-reset mode is enabled or the card is already marked removed. Otherwise TRUE after initiating the change.
Call from task context. The function resets card configuration, marks the card removed and invokes the current owner's removal callback with task switching forbidden. The callback must arrange to release ownership. If hardware still reports a card, a synchronous card-reset sequence runs and the resource task is signalled to process reinsertion. Otherwise interrupts are re-enabled without signalling that task. TRUE does not mean reinsertion, ownership reassignment or a counter update has completed. The synchronous reset busy-waits on the display beam without a timeout.
ULONG CardInterface( )
Identify the m68k-Amiga Gayle PCMCIA interface.
CARD_INTERFACE_AMIGA_0 (zero).
The identifier describes the resource implementation. It does not report card presence, ownership or readiness.
UBYTE CardMiscControl( struct CardHandle *handle, UBYTE control_bits)
Update m68k-Amiga card status controls and selected interrupt enables.
handle - Current card owner. control_bits - CARD_ENABLEF_DIGAUDIO and CARD_DISABLEF_WP replace the corresponding status controls. CARD_INTF_BVD1, CARD_INTF_BVD2 and CARD_INTF_BSY select interrupt enables; CARD_INTF_SETCLR sets the selected bits when present and clears them otherwise. SC, DA and IRQ are aliases for those interrupt bits.
The requested bits masked to the supported controls, including CARD_INTF_SETCLR, or zero if the ownership/presence check fails. Zero is also a valid successful request.
Requires a non-NULL handle that currently owns the inserted card. The ownership test does not protect against subsequent removal. Status controls are replaced on every call, including calls intended only to alter interrupts. Unselected interrupt enables are preserved. The result is the masked request, not the previous state or a hardware readback.
LONG CardProgramVoltage( struct CardHandle *handle, ULONG voltage)
Set the m68k-Amiga card programming voltage.
handle - Current card owner. voltage - CARD_VOLTAGE_0V or CARD_VOLTAGE_5V. These are selector constants, not a numeric voltage.
1 after applying a supported selector; -1 for an unsupported selector, including CARD_VOLTAGE_12V; 0 if the ownership/presence check fails.
Requires a non-NULL handle that currently owns the inserted card. The ownership test does not protect against subsequent removal. Rejected requests leave the configuration unchanged. Access-timing bits are preserved. Ownership failure takes precedence over selector validation.
BOOL CardResetCard( struct CardHandle *handle)
Pulse the m68k-Amiga card-reset controls.
handle - Current card owner.
TRUE after the reset sequence; FALSE if the ownership/presence check fails.
Requires a non-NULL handle that currently owns the inserted card. The ownership test does not protect against subsequent removal. Call from task context. The sequence busy-waits for two groups of ten display-beam cycles and temporarily disables Gayle interrupt enables. It restores the saved enables and removal-reset setting. No card-ready status is checked and no timeout is provided; TRUE does not establish that the card is operational.
BOOL CardResetRemove( struct CardHandle *handle, ULONG flag)
Enable or disable machine reset on m68k-Amiga card-detect changes.
handle - Current card owner. flag - Zero disables reset; any nonzero value enables it.
TRUE after applying the setting; FALSE if the ownership/presence check fails.
Requires a non-NULL handle that currently owns the inserted card. The ownership test does not protect against subsequent removal. Enabling this setting permits a card-detect change to reset the machine. It is not a request to reset only the card. The bus-error control bit is cleared when the setting is written.
BOOL CopyTuple( struct CardHandle *handle, UBYTE *buffer, ULONG tuplecode, ULONG size)
Search the m68k-Amiga card's CIS chains and copy a matching tuple.
handle - Current card owner. buffer - Writable storage for at least two header bytes plus size data bytes. NULL selects diagnostic traversal without copying. No pointer is retained. tuplecode - Tuple type in bits 0-7 and zero-based occurrence to skip in bits 16-31. Bits 8-15 are ignored. size - Maximum number of tuple data bytes to copy, excluding the two header bytes. Zero still copies the header.
With a buffer, TRUE when a matching tuple is selected; FALSE when none is found, ownership is absent or traversal fails before selection. The buffer is unchanged on those FALSE paths. With NULL, TRUE only when traversal reaches an end with no further link; no tuple selection is made.
Requires a non-NULL handle that currently owns the inserted card. The ownership test does not protect against subsequent removal. The first two output bytes are the tuple code and its original link length. At most min(size, link length) data bytes follow. The link byte is not reduced after truncation, and the function returns no separate copied-byte count. Traversal starts in attribute memory and can follow long links into attribute or common memory. It temporarily selects 720 ns timing with the programming voltage cleared, then restores the previous configuration before returning. Task switching is forbidden during traversal. A NULL buffer prints tuples to the diagnostic log; tuplecode and size do not filter that traversal.
After finding a tuple, individual read failures are ignored and failed reads supply zero bytes. TRUE does not certify a complete or valid tuple, especially after removal. Cyclic long links are not detected and can prevent the call from returning while task switching remains forbidden. Do not use this function as validation of untrusted CIS data.
ULONG DeviceTuple( UBYTE *tuple_data, struct DeviceTData *storage)
Decode the first device descriptor of a m68k-Amiga CISTPL_DEVICE or CISTPL_DEVICE_A tuple.
tuple_data - Readable tuple including its code, link byte and complete device descriptor. The function has no buffer-length argument; provide accessible storage for every byte described and inspected. storage - Non-NULL writable DeviceTData. The input and output must not overlap.
Nonzero if the implemented decoder accepts the descriptor; zero for an unsupported tuple code, zero link length, unsupported device type or reserved speed encoding. On all calls, size, speed and flags are first cleared. Type may be changed before failure; output is not transactional.
Types 0-7 and 13 are accepted. Fixed speed encodings produce 250, 200, 150 or 100 ns; encoding 0 leaves speed zero. Extended-speed encoding derives a value from its mantissa and exponent. Size is expressed in bytes; when a size byte is read, it is (512 << (2 * (byte & 7))) * ((byte >> 3) + 1). An I/O descriptor without a size byte receives size 1. Flags are always zero. This decoder reads caller memory; it does not access the card, require ownership or retain either pointer.
The decoder compares the payload length with offsets that include the header, so it can skip valid trailing descriptor data and still succeed. A long extended-speed chain can wrap the 8-bit offset and cause header bytes to be decoded as size data. Reserved mantissa values are not rejected. TRUE does not establish a complete or correct card-memory description.
BOOL EndCardAccess( struct CardHandle *handle)
Test whether handle owns a card currently marked present by the m68k-Amiga resource.
handle - Non-NULL CardHandle used for the ownership request.
TRUE if handle equals the current owner and the card is not marked removed; otherwise FALSE.
This call does not acquire or release a lock, change ownership, map memory or reserve access. TRUE is a snapshot, not a guarantee that the card remains present. Continue to handle removal notifications.
struct CardMemoryMap * GetCardMap( )
Return the fixed m68k-Amiga Gayle PCMCIA address windows.
A borrowed pointer to an immutable CardMemoryMap: common memory at 0x00600000, size 0x00400000; attribute memory at 0x00A00000, size 0x00020000; I/O memory at 0x00A20000, size 0x00010000.
Do not modify or free the map. It remains valid for the lifetime of card.resource. Returning the map does not acquire a card or establish its presence. Claim the card before accessing its windows and stop access on removal. Attribute bytes occupy alternate addresses.
struct Resident * IfAmigaXIP( struct CardHandle *handle)
Inspect the m68k-Amiga card's execute-in-place tuple without returning a resident.
handle - Current card owner.
Always NULL.
When the ownership/presence check succeeds, the function calls CopyTuple() for CISTPL_AMIGAXIP and decodes its location field. No resident is validated or executed. CopyTuple() traversal and blocking limitations apply.
Execute-in-place support is incomplete. NULL does not distinguish an absent tuple, a read failure or a tuple that this implementation cannot use.
struct CardHandle * OwnCard( struct CardHandle *handle)
Request ownership of the m68k-Amiga PCMCIA slot, or queue a handle for a later card.
handle - Writable, caller-owned CardHandle not already linked into the resource. Initialize its node priority, flags and callback pointers; use NULL for absent callbacks. Keep the handle, callback structures, code and callback data alive while registered.
With CARDF_DELAYOWNERSHIP, returns (struct CardHandle *)-1 after queueing the handle, even if ownership and its insertion callback occur immediately. Otherwise returns -1 when the card is marked removed. With CARDF_IFAVAILABLE and an existing owner, returns that owner's borrowed handle. Other paths return NULL; see BUGS.
CARDF_DELAYOWNERSHIP takes precedence over CARDF_IFAVAILABLE and queues by node priority. An immediate claim adds the handle at the head of the queue without calling its insertion callback. CARDF_RESETREMOVE selects machine-reset behaviour on card-detect changes when ownership is granted. CARDF_POSTSTATUS requests a second status callback with mask zero after interrupt acknowledgement. Insertion and removal callbacks execute with task switching forbidden, from resource-task or caller context. They must not wait. The status callback executes in interrupt context; it returns the interrupt mask to acknowledge. Use the AROS_CARDH/AROS_CARDFUNC and AROS_CARDC conventions from resources/card.h. Remove a registered handle with ReleaseCard(handle, CARDF_REMOVEHANDLE) before freeing its storage. Serialize registration and release; the ownership decision and registration are not one atomic operation.
Without CARDF_IFAVAILABLE or CARDF_DELAYOWNERSHIP, an existing owner causes NULL to be returned without registering or acquiring the supplied handle. NULL alone therefore does not prove ownership; BeginCardAccess() checks the current handle. Re-registering a linked handle can corrupt the queue.
UBYTE ReadCardStatus( )
Read the m68k-Amiga Gayle card-status signals.
A mask containing CARD_STATUSF_CCDET, CARD_STATUSF_BVD1, CARD_STATUSF_BVD2, CARD_STATUSF_WR and CARD_STATUSF_BSY as read from the status register. Other bits are cleared.
BVD1, BVD2 and BSY share their bit positions with SC, DA and IRQ for I/O cards. Interpret the signals for the card type. The call does not clear pending interrupts or check card ownership. A returned snapshot does not reserve access.
void ReleaseCard( struct CardHandle *handle, ULONG flags)
Release a handle's m68k-Amiga card ownership and optionally unlink the handle.
handle - Valid, caller-owned CardHandle. For CARDF_REMOVEHANDLE, it must currently be linked into this resource. flags - CARDF_REMOVEHANDLE unlinks the handle; other bits are ignored.
None.
If handle owns the card, ownership is cleared and card configuration and interrupts are reset. When a card remains inserted, another eligible handle can receive ownership and its insertion callback before this call returns. Without CARDF_REMOVEHANDLE, the released handle remains queued but is marked used for the current card. No handle or callback storage is freed. Serialize release with other operations on the handle. Call only after registration is known to have occurred; a failed OwnCard() attempt does not necessarily register it. A removal callback must arrange to release ownership: notifying a client of removal does not itself clear the resource's owner pointer.
Unlinking is unconditional when CARDF_REMOVEHANDLE is set. Passing an unregistered or already removed handle can corrupt a list.