Revision history   OpenPOWER Library

 4.4.2.1. PSL Procedure for Time-Sliced Programming Models

  1.  Check the PSL queue for processes waiting to be restarted.

    1. Perform a read of the cache line containing the head_pointer and tail_pointer such that the cache line is owned by the PSL.

      • The PSL should prevent any other PSL from accessing the cache line until substep 3c or substep 3b.

    2. Compare the head and tail pointers of the PSL queue.

      • If the head_pointer does not equal the tail_pointer; a process is waiting to be started or resumed.

        Continue with step 3.

      • If the head_pointer equals the tail_pointer; no processes are waiting to be restarted.

        Continue with substep 1c.

    3.  Release the protection of the cache line containing the head_pointer and tail_pointer values.

      Continue with step 2.

  2.  No processes to run. Wait until a process is added to the PSL queue.

    1.  Wait for the head and tail pointers to be updated.

      • The PSL can either poll the cache line that contains the head_pointer and tail_pointer information for a change in state, or detect when the cache line is modified by another device using the coherency protocol.

    2. Continue with step 1.

  3.  Start the next process in the PSL queue.

    1.  Remove the process to start/resume from the PSL queue.

      • Set the process element handle (PSL_PEHandle_An[PE_Handle]) for the process element to resume or start, and the process_state with the data contained at the tail_pointer.

      • Add 8 to the tail_pointer; tail_pointer = tail_pointer + 8.

      • If the tail_pointer is greater than end_of_PSL_queue_area, tail_pointer = start_of_PSL_queue_area.

    2.  Release the protection of the cache line containing the head_pointer and tail_pointer values.

    3. Read the process element state from the linked list and start the process.

      • The process to start or resume is the value of the tail_pointer read in substep a.

      • If the suspend flag is set in the software status field, continue with substep d.

      • If the suspend flag is not set in the software status field, perform a context restore if indicated by the process_state read in substep a and start the process. Continue with the next substep.

    4.  Continue running the process until either the context time has expired or the process is completed.

      • If the processes are completed, continue with step 1.

      • If the context timer expires, request the AFU to perform a context save operation.

      • If a context save is performed by the AFU, wait until the operation is completed and set process_state to indicate that a context restore is required. Continue with the step d.

  4. Place the process element into the PSL queue of processes waiting to be started or resumed.

    1. Perform a read of the cache line containing the head_pointer and tail_pointer such that the cache line is owned by the PSL.

      • The PSL should prevent any other PSL from accessing the cache line until substep c.

    2. Write the link to the process element and its status to the PSL queue of processes waiting to be restarted.

      • Write the process element handle (PSL_PEHandle_An[PE_Handle]) and the process_state to the memory location pointed to by the head_pointer.

      • Add 8 to the head_pointer; head_pointer = head_pointer + 8.

      • If the head_pointer is greater than end_of_PSL_queue_area, head_pointer = start_of_PSL_queue_area.

    3.  Release the protection of the cache line that contains the head_pointer and tail_pointer values.


loading table of contents...