lcpid(3C)
_________________________________________________________________
lcpid function
Return the CPU model number.
_________________________________________________________________
Calling Sequence
#include <dglib.h>
unsigned long lcpid(), cpuid;
cpuid = lcpid();
Description
The lcpid function returns the CPU model number and other machine
characteristics.
Returns
This function's return value is defined by the LCPID instruction
in the Eclipse MV/Family 32-Bit Systems Principles of Operation.
Bits 0-15 hold the CPU model number; bits 16-23 hold the
microcode revision number; and bits 24-31 hold the memory size.
With very large memory systems, there is not enough room in the
return value to represent all of available memory.
Example
/* Program test for the lcpid() function */
#include <dglib.h>
#include <stdio.h>
char *machine, *fpu, temp[40];
int ucode, memory, model;
unsigned long cpu_id, lcpid();
main() {
cpu_id = lcpid();
ucode = (cpu_id >> 8) & 0377;
memory = ((cpu_id & 0377) + 1) / 4;
model = cpu_id >> 16;
fpu = ((model & 1) == 1) ? " with FPU" : "";
switch (model & ~1) {
case 8928 : machine = "MV/1400-DC"; break;
case 8936 : machine = "MV/2000-DC"; break;
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
lcpid(3C)
case 8938 : machine = "MV/2000-R"; break;
case 8760 : machine = "MV/4000"; break;
case 8468 : machine = "MV/4000-DC"; break;
case 9690 : machine = "MV/6000"; break;
case 8882 : machine = "MV/7800"; break;
case 8888 : machine = "MV/7800-XP"; break;
case 9340 : machine = "MV/8000"; break;
case 9680 : machine = "MV/8000-II"; break;
case 9670 : machine = "MV/8000-C"; break;
case 8780 : machine = "MV/10000"; break;
case 8880 : machine = "MV/10000-SX"; break;
case 8950 : machine = "MV/15000-8"; break;
case 8954 : machine = "MV/15000-10"; break;
case 8960 : machine = "MV/15000-20"; break;
case 8998 : machine = "MV/20000"; break;
case 8764 : machine = "DS/4000"; break;
case 8976 : machine = "DS/7500"; break;
case 8930 : machine = "DS/7700"; break;
default:
sprintf(temp, "unknown (%d).", model);
machine = temp;
break;
}
printf("Machine: %s%s\n", machine, fpu);
printf("Model #: %d\n", model);
printf("Memory: %d Meg.\n", memory);
printf("Microcode: %d\n", ucode);
return 0;
}
A call to the program test might generate the output
Machine: MV/4000 with FPU
Model #: 8761
Memory: 8 Meg.
Microcode: 10
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)