From: Joe Griffin <jjg@mscsoftware.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [Linux-ia64] platform detection at run-time
Date: Wed, 25 Sep 2002 19:00:38 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590701906058@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590701906051@msgid-missing>
I read /proc/cpuinfo and look for
anything related to IA64, anything else
I call I686:
/*
** Scan for desired fields. The "++" in front of the
** "k" is to skip the blank after the colon.
**
** IA32:
** vendor_id : GenuineIntel
** cpu family : 15
** model : 0
** model name,e.g. : Intel(R) Pentium(R) 4 CPU 1500MHz
**
** IA64/Itanium:
** vendor : GenuineIntel
** family : IA-64
** model : Itanium
**
** IA64/McKinley
** vendor : GenuineIntel
** arch : IA-64
** family : McKinley
** model : 0
**
*/
if ( strcmp(&string[k],"Itanium ") = 0 ) {
(void) strcpy(cpuname,&string[k]);
sys.arch = "linux64";
sys.rawid = 64;
sys.config = 6401;
} else if ( strcmp(&string[k],"Itanium 2 ") = 0 ) {
(void) strcpy(cpuname,&string[k]);
sys.arch = "linux64";
sys.rawid = 64;
sys.config = 6402;
} else if ( strcmp(&string[k],"McKinley ") = 0 ) {
(void) strcpy(cpuname,&string[k]);
sys.arch = "linux64";
sys.rawid = 64;
sys.config = 6402;
} else if ( strcmp(&string[i],"model name") = 0 ) {
(void) strcpy(cpuname,&string[k]);
sys.arch = "linux";
sys.rawid = 686;
sys.config = 686;
Joe
David Mosberger wrote:
>>>>>>On Wed, 25 Sep 2002 13:35:43 -0500, Nathan Straz <nstraz@sgi.com> said:
>>>>>>
>>>>>>
>
> Nathan> On Wed, Sep 25, 2002 at 02:18:51PM -0400,
> Nathan> Sane_Purushottam@emc.com wrote:
> >> What is the preferred method to determine the platform at run
> >> time ?? Are these values likely to change (after I change my code
> >> to handle this) ????
>
> Nathan> I had to do the same thing for an application and I ended up
> Nathan> forking off a process to run the uname command.
>
>That doesn't work. On a properly configured machine,
>execve("/bin/uname") will return i686 when execute from an x86
>process.
>
> --david
>
>_______________________________________________
>Linux-IA64 mailing list
>Linux-IA64@linuxia64.org
>http://lists.linuxia64.org/lists/listinfo/linux-ia64
>
>
>
>
next prev parent reply other threads:[~2002-09-25 19:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-25 18:18 [Linux-ia64] platform detection at run-time Sane_Purushottam
2002-09-25 18:22 ` Don Dugger
2002-09-25 18:35 ` Nathan Straz
2002-09-25 18:46 ` David Mosberger
2002-09-25 18:48 ` David Mosberger
2002-09-25 18:57 ` Nathan Straz
2002-09-25 19:00 ` Joe Griffin [this message]
2002-09-25 19:05 ` David Mosberger
2002-09-25 19:28 ` Van Maren, Kevin
2002-09-25 19:33 ` Sane_Purushottam
2002-09-25 19:40 ` Wichmann, Mats D
2002-09-25 19:48 ` David Mosberger
2002-09-25 20:45 ` Grant Grundler
2002-09-25 21:07 ` Don Dugger
2002-09-25 21:25 ` Sane_Purushottam
2002-09-25 23:29 ` David Mosberger
2002-09-26 4:32 ` Don Dugger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-linux-ia64-105590701906058@msgid-missing \
--to=jjg@mscsoftware.com \
--cc=linux-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox