| 1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 |
|
| 3 |
/* It is derived from the x86info project, which is GPLv2-licensed. */ |
| 4 |
|
| 5 |
/* calling syntax: docpuid(idx,eax,ebx,ecx,edx) */ |
| 6 |
|
| 7 |
.align 4 |
| 8 |
.text |
| 9 |
|
| 10 |
.global docpuid |
| 11 |
.type docpuid,@function |
| 12 |
|
| 13 |
docpuid: |
| 14 |
pushl %ebp |
| 15 |
movl %esp, %ebp |
| 16 |
pushl %edi |
| 17 |
pushl %ebx |
| 18 |
pushl %ecx |
| 19 |
pushl %edx |
| 20 |
movl 8(%ebp),%eax |
| 21 |
cpuid |
| 22 |
movl 12(%ebp),%edi |
| 23 |
test %edi,%edi |
| 24 |
jz L1 |
| 25 |
movl %eax, (%edi) |
| 26 |
|
| 27 |
L1: movl 16(%ebp),%edi |
| 28 |
test %edi,%edi |
| 29 |
jz L2 |
| 30 |
movl %ebx,(%edi) |
| 31 |
|
| 32 |
L2: movl 20(%ebp),%edi |
| 33 |
test %edi,%edi |
| 34 |
jz L3 |
| 35 |
movl %ecx,(%edi) |
| 36 |
|
| 37 |
L3: movl 24(%ebp), %edi |
| 38 |
test %edi,%edi |
| 39 |
jz L4 |
| 40 |
movl %edx,(%edi) |
| 41 |
|
| 42 |
L4: popl %edx |
| 43 |
popl %ecx |
| 44 |
popl %ebx |
| 45 |
popl %edi |
| 46 |
movl %ebp,%esp |
| 47 |
popl %ebp |
| 48 |
ret |
| 49 |
|
| 50 |
.section .note.GNU-stack,"", @progbits |