Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
620 views
in Technique[技术] by (71.8m points)

linux - Possible values for `uname -m`

The uname(1) command-line utility has a -m option which prints the "machine hardware name".

On Linux, this field comes from the machine member of struct utsname, as populated by the uname(2) system call.

Many other language APIs return this information:

What are the possible values for the "machine" field?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Linux

(v4.12 - 2017-July)

Let's refer to the source of the newuname system call.

Tracking this down is complicated by the fact that Linux has UTS namespaces, but the init_uts_ns machine field is initialized by the UTS_MACHINE macro, which is defined per-architecture.

Further complicating matters, machine can be overridden via override_architecture(), if the process is running under a 32-bit "compat" personality, to COMPAT_UTS_MACHINE.

UTS_MACHINE defaults in Makefile to the same thing as ARCH. However, many platforms have separate sub-architectures under the same arch directory, so they set UTS_MACHINE themselves

With the list of directories in arch/ and a little grep-ing of the Linux kernel sources (git grep 'UTS_MACHINEs*:=' and git grep COMPAT_UTS_MACHINE), we can arrive at this list:

  • alpha
  • arc

  • arm

  • aarch64_be (arm64)
  • aarch64 (arm64)
  • armv8b (arm64 compat)
  • armv8l (arm64 compat)

  • blackfin

  • c6x
  • cris
  • frv
  • h8300
  • hexagon
  • ia64
  • m32r
  • m68k
  • metag
  • microblaze
  • mips (native or compat)
  • mips64 (mips)
  • mn10300
  • nios2
  • openrisc
  • parisc (native or compat)
  • parisc64 (parisc)
  • ppc (powerpc native or compat)
  • ppc64 (powerpc)
  • ppcle (powerpc native or compat)
  • ppc64le (powerpc)
  • s390 (s390x compat)
  • s390x
  • score
  • sh
  • sh64 (sh)
  • sparc (native or compat)
  • sparc64 (sparc)
  • tile
  • unicore32
  • i386 (x86)
  • i686 (x86 compat)
  • x86_64 (x64)
  • xtensa

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...