Document revision date: 19 July 1999 | |
Previous | Contents | Index |
The following instructions are described in this section:
Description and Opcode | Number of Instructions | |
---|---|---|
1. |
Insert Entry into Queue at Head, Interlocked
INSQHI entry.ab, header.aq |
1 |
2. |
Insert Entry into Queue at Tail, Interlocked
INSQTI entry.ab, header.aq |
1 |
3. |
Insert Entry in Queue
INSQUE entry.ab, pred.ab |
1 |
4. |
Remove Entry from Queue at Head, Interlocked
REMQHI header.aq, addr.wl |
1 |
5. |
Remove Entry from Queue at Tail, Interlocked
REMQTI header.aq, addr.wl |
1 |
6. |
Remove Entry from Queue
REMQUE entry.ab, addr.wl |
1 |
Insert Entry into Queue at Head, Interlocked
opcode entry.ab, header.aq
if {insertion succeeded} then | |
begin | |
N <--- 0; | |
Z <--- (entry) EQL (entry+4); ! First entry in queue | |
V <--- 0; | |
C <--- 0; | |
end; | |
else | |
begin | |
N <--- 0; | |
Z <--- 0; | |
V <--- 0; | |
C <--- 1; ! Secondary interlock failed | |
end; |
5C | INSQHI | Insert Entry into Queue at Head, Interlocked |
The entry specified by the entry operand is inserted into the queue following the header. If the entry inserted was the first one in the queue, the condition code Z-bit is set; otherwise it is cleared. The insertion is a noninterruptible operation. The insertion is interlocked to prevent concurrent interlocked insertions or removals at the head or tail of the same queue by another process even in a multiprocessor environment. Before performing any part of the operation, the processor validates that the entire operation can be completed. This method ensures that if a memory management exception occurs (see Appendix E), the queue is left in a consistent state. If the instruction fails to acquire the secondary interlock, then, if no exception conditions exist, the instruction sets condition codes and terminates.
INSERT: INSQHI ... ; Was queue empty? BEQL 1$ ; Yes BCS INSERT ; Try inserting again CALL WAIT(...) ; No, wait 1$: |
Insert Entry into Queue at Tail, Interlocked
opcode entry.ab, header.aq
if {insertion succeeded} then | |
begin | |
N <--- 0; | |
Z <--- (entry) EQL (entry+4); ! First entry in queue | |
V <--- 0; | |
C <--- 0; | |
end; | |
else | |
begin | |
N <--- 0; | |
Z <--- 0; | |
V <--- 0; | |
C <--- 1; ! Secondary interlock failed | |
end; |
5D | INSQTI | Insert Entry into Queue at Tail, Interlocked |
The entry specified by the entry operand is inserted into the queue preceding the header. If the entry inserted was the first one in the queue, the condition code Z-bit is set; otherwise, it is cleared. The insertion is a noninterruptible operation. The insertion is interlocked to prevent concurrent interlocked insertions or removals at the head or tail of the same queue by another process even in a multiprocessor environment. Before performing any part of the operation, the processor validates that the entire operation can be completed. This method ensures that if a memory management exception occurs (see Appendix E), queue is left in a consistent state. If the instruction fails to acquire the secondary interlock, then, if no exception conditions exist, the instruction sets condition codes and terminates.
INSERT: INSQHI ... ; Was queue empty? BEQL 1$ ; Yes BCS INSERT ; Try inserting again CALL WAIT(...) ; No, wait 1$: |
Insert Entry in Queue
opcode entry.ab, pred.ab
N||<--- (entry) LSS (entry+4); | |
Z||<--- (entry) EQL (entry+4); ! First entry in queue | |
V||<--- 0; | |
C||<--- (entry) LSSU (entry+4); |
0E | INSQUE | Insert Entry in Queue |
The entry specified by the entry operand is inserted into the queue following the entry specified by the predecessor operand. If the entry inserted was the first one in the queue, the condition code Z-bit is set; otherwise it is cleared. The insertion is a noninterruptible operation. Before performing any part of the operation, the processor validates that the entire operation can be completed. This method ensures that if a memory management exception occurs (see Appendix E), the queue is left in a consistent state.
INSQUE entry, h ; h is queue head |
INSQUE entry,@h+4 ; h is queue head (Note "@" in this case only) |
INSQUE entry,p ; p is predecessor |
INSQUE ... ; Was queue empty? BEQL 1$ ; Yes CALL WAIT(...) ; No, wait 1$: |
Remove Entry from Queue at Head, Interlocked
opcode header.aq, addr.wl
if {removal succeeded} then | |
begin | |
N <--- 0; | |
Z <--- (header) EQL 0; ! Queue empty after removal | |
V <--- {queue empty before this instruction}; | |
C <--- 0; | |
end; | |
else | |
begin | |
N <--- 0; | |
Z <--- 0; | |
V <--- 1; ! Did not remove anything | |
C <--- 1; ! Secondary interlock failed | |
end; |
5E | REMQHI | Remove Entry from Queue at Head, Interlocked |
If the secondary interlock is clear, the queue entry following the header is removed from the queue and the address operand is replaced by the address of the entry removed. If the queue was empty prior to this instruction, or if the secondary interlock failed, the condition code V-bit is set; otherwise it is cleared.If the interlock succeeded and the queue is empty at the end of this instruction, the condition code Z-bit is set; otherwise, it is cleared. The removal is interlocked to prevent concurrent interlocked insertions or removals at the head or tail of the same queue by another process even in a multiprocessor environment. The removal is a noninterruptible operation. Before performing any part of the operation, the processor validates that the entire operation can be completed. This ensures that if a memory management exception occurs (see Appendix E), the queue is left in a consistent state. If the instruction fails to acquire the secondary interlock, then, if no exception conditions exist, the instruction sets condition codes and terminates.
1$: REMQHI ... ; Removed last? BEQL 2$ ; Yes BCS 1$ ; Try removing again CALL ACTIVATE(...) ; Activate other waiters 2$: |
1$: REMQHI ... ; Anything removed? BVS 2$ ; No . process removed entry . BR 1$ ; . 2$ BCS 1$ ; Try removing again queue empty |
Remove Entry from Queue at Tail, Interlocked
opcode header.aq, addr.wl
if {removal succeeded} then | |
begin | |
N <--- 0; | |
Z <--- (header + 4) EQL 0; ! Queue empty after removal | |
V <--- {queue empty before this instruction}; | |
C <--- 0; | |
end; | |
else | |
begin | |
N <--- 0; | |
Z <--- 0; | |
V <--- 1; ! Did not remove anything | |
C <--- 1; ! Secondary interlock failed | |
end; |
5F | REMQTI | Remove Entry from Queue at Tail, Interlocked |
If the secondary interlock is clear, the queue entry preceding the header is removed from the queue and the address operand is replaced by the address of the entry removed. If the queue was empty prior to this instruction, or if the secondary interlock failed, the condition code V-bit is set; otherwise it is cleared.If the interlock succeeded and the queue is empty at the end of this instruction, the condition code Z-bit is set; otherwise it is cleared. The removal is interlocked to prevent concurrent interlocked insertions or removals at the head or tail of the same queue by another process, even in a multiprocessor environment. The removal is a noninterruptible operation. Before performing any part of the operation, the processor validates that the entire operation can be completed. This ensures that if a memory management exception occurs (see Appendix E), the queue is left in a consistent state. If the instruction fails to acquire the secondary interlock, then, if no exception conditions exist, the instruction sets condition codes and terminates.
1$: REMQTI ... ; Removed last? BEQL 2$ ; Yes BCS 1$ ; Try removing again CALL ACTIVATE(...) ; Activate other waiters 2$: |
1$: REMQTI ... ; Anything removed? BVS 2$ ; No . process removed entry . BR 1$ ; . 2$: BCS 1$ ; Try removing again queue empty |
Previous | Next | Contents | Index |
privacy and legal statement | ||
4515PRO_022.HTML |