Guardian Application Conversion Guide

Converting a C Program to Run at a High PIN
Converting C Applications
5–12 096047 Tandem Computers Incorporated
Setting the HIGHPIN
Object-File Attribute
The HIGHPIN object-file attribute directs the system to run a program at a high PIN if
one is available. If a high PIN is not available, the program runs at a low PIN if one is
available. You set the HIGHPIN object-file attribute either during compilation using a
compiler pragma or after compilation using the Binder program.
To set the attribute when you compile your program, specify the HIGHPIN pragma in
your source code or as a compiler option in the TACL RUN command for the
C compiler. The BINSERV program then sets the HIGHPIN attribute in the object file.
An example of this pragma in a source file is:
#pragma HIGHPIN
An example of this pragma as a compiler option is:
10> C /IN csrc, OUT $s.#clst, NOWAIT/ cobj; HIGHPIN
You need to specify the HIGHPIN pragma only once during a compilation. However,
you can specify it any number of times and the compiler will not generate an error.
If you do not set the HIGHPIN attribute when you compile your program, you can set
it after compilation using Binder. For a single object file, use the Binder CHANGE
command:
@CHANGE HIGHPIN ON IN cobj
If you are binding more than one object file into a single target object file, use the
Binder SET command to set the HIGHPIN object-file attribute in the target file. For the
target object file to have its HIGHPIN object-file attribute set, each constituent object
file must also have its HIGHPIN attribute set.
Using a Library File If your existing program uses a library file, the library file must also have its HIGHPIN
object-file attribute set. To determine the current setting of the HIGHPIN attribute for
a library file, use the Binder SHOW command:
@SHOW SET HIGHPIN FROM libfile
If necessary, set this attribute as described in the previous subsection (provided the
library file has been converted to support a high-PIN process).
Declaring CPU and PIN
Variables
As stated earlier under “Declaring and Using Guardian Variables,” your existing
program might declare a short variable for both the CPU and PIN values or a char
variable for a PIN value:
short cpu_pin;
char pin;
Declare all PIN values, including backup-process PIN values, as short variables.
Declare a CPU value as a separate short variable:
short cpu, pin;