HPlogo 900 Series HP 3000 Computer Systems: MPE/iX Intrinsics Reference Manual > Chapter 4 Command Definitions

GETDSEG

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

NM and CM callable.

Creates or acquires an extra data segment for use by the process. Data segment management (DS) capability is required.

NOTE: Data segment management (DS) intrinsics are not recommended for use in native mode programming environment. Use of DS intrinsics in NM degrades your program's performance.

Syntax

            U16   I16  U16V

   GETDSEG(index,length,id);

Parameters

index

16-bit unsigned integer by reference (required)

Returns the index of the extra data segment assigned by the operating system. When GETDSEG is called in user mode, index is a logical index of the assigned data segment; if an error is found, index is set to %2000-%2004. When GETDSEG is called in privileged mode, index is the actual data segment table (DST) entry number assigned for the data segment.

length

16-bit signed integer by reference (required)

Passes the user-specified maximum size, in half words, of the newly created data segment. If the data segment already exists, length returns the maximum size, in half words, of the data segment.

id

16-bit unsigned integer by value (required)

Passes the identity that declares the extra data segment shareable between other processes in the job/session, or private to the calling process. For a shareable extra data segment, specify id as a nonzero value. If an extra data segment with the same identification already exists, it is made available to the calling process; otherwise, a new extra data segment, shareable within the job/session, is created with id. For a private extra data segment, specify an id of zero.

Operation Notes

The number of extra data segments that can be requested, and the maximum size allowed these segments, is limited by parameters specified when the system is configured. When an extra data segment is created, the GETDSEG intrinsic returns a logical index number to the process. This index number is assigned by the operating system and allows the process to reference the extra data segment in later intrinsic calls.

Assign the extra data segment to an identity that either allows other processes in the job or session to share the extra data segment, or that declares it private to the calling process. If the extra data segment is shareable, other processes can obtain its index (through GETDSEG) and use this index to reference the extra data segment. Thus, the index is a local name that identifies the extra data segment throughout any process that obtained the index with the GETDSEG call. The index does not need to be the same value in all processes sharing the extra data segment. However, the identity is a job-wide or session-wide name that permits any process to determine the index of the extra data segment. If GETDSEG is called in user mode, the extra data segment is initially filled with zeros.

When GETDSEG is called in user mode, all subsequent calls to intrinsics that use index must be in user mode. When GETDSEG is called in privileged mode, all subsequent calls to intrinsics that use index must be in privileged mode.

When a data segment is created through GETDSEG, sufficient virtual space is allocated by the system to accommodate the original length of the data segment. This virtual space is allocated in increments of 512 half words. For example, creation of an extra data segment with a length of 600 half words results in the allocation of 1024 half words of virtual space.

Condition Codes

CCE (2)

Request granted. A new extra data segment was created.

CCG (0)

Request granted. An extra data segment with this identity exists already.

CCL (1)

Request denied. The following values are returned in index:

ValueMeaning
%2000An illegal length was specified.
%2001The process requested more than the maximum allowable number of data segments.
%2002Sufficient storage was not available for the data segment.
%2003A stack expansion necessary to satisfy the request could not be done because the stack was frozen or the stack is already at its maximum size (stack expansion is usually not necessary to get an extra data segment).
%2004There is not enough room in the job definition table to make an entry for the extra data segment.

Related Information

Intrinsics

None

Commands

None

Manuals

Introduction to MPE XL for MPE V Programmers (30367-90005)

Feedback to webmaster