• Aucun résultat trouvé

TIIk Central Block (TCB) nr-t

Dans le document Xerox Control Program for Real- Time (CP-RJ (Page 139-151)

132 where

Saved PSD (words 0, 1) is the PSD of the task the primary task interrupted at its last entry.

Intermediate PSD (words 2,3) is the PSD loaded by the XPSD command at entry. The contents of this PSD are set by CONNECT to all zeros with these exceptions:

Instruction address - TCB + 4

Condition Code = the number of registers to be saved with the STM command in TCB + 4. CC = 0 if the CONNECT command specified that all 16 registers be saved via the central connection.

Since the XPSD does not alter the register block value in the PSD but leaves that of the interrupted task (LP = 0), the Register Block Pointer = O.

STM, BAL commands (words 4,5) are commands executed as part of the central connection entry logic.

STM causes the number of registers requested to be saved, and BAL enters the remainder of the central connection logic (RBMSAVE).

Flags (word 6) have the following meaning:

Bit 0

=

0 for user task

=

1 for C P-R task 1

=

0 for foreground task

=

1 for background task 2 = 0 for primary task

=

1 for secondary task 3 = 0 for real addressing

=

1 for virtual addressing 4 = 0 if reserved

5 = 1 if the task is to be reentered instead of exited at EXIT. This bit is transient. It is set when end-action triggers are performed, and reset during RBMSAVE and when reentry occurs. It can exist only in TCB + 6.

PCB Address (word 6) is the real address of the PCB in the load module to which the task belongs.

Task 10 (word 7) is the index into STI of the task's entry.

TCB Address is the real address of the first word of the TCB.

Note: When a task is active, flags, PCB address, task ID and TCB address contain the values for the inter-rupted task versus the primary task corresponding to the TCB.

Entry PSO (words 8,9) is the PSO to be loaded when entering the primary task. All bits are zero except those specified otherwise on the CONNECT call as follows:

Master/Slave - as specified

Decimal and Arithmetic Masks - as specified Instruction Address - callers start address Write Key - 10 (foreground)

CI, II, EI - inhibits as specified

Register Save Area (words 10 through 25) are the save area for the registers of the interrupted task.

I

(

lie ' ry T_ c.tnI .... CITeB)

The STCS contains all controls for software scheduled secondary tasks which reflect the execution status and memory usage of the task.

Location and Type

The STCS is a serial control block in TSPACE.

Logical Access

The STCS is pointed to by the following:

TCSPOINT (during task's execution only) STI entry corresponding to the secondary task

The XPSD in the interrupt location corresponding to the CP-R Dispatcher Level (ROL) immediately above the Task Level (STLl (during execution only).

figure 46 illustrates the logical links between the STCS and other system control data.

Overview of Usage

A user STCS is created by task initialization if the load module requested is secondary. CP-R task STCSs are in-cluded in the resident portion of the task's code, as are all control blocks "lower than" the STCS. The initial STCS content set by task initiation is described for each data element, as is the element usage. The STCS is used by the CP-R control functions, dispatcher, memory management services and roll-in/roll-out during the life of the task.

STCS space is released by task termination.

J

TCSPOINT

I STCS PCS

STI

t---L..- AST

....- Tasks Entry I

--

... L...-: ACI

XPSO of Dispatch Level

'""

'"'

figure 46. Relationship between Secondary Task Control Block and Other System Control Data

133

134

Secondary Talk Control Block (STCB) Format

o

Current Registers, Secondary Task

Length AST Addren (1-1)

(

Intermediate PSD (words 2,3) a PSD to transfer control to real address STCB + 4. All other intermediate PSD bits are zero. Task initiation sets the intermediate PSD address which remains unaltered.

STM and BAL commands (words 4,5) stored by task initiation to cause context saving and swapping via

136

ACI Address (word 27) The first word address (1-1) of the Access Control Image. The ACI space is allocated by task initiation and the address is stored in the STCB. This word is not altered.

RDL Group and Level (word 28) The group and level bits of the RDL Level under which the secondary task is currently queued. Set by the dispatcher queue maintenance routines.

Word 29 Spare.

Words 30,31 Alternate Program Status Doubleword or altemate PSD to be used the next time the task is dis-patched if ALT is in the STI=J. When ALT is honored by the dispatcher, this PSD and the current PSD in words 0 and 1 are swapped.

Purpose

The AST provides the Task Dispatcher with a list of all segments whose map image must be loaded into the hardware map before the task can be dispatched. It is used by roll-out to record that an active segment was rolled out and task execution suspended; by roll-in to reactivate deactivated roll-out segments.

Serial consecutive entries in CP-R TSPACE.

Logical Access

The AST is pointed to from the STCB, containing an entry for every segment defined in a Secondary Task Load Module including Root Part two. In addition CP-R adds a segment for Job Reserved Pages and Task Reserved Pages.

The AST entries are ordered with respect to the segment's virtual starting address (i.e., the next higher adjacent AST entry represents a segment with a starting virtual address that is equal to or larger than the preceding AST entry. ) AST is typically accessed by scanning for active entires that point to Segment Descriptors, which contain all information necessary to describe the segment.

Figure 47 shows the AST and its relationship to other system tables.

Overview of Usage

The AST is established by task initiation from information in the task's load module header, and deleted by Task Termination.

When it dispatches a task, Task Management will scan the AST for entries that are active and will use thepointer to the SO to access the information necessary to load the task's map.

Memory Management uses the AST when performing segment operations for the user. The information contained in the AST and the SO is used to maintain the status of the task's segments for ACTIVATE, DEACTIVATE, and page operations (GETPAGE, RELPAGE).

Memory Management also uses the AST and SO information when performing roll-out and roll-in functions.

- )

STCS

AST Pointer

AST

\

I

Figure 47. Relationship of AST to Other System Tables

Root Part One

User Segment One

User Segment n

Root Part Two

Job Reserved Pages

Task Reserved Pages

137

138

Associative Segment Table (AST) Format

Flags SO address (Root part one) Flags SO address (first user segment)

.~

..

where Flags

bit 0 bit 1 (A)

bit 2"(FA)

bit 3(RO)

bit 4 (OS)

bit 5-7 SO address

bits 8-31

"mint

Dacriptor (SO)

Purpose

Flags SO address (last user segment) Flags SO address (Root part two) Flags SO address (JOB reserved pages) Flags SO address (TASK reserved pages)

is always zero.

= 0 if this segment is not currently active to this task; = 1 if it is active. Set by ACTIVATE, GETPAGE. May also be set by roll-in routines. Reset by DEACTIVATE, ERASE or RELPAGE routines.

is first activate flag. Set by Memory Management when the segment is first activated to prevent decrementing segment erase count before an ACTIVATE. Reset by ERASE.

is Roll-Out Deactivated flag. Set by roll-out task when rolling out an active segment.

Reset by roll-in task.

is Dispatcher Skip flag. If set, the Dispatcher, Skip (OS) flag in the Segment Descriptor (SO) addressed in bits 8-31 was set by the task owning this AST. See the description of the OS flag in a SO for dispatcher implications.

are unused.

is the real word address of the corresponding Segment Descriptor established by task initiation.

The SO contains all 5egment-associated controls. It contains the access protection image, map image, the roll-out file position information and information relative to the status of each real page allocated to the segment. The SO is used by Task Management and Memory Management.

Serial with four parallel subtobles in TSPACE.

logical Access segment until the segment is terminated.

Memory Management controls the acquisition and release of real memory pages in response to segment or page oper-ation calls. Additionally, memory pages may be freed by the roll-out process.

The SO is deleted at task termination time by Task Management.

Segment Descriptor (SO) Format

Access Image

Segment Flags Segment Number

LMI SOT FLINK Address

Tasks Active Tasks Erased Tasks Using Tasks Locked Real Page Virtual Page

ACI Count No. Pages

Count Count (n) Ro"ed-Out

ACIACIAC lAC ACIACIACIAC AC lAC IAC\AC ACIACIACIAC

... ~ ...

ACIACIAC lAC ACIACIACIAC ACIACIACIAC AC\AC\ACIAC Page Flags (S) Page Flags (S+I) Page Flags (S+2) Page Flags (S+3)

140

Bits 1,2 indicate segment status:

00-normal

01 - abort all using tasks 10 t ed 11 - no assign

Set by Memory Management when major errors are discovered in the composition of the Segment Descriptor.

Bits 3-5 Always zero.

Bits 6,7 is a 2-bit index (APM) into a mask table used by Task Management to load the hctrdware Access Protection registers. Set by task initiation.

Bits 8-31 is the real word address of the first word of the map image subtable. Initialized by task

ind icates that rea I address correspondence (RAC) is requi red for this segment. Set by task in i tiotor • 2 indicates that only secondary taskmernory(STM) is used for this segment. Set by..rtask initiator •

....

I

Bits 9-11 indicate segment state - a code representing the current state and remaining dynamic through-out the life of the segment:

Initially set by task initiator and manipulated by Memory Management.

Bits 12-15 not assigned.

Bits 16-31 represent segment number.

bit 16

=

0 if this is a user-numbered segment.

'42

Word 4 (cont.)

Bits 8-15 contain a count of the number of tasles that have erased this segment. Initially zero, count is incremented by 1 for every first ACTIVATE and decremented by , for each ERASE. When this count

Bits 8-15 contain a count of the number of virtual pages required for thissegment. Set by task initiation.

Bits 16-23 contain a count of the number of words in the Access Image Table. Used by Task Dispatcher

bit 0 FFP, Foreground Preferred Page. A real page from a Foreground Preferred Parition. Set by Mem-ory Management.

bit 1 FSA, File Space Allocated. Indicates that roll-out file space has been allocated to this vir-tual page. Set by Memory Management.

bit 2 RPP, Real Page Present. Indicates that a real memory page has been allocated to this virtual page. Set by Memory Management.

bit 3 PRO, Page Request Outstanding. Indicates that a request for this virtual page has been made but could not be satisfied immediately.

bit" ROL. Indicates that this page has been rolled out.

bit 5 not assigned.

bits 6,7 APC, Access Protection Code. Used to control access to reserved pages and therefo,tf, present

...

only if segment type is 10 I or 110 (reserved pages). Set by Memory Management.

File Image Bits 0-31 is a parallel halfword table that contains the roll-out file granule displacement that corresponds to the particular virtual page address controlled by this segment.

Map Image 0-31 is a parallel halfword table that contains the real page address that corresponds to the particular virtual page addresses controlled by this segment. The last entry of this table mayor may not be used depending on control start.

(

Dans le document Xerox Control Program for Real- Time (CP-RJ (Page 139-151)

Documents relatifs