]>
Commit | Line | Data |
---|---|---|
ec8547f6 | 1 | #------------------------------------------------------------------------------ |
2 | # | |
3 | # Copyright (c) 2006, Intel Corporation | |
4 | # All rights reserved. This program and the accompanying materials | |
5 | # are licensed and made available under the terms and conditions of the BSD License | |
6 | # which accompanies this distribution. The full text of the license may be found at | |
7 | # http://opensource.org/licenses/bsd-license.php | |
8 | # | |
9 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, | |
10 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. | |
11 | # | |
12 | # Module Name: | |
13 | # | |
14 | # CpuIdEx.Asm | |
15 | # | |
16 | # Abstract: | |
17 | # | |
18 | # AsmCpuidEx function | |
19 | # | |
20 | # Notes: | |
21 | # | |
22 | #------------------------------------------------------------------------------ | |
23 | ||
3f566587 | 24 | .686: |
25 | .code: | |
ec8547f6 | 26 | |
27 | #------------------------------------------------------------------------------ | |
28 | # UINT32 | |
29 | # EFIAPI | |
30 | # AsmCpuidEx ( | |
31 | # IN UINT32 RegisterInEax, | |
32 | # IN UINT32 RegisterInEcx, | |
33 | # OUT UINT32 *RegisterOutEax OPTIONAL, | |
34 | # OUT UINT32 *RegisterOutEbx OPTIONAL, | |
35 | # OUT UINT32 *RegisterOutEcx OPTIONAL, | |
36 | # OUT UINT32 *RegisterOutEdx OPTIONAL | |
37 | # ) | |
38 | #------------------------------------------------------------------------------ | |
39 | .globl _AsmCpuidEx | |
40 | _AsmCpuidEx: | |
41 | push %ebx | |
3f566587 | 42 | push %ebp |
ec8547f6 | 43 | movl %esp, %ebp |
44 | movl 12(%ebp), %eax | |
45 | movl 16(%ebp), %ecx | |
46 | cpuid | |
3f566587 | 47 | push %ecx |
ec8547f6 | 48 | movl 20(%ebp), %ecx |
49 | jecxz L1 | |
50 | movl %eax, (%ecx) | |
3f566587 | 51 | L1: |
ec8547f6 | 52 | movl 24(%ebp), %ecx |
53 | jecxz L2 | |
54 | movl %ebx, (%ecx) | |
3f566587 | 55 | L2: |
ec8547f6 | 56 | movl 28(%ebp), %ecx |
57 | jecxz L3 | |
1fe4ef1b | 58 | popl (%ecx) |
3f566587 | 59 | L3: |
ec8547f6 | 60 | movl 32(%ebp), %edx |
61 | jecxz L4 | |
62 | movl %edx, (%ecx) | |
3f566587 | 63 | L4: |
ec8547f6 | 64 | movl 12(%ebp), %eax |
ec8547f6 | 65 | leave |
1fe4ef1b | 66 | pop %ebx |
ec8547f6 | 67 | ret |