Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

C or DCL routine to examine EXE$GQ_CPUTYPE

2 views
Skip to first unread message

R Boyd

unread,
Jul 19, 2006, 3:45:46 PM7/19/06
to
The gnu config.sub and related routines have various strategies for
determining what model of cpu they are running on. I'm trying to fix
one for the GMP kit so that it can distinguish which variant of Alpha
it's running on. As of now the routine blows up when it fails the
attempt to compile the assembler routine that works for Tru64 and/or
Linux on Alpha.

I'd like to find a bit of code that would do the same using either DECC
or DCL on VMS. There's an assembler routine that is part of the GMP
conf routines that apparently does it, but the assembler is not
available on my system and I don't know if it would actually compile if
I had it. I do have a C compiler. Doing it from DCL would be even
slicker. I can get the information from ANALYZE/SYSTEM CLUE CONFIG --
I would like to think there might be a lighter weight path to getting
the information.

Anyone have something they've done like this?

Thanks!

Robert

sol gongola

unread,
Jul 19, 2006, 3:59:21 PM7/19/06
to
write sys$output f$getsyi("hw_name")

R Boyd

unread,
Jul 19, 2006, 4:19:13 PM7/19/06
to
Perhaps I should have been more explicit.

What I need is the EV level of the cpu, not the "hardware name". Take
a look at the output of ANALYZE/SYSTEM
> CLUE CONFIG

and look at the CPU TYPE field(s)

I have looked at all of the F$GETSYI bits and there may be something in
the SYSTEM ID, or ARCHFLAG but I am not sure how do decode the
necessary subfield(s).

sol gongola

unread,
Jul 19, 2006, 4:46:38 PM7/19/06
to
The following refers to a C program call whatami.c
It may give you what you are looking for.

sol gongola

unread,
Jul 19, 2006, 4:54:24 PM7/19/06
to
The following refers to a C program call whatami.c
It help you get what you are looking for.

http://h21007.www2.hp.com/dspp/files/unprotected/tru64/tips.pdf

Message has been deleted

R Boyd

unread,
Jul 19, 2006, 5:38:56 PM7/19/06
to
Here's a bit of perl code that does pretty much what is called for. If
someone has a prettier bit of code to offer, I'll be happy to look at
it.


my $cpu_word = qr/[a-zA-Z0-9]+/ ;
my $number = qr/[0-9]+/ ;
my @cpu_types = () ;
#
# Find the appropriate records in the include file
#
foreach (`library/text
SYS\$SHARE:SYS\$LIB_C.TLB/extract=HWRPBDEF/output=sys\$output`)
{
# print ;
if ( m/HWRPB_CPU_TYPE\$K_($cpu_word)\s*($number)\s*/ ) {
@cpu_types[$2] = $1 ;
# print $2,"=",$1,"\n"
}
}
#
# find out the cpu type from GETSYI
#
my $cpu_type = `write sys\$output f\$getsyi("cputype")` ;
#print "Cpu type $cpu_type = @cpu_types[$cpu_type]" ;
print "@cpu_types[$cpu_type]";

Hoff Hoffman

unread,
Jul 19, 2006, 9:42:53 PM7/19/06
to
R Boyd wrote:
> The gnu config.sub and related routines have various strategies for
> determining what model of cpu they are running on. I'm trying to fix
> one for the GMP kit so that it can distinguish which variant of Alpha
> it's running on. As of now the routine blows up when it fails the
> attempt to compile the assembler routine that works for Tru64 and/or
> Linux on Alpha.

The C code available via the following URL works on OpenVMS, and is
known to be portable to at least Tru64 UNIX:

http://h71000.www7.hp.com/wizard/swdev/implver.html


Rob Brooks

unread,
Jul 19, 2006, 4:55:37 PM7/19/06
to
"R Boyd" <b...@hax.com> writes:

> The gnu config.sub and related routines have various strategies for
> determining what model of cpu they are running on. I'm trying to fix
> one for the GMP kit so that it can distinguish which variant of Alpha
> it's running on. As of now the routine blows up when it fails the
> attempt to compile the assembler routine that works for Tru64 and/or
> Linux on Alpha.
>
> I'd like to find a bit of code that would do the same using either DECC
> or DCL on VMS. There's an assembler routine that is part of the GMP

$ write sys$output f$getsyi( "cputype" )
8

--

Rob Brooks VMS Engineering -- Exec Group brooks!cuebid.zko.hp.com

R Boyd

unread,
Jul 20, 2006, 12:25:12 PM7/20/06
to
Thanks for that link Hoff!
That routine is perfect. I'll see what I can do to adapt it to the
config scripts.

Hoff Hoffman

unread,
Jul 23, 2006, 8:02:16 PM7/23/06
to
sol gongola wrote:

> The following refers to a C program call whatami.c
> It help you get what you are looking for.
>
> http://h21007.www2.hp.com/dspp/files/unprotected/tru64/tips.pdf

That whatami.c code is derived from the
ALPHA_IMPLVER_AMASK_FEATURES.C code, and whatami.c is a revision or two
back; FWIW, I've updated the original code for EV7 and an extension or
two since that whatami.c code was created and that PDF was generated.

Look in the left navigation at <http://www.hp.com/go/openvms/wizard/>
for the ALPHA_IMPLVER_AMASK_FEATURES.C, or check (when it arrives) on
the OpenVMS Freeware V8.0 distro.

Had I access into a Linux Alpha box and a couple of spare cycles, I'd
likely tweak the code to add that, too.

0 new messages