OP = 93
AF Unused and reserved. Can be specified as an indirect field length.
BF Variant, which can be specified as an indirect field length. The variant functions are as follows:
All other BF values are ignored.
The A Syllable is the address of a pointer to a reinstate list entry, which is linked at the top of the ready list if BF is 01. This address can be indexed, indirect, or extended. The final address controller is ignored.
|Note||This instruction can only be executed in KERNEL mode with the Privileged Enable toggle set, or an Invalid Instruction fault (IEX=02) is reported.|
BRV is a companion instruction to the interrupt procedure. BRV accesses the ready list to find the first task that can be run and reinstates that task on the processor that is executing the instruction. The processor state is loaded from the reinstate list entry for that task and control is transferred to the next instruction address. The address is derived from the interrupt frame after the base/limit registers are loaded. If no task is found to run, the processor goes to IDLE mode.
BRV is functionally divided into the search and reinstate phases. The search phase is considered to be part of the MCP kernel task, and the time spent in this phase is charged to the kernel task. The reinstate phase is both part MCP kernel task and user task; time spent in each task is charged accordingly.
BRV searches the ready list, which is a linked list of reinstate list entry pointers. The head of ready list pointer, located in the kernel data area, points to the first entry in the ready list. Within a reinstate list entry is the Link to Next reinstate list entry field; this field contains the address that points to another entry in the reinstate List. The link format is
C represents the positive sign, 7 is the base indicant value, and AAAAAA is the offset. The offset field of the last link in the list is EEEEEE (which represents a NIL pointer).
Within the information contained in a reinstate list entry, there are three contiguous 2-digit fields. They are the state indicator, stop count, and processor number fields.
If the state indicator field (used mainly by hardware) is a nonzero value, the corresponding task is waiting for something to happen. If the stop count field (used mainly by software) is a nonzero value, the corresponding task is stopped. If either of the fields are nonzero, the corresponding task is blocked from running. The processor number field describes the processor on which the corresponding task is active. The three fields combine to form the wait field. A task can run only if the value of the wait field is zero.
If during a search a task was found to be not active and blocked, the task is delinked from the ready list.
While in the search phase, the processor will halt on any processor detected fault. The processor performs the following:
The task that is reinstated becomes the current task. During the reinstate phase, the processor performs the following:
Subsequent to the execution of this instruction, the comparison flags will be restored from the reinstate list entry for the newly reinstated task..
Subsequent to the execution of this instruction, the overflow flag will be restored from the reinstate list entry for the newly reinstated task..