Purpose and scope
This unit owns portable trap-context save, recoverability checking, and recovery, together with implementation-defined hooks whose default bodies call the portable path.
PTO-ARCH-STATE-TRAP-CONTEXTThe complete ASL owner is shown directly below.
// PTO-UNIT: {"id":"PTO-ARCH-STATE-TRAP-CONTEXT","surface":"arch","classification":["state","trap-context"],"depends_on":["PTO-ARCH-MEMORY-MODEL-ORDERING"]}func SavePortableTrapContext(target: AccessControlRing, source: AccessControlRing)begin _TrapContexts[[target]].valid = TRUE; _TrapContexts[[target]].source_acr = source; _TrapContexts[[target]].tpc = ReadTPC(); _TrapContexts[[target]].bpc = ReadBPC(); _TrapContexts[[target]].core_state = _SystemRegisters.core_state; _TrapContexts[[target]].bundle_argument = _BundleArgument; _TrapContexts[[target]].commit_argument = _CommitArgument; _TrapContexts[[target]].bundle_active = _BundleActive; _TrapContexts[[target]].bundle_body_active = _BundleBodyActive; _TrapContexts[[target]].bundle_commit_target_set = _BundleCommitTargetSet; _TrapContexts[[target]].bundle_condition_set = _BundleConditionSet; _TrapContexts[[target]].system_block_terminal_pending = _SystemBlockTerminalPending; _TrapContexts[[target]].barg = _BARG; _TrapContexts[[target]].bundle_sequential_pc = _BundleSequentialPC; _TrapContexts[[target]].frame_stack_return_target = _FrameStackReturnTarget; _TrapContexts[[target]].return_address = _ReturnAddress; _TrapContexts[[target]].bundle_argument_kind = _BundleArgumentKind; _TrapContexts[[target]].bundle_operation = _BundleOperation; _TrapContexts[[target]].bundle_dimensions = _BundleDimensions; _TrapContexts[[target]].bundle_dimension_present = _BundleDimensionPresent; _TrapContexts[[target]].bundle_scalar_bindings = _BundleScalarBindings; _TrapContexts[[target]].bundle_tile_bindings = _BundleTileBindings; _TrapContexts[[target]].bundle_shared_bindings = _BundleSharedBindings; _TrapContexts[[target]].bundle_range_group = _BundleRangeGroup; _TrapContexts[[target]].bundle_zero_participation_seen = _BundleZeroParticipationSeen; _TrapContexts[[target]].bundle_control_attributes = _BundleControlAttributes; _TrapContexts[[target]].bundle_data_attributes = _BundleDataAttributes; _TrapContexts[[target]].bundle_data_attributes_present = _BundleDataAttributesPresent; _TrapContexts[[target]].bundle_hint = _BundleHint; _TrapContexts[[target]].bundle_fixed_point_attributes = _BundleFixedPointAttributes; _TrapContexts[[target]].local_generations = _LocalGenerations; _TrapContexts[[target]].shared_generations = _SharedGenerations; _TrapContexts[[target]].bundle_execution_domain_token = _BundleExecutionDomainToken; _TrapContexts[[target]].memory_copy_template = _MemoryCopyTemplate; _TrapContexts[[target]].frame_template = _FrameTemplate; _TrapContexts[[target]].t_queue = _TQueue; _TrapContexts[[target]].t_queue_valid = _TQueueValid; _TrapContexts[[target]].u_queue = _UQueue; _TrapContexts[[target]].u_queue_valid = _UQueueValid; _TrapContexts[[target]].predicates = _PredicateRegisters;end;
impdef func SaveTrapContext(target: AccessControlRing, source: AccessControlRing)begin SavePortableTrapContext(target, source);end;
readonly func PortableTrapContextRecoverable(target: AccessControlRing) => booleanbegin return _TrapContexts[[target]].valid && _TrapContexts[[target]].bpc[0] == '0' && _TrapContexts[[target]].tpc[0] == '0';end;
impdef func TrapContextRecoverable(target: AccessControlRing) => booleanbegin return PortableTrapContextRecoverable(target);end;
func RecoverPortableTrapContext(target: AccessControlRing) => booleanbegin // This helper is the architecture-portable recovery path. It must not // dispatch through the active profile override, because that override may // require target-specific context-register state that SavePortableTrapContext // deliberately does not create. if !PortableTrapContextRecoverable(target) then return FALSE; end; WriteTPC(_TrapContexts[[target]].tpc); WriteBPC(_TrapContexts[[target]].bpc); _SystemRegisters.core_state = _TrapContexts[[target]].core_state; _BundleArgument = _TrapContexts[[target]].bundle_argument; _CommitArgument = _TrapContexts[[target]].commit_argument; _BundleActive = _TrapContexts[[target]].bundle_active; _BundleBodyActive = _TrapContexts[[target]].bundle_body_active; _BundleCommitTargetSet = _TrapContexts[[target]].bundle_commit_target_set; _BundleConditionSet = _TrapContexts[[target]].bundle_condition_set; _SystemBlockTerminalPending = _TrapContexts[[target]].system_block_terminal_pending; _BARG = _TrapContexts[[target]].barg; _BundleSequentialPC = _TrapContexts[[target]].bundle_sequential_pc; _FrameStackReturnTarget = _TrapContexts[[target]].frame_stack_return_target; _ReturnAddress = _TrapContexts[[target]].return_address; _BundleArgumentKind = _TrapContexts[[target]].bundle_argument_kind; _BundleOperation = _TrapContexts[[target]].bundle_operation; _BundleDimensions = _TrapContexts[[target]].bundle_dimensions; _BundleDimensionPresent = _TrapContexts[[target]].bundle_dimension_present; _BundleScalarBindings = _TrapContexts[[target]].bundle_scalar_bindings; _BundleTileBindings = _TrapContexts[[target]].bundle_tile_bindings; _BundleSharedBindings = _TrapContexts[[target]].bundle_shared_bindings; _BundleRangeGroup = _TrapContexts[[target]].bundle_range_group; _BundleZeroParticipationSeen = _TrapContexts[[target]].bundle_zero_participation_seen; _BundleControlAttributes = _TrapContexts[[target]].bundle_control_attributes; _BundleDataAttributes = _TrapContexts[[target]].bundle_data_attributes; _BundleDataAttributesPresent = _TrapContexts[[target]].bundle_data_attributes_present; _BundleHint = _TrapContexts[[target]].bundle_hint; _BundleFixedPointAttributes = _TrapContexts[[target]].bundle_fixed_point_attributes; _LocalGenerations = _TrapContexts[[target]].local_generations; _SharedGenerations = _TrapContexts[[target]].shared_generations; _BundleExecutionDomainToken = _TrapContexts[[target]].bundle_execution_domain_token; _MemoryCopyTemplate = _TrapContexts[[target]].memory_copy_template; _FrameTemplate = _TrapContexts[[target]].frame_template; _TQueue = _TrapContexts[[target]].t_queue; _TQueueValid = _TrapContexts[[target]].t_queue_valid; _UQueue = _TrapContexts[[target]].u_queue; _UQueueValid = _TrapContexts[[target]].u_queue_valid; _PredicateRegisters = _TrapContexts[[target]].predicates; _CurrentACR = _TrapContexts[[target]].source_acr; _TrapContexts[[target]].valid = FALSE; return TRUE;end;
impdef func RecoverTrapContext(target: AccessControlRing) => booleanbegin return RecoverPortableTrapContext(target);end;
This unit owns portable trap-context save, recoverability checking, and recovery, together with implementation-defined hooks whose default bodies call the portable path.
SavePortableTrapContext marks the target ACR context valid and snapshots the source ACR, TPC, BPC, core_state, bundle control and argument state, scalar/Tile/Shared bindings, local and Shared generations, templates, temporary queues, and predicate registers.
The snapshot is indexed by the target AccessControlRing; the saved source_acr identifies the ACR restored after recovery.
PortableTrapContextRecoverable requires a valid saved context and zero low bits in both saved BPC and saved TPC. RecoverPortableTrapContext returns FALSE immediately when that condition is not met.
On success, recovery restores every portable field saved by the owner, sets _CurrentACR to the saved source ACR, clears the target context's valid bit, and returns TRUE.
SaveTrapContext, TrapContextRecoverable, and RecoverTrapContext are implementation-defined profile hooks. Their bodies in this owner delegate to the corresponding portable helpers.
Portable recovery deliberately checks PortableTrapContextRecoverable directly instead of dispatching through the active profile override. A profile may require additional context-register state, but the portable save helper does not create such target-specific state.
An unsuccessful portable recovery performs none of the restore assignments and does not invalidate the saved context.
For an aligned valid snapshot saved from ACR3 into target ACR1, successful portable recovery restores the snapshot, selects ACR3 as current, and consumes the ACR1 snapshot by clearing its valid bit. If either saved low address bit is one, recovery instead returns FALSE before changing the live context.
Bodies come from owning ASL. Dragging or buttons change only this page-session view order.
No NDF clause is attached to this unit.
16 matching entries
PTO-AVS-ARCH-QUEUE-READINESS-RECOVERY-001tests/asl/arch/state/trap-context/arch-fault-queue-readiness-recovery-001.asl3c6609590e7bbc2666d9a498a2eda8ba5d2cb8a64d966e01f82922353f943e43PTO-AVS-ARCH-STATE-TRAP-CONTEXT-STATIC-001tests/asl/arch/state/trap-context/arch-static-trap-context-contract-001.asl576010933b4c5e154f6e1319de00442b055b68d58b1666b00eda2b79929cb6fePTO-AVS-ARCH-TESTTRAPROUTINGPOLICY-FAULT-001tests/asl/arch/state/trap-context/arch-fault-routing-policy-001.asl69c5c80eea3b4dc4380e560c027266c98cb6a3bb01ae76cbcac3fd017fabc07ePTO-AVS-ARCH-TRAP-ATTRIBUTES-FAULT-003tests/asl/arch/state/trap-context/arch-fault-trap-attributes-003.aslf7df68b34c3dc9a97bfc61775cec9c11da201aad38971def3207d790df80fcf1PTO-AVS-ARCH-TRAP-BINDINGS-FAULT-002tests/asl/arch/state/trap-context/arch-fault-trap-bindings-002.asl8d480ca45d84e17c8979fe771dafc3e0901bd61af231a7483ad54ebbc6ca476ePTO-AVS-ARCH-TRAP-CONTROL-FAULT-001tests/asl/arch/state/trap-context/arch-fault-all-leaf-recovery-evidence-001.asl895a73c23839eb7eb945fd943f2f7278f13bb6c54342fbe625f59f3b3f24e8a7PTO-AVS-ARCH-TRAP-PORTABLE-FAULT-004tests/asl/arch/state/trap-context/arch-fault-trap-portable-004.aslfa38a935c4d9aaca5cca5fe56fc0534825d762250e23f3c9b7f3622cfcf27a29PTO-EVIDENCE-RELEASE-TRACEABILITYPTO-EVIDENCE-RELEASE-TRACEABILITYspec/evidence/release-traceability-readiness.jsonc7327021d39dc67ac5564bc55073b3870a397d79ac8d9648284d56e33bc14a3ePTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSUREPTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSUREspec/evidence/instruction-contract-closure.json3ef2bb62421c79dff8fa77a1c7983923b523244b8090812883ef81286ca8106aPTO-EVIDENCE-ARCHITECTURE-READINESSPTO-EVIDENCE-ARCHITECTURE-READINESSspec/evidence/architecture-readiness.json4b0b85199101251bea744e0f3591cc31906909dc80d5ab651c417a936036a004PTO-EVIDENCE-RELEASE-GATE-READINESSPTO-EVIDENCE-RELEASE-GATE-READINESSspec/evidence/release-gate-readiness.jsona0f4d2b6920c08981ea55fd8ef820708a40d4feb5402c5150e8e9ab532d84ce0PTO-EVIDENCE-RELEASE-MANIFESTPTO-EVIDENCE-RELEASE-MANIFESTspec/release-manifest.json1a64c109ed7a90351c41e2a418b3c0ebaf8ad975838986d2101385186b85c0d8Loading ADR-0008…
ADR-0008docs/status/decisions/0008-architectural-state-contract.md9c33e1b57d0f04c4d808ee61aaf975187a3dbd32a071329ca65a916dc0e614caLoading ADR-0011…
ADR-0011docs/status/decisions/0011-visible-ebarg-snapshot.mdae2cbaccfe91a2f072b930dd9141a851d3adfe30ac960121836553ff4f3362b6Loading ADR-0018…
ADR-0018docs/status/decisions/0018-pto-v0-trap-disposition.mdce33454ffd2a595425ebece5954c9990ea2b9c4890008ad700599f767d7b9716Loading ADR-0098…
ADR-0098docs/status/decisions/0098-b-range-modifiers.mde194ccc6b6922fd4b65066b533f5e4b0eba094e099970059bca8e25b4e466fba{
"classification": [
"state",
"trap-context"
],
"documentation": "docs/arch/state/trap-context.md",
"id": "PTO-ARCH-STATE-TRAP-CONTEXT",
"mnemonic": null,
"readiness_subjects": [
"ADR-0008",
"ADR-0011",
"ADR-0018",
"ADR-0098"
],
"semantic_tests": [
"PTO-AVS-ARCH-QUEUE-READINESS-RECOVERY-001",
"PTO-AVS-ARCH-TESTTRAPROUTINGPOLICY-FAULT-001",
"PTO-AVS-ARCH-TRAP-ATTRIBUTES-FAULT-003",
"PTO-AVS-ARCH-TRAP-BINDINGS-FAULT-002",
"PTO-AVS-ARCH-TRAP-CONTROL-FAULT-001",
"PTO-AVS-ARCH-TRAP-PORTABLE-FAULT-004"
],
"source": "asl/arch/state/trap-context.asl",
"surface": "arch",
"tests": [
"PTO-AVS-ARCH-QUEUE-READINESS-RECOVERY-001",
"PTO-AVS-ARCH-STATE-TRAP-CONTEXT-STATIC-001",
"PTO-AVS-ARCH-TESTTRAPROUTINGPOLICY-FAULT-001",
"PTO-AVS-ARCH-TRAP-ATTRIBUTES-FAULT-003",
"PTO-AVS-ARCH-TRAP-BINDINGS-FAULT-002",
"PTO-AVS-ARCH-TRAP-CONTROL-FAULT-001",
"PTO-AVS-ARCH-TRAP-PORTABLE-FAULT-004"
]
}0.58.5 · Release candidate7dc8b7e5b121d2b2499a2273bebff29e2cd8681251f242c89ab71a83f322f15252fbd0dcdccbfd6a973c76e5d14aab7cb0b74ab24892c7b07b4a47fb4919195f3bb2067ce74d5ffe1cb1852640d5653b6de6a7f3asl/arch/state/trap-context.asl