Simon Glass | 8af719c | 2024-08-27 19:44:28 -0600 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
| 3 | .. index:: |
| 4 | single: cpuid (command) |
| 5 | |
| 6 | cpuid command |
| 7 | ============= |
| 8 | |
| 9 | Synopsis |
| 10 | -------- |
| 11 | |
| 12 | :: |
| 13 | |
| 14 | cpuid <op> |
| 15 | |
| 16 | Description |
| 17 | ----------- |
| 18 | |
| 19 | The cpuid command requests CPU-identification information on x86 CPUs. The |
| 20 | operation <op> selects what information is returned. Up to four 32-bit registers |
| 21 | can be update (eax-edx) depending on the operation. |
| 22 | |
| 23 | Configuration |
| 24 | ------------- |
| 25 | |
| 26 | The cpuid command is only available on x86. |
| 27 | |
| 28 | Return value |
| 29 | ------------ |
| 30 | |
| 31 | The return value $? is 0 (true). |
| 32 | |
| 33 | Example |
| 34 | ------- |
| 35 | |
| 36 | :: |
| 37 | |
| 38 | => cpuid 1 |
| 39 | eax 00060fb1 |
| 40 | ebx 00040800 |
| 41 | ecx 80002001 |
| 42 | edx 178bfbfd |
| 43 | |
| 44 | This shows checking for 64-bit 'long' mode:: |
| 45 | |
| 46 | => cpuid 80000000 |
| 47 | eax 8000000a |
| 48 | ebx 68747541 |
| 49 | ecx 444d4163 |
| 50 | edx 69746e65 |
| 51 | => cpuid 80000001 |
| 52 | eax 00060fb1 |
| 53 | ebx 00000000 |
| 54 | ecx 00000007 |
| 55 | edx 2193fbfd # Bit 29 is set in edx, so long mode is available |
| 56 | |
| 57 | On a 32-bit-only CPU:: |
| 58 | |
| 59 | => cpuid 80000000 |
| 60 | eax 80000004 |
| 61 | ebx 756e6547 |
| 62 | ecx 6c65746e |
| 63 | edx 49656e69 |
| 64 | => cpuid 80000001 |
| 65 | eax 00000663 |
| 66 | ebx 00000000 |
| 67 | ecx 00000000 |
| 68 | edx 00000000 # Bit 29 is not set in edx, so long mode is not available |