2. Updated SetMem64.asm's to remove any SSE3 instructions.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@901
6f19259b-4bc3-4df7-8a09-
765794883524
If Source is NULL, then ASSERT().\r
If Source and Destination overlap, then ASSERT().\r
If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
If Source is NULL, then ASSERT().\r
If Source and Destination overlap, then ASSERT().\r
If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
- PcdMaximumUnicodeStringLength Unicode characters not including the \r
+ PcdMaximumUnicodeStringLength Unicode characters not including the\r
Null-terminator, then ASSERT().\r
\r
@param Destination Pointer to a Null-terminated Unicode string.\r
Null-terminator, then ASSERT().\r
\r
@param Destination Pointer to a Null-terminated Unicode string.\r
If Source is NULL, then ASSERT().\r
If Source and Destination overlap, then ASSERT().\r
If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
If Source is NULL, then ASSERT().\r
If Source and Destination overlap, then ASSERT().\r
If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
- PcdMaximumUnicodeStringLength Unicode characters not including the \r
+ PcdMaximumUnicodeStringLength Unicode characters not including the\r
Null-terminator, then ASSERT().\r
\r
@param Destination Pointer to a Null-terminated Unicode string.\r
Null-terminator, then ASSERT().\r
\r
@param Destination Pointer to a Null-terminated Unicode string.\r
\r
If String is NULL, then ASSERT().\r
If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
\r
If String is NULL, then ASSERT().\r
If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
- PcdMaximumUnicodeStringLength Unicode characters not including the \r
+ PcdMaximumUnicodeStringLength Unicode characters not including the\r
Null-terminator, then ASSERT().\r
\r
@param String Pointer to a Null-terminated Unicode string.\r
Null-terminator, then ASSERT().\r
\r
@param String Pointer to a Null-terminated Unicode string.\r
\r
If String is NULL, then ASSERT().\r
If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
\r
If String is NULL, then ASSERT().\r
If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
- PcdMaximumUnicodeStringLength Unicode characters not including the \r
+ PcdMaximumUnicodeStringLength Unicode characters not including the\r
Null-terminator, then ASSERT().\r
\r
@param String Pointer to a Null-terminated Unicode string.\r
Null-terminator, then ASSERT().\r
\r
@param String Pointer to a Null-terminated Unicode string.\r
If FirstString is NULL, then ASSERT().\r
If SecondString is NULL, then ASSERT().\r
If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more\r
If FirstString is NULL, then ASSERT().\r
If SecondString is NULL, then ASSERT().\r
If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more\r
- than PcdMaximumUnicodeStringLength Unicode characters not including the \r
+ than PcdMaximumUnicodeStringLength Unicode characters not including the\r
Null-terminator, then ASSERT().\r
If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more\r
Null-terminator, then ASSERT().\r
If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more\r
- than PcdMaximumUnicodeStringLength Unicode characters not including the \r
+ than PcdMaximumUnicodeStringLength Unicode characters not including the\r
Null-terminator, then ASSERT().\r
\r
@param FirstString Pointer to a Null-terminated Unicode string.\r
Null-terminator, then ASSERT().\r
\r
@param FirstString Pointer to a Null-terminated Unicode string.\r
If Entry is NULL, then ASSERT().\r
If ListHead was not initialized with InitializeListHead(), then ASSERT().\r
If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number\r
If Entry is NULL, then ASSERT().\r
If ListHead was not initialized with InitializeListHead(), then ASSERT().\r
If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number\r
- of nodes in ListHead, including the ListHead node, is greater than or \r
+ of nodes in ListHead, including the ListHead node, is greater than or\r
equal to PcdMaximumLinkedListLength, then ASSERT().\r
\r
@param ListHead A pointer to the head node of a doubly linked list.\r
equal to PcdMaximumLinkedListLength, then ASSERT().\r
\r
@param ListHead A pointer to the head node of a doubly linked list.\r
If Entry is NULL, then ASSERT().\r
If ListHead was not initialized with InitializeListHead(), then ASSERT().\r
If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number\r
If Entry is NULL, then ASSERT().\r
If ListHead was not initialized with InitializeListHead(), then ASSERT().\r
If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number\r
- of nodes in ListHead, including the ListHead node, is greater than or \r
+ of nodes in ListHead, including the ListHead node, is greater than or\r
equal to PcdMaximumLinkedListLength, then ASSERT().\r
\r
@param ListHead A pointer to the head node of a doubly linked list.\r
equal to PcdMaximumLinkedListLength, then ASSERT().\r
\r
@param ListHead A pointer to the head node of a doubly linked list.\r
\r
If List is NULL, then ASSERT().\r
If List was not initialized with InitializeListHead(), then ASSERT().\r
\r
If List is NULL, then ASSERT().\r
If List was not initialized with InitializeListHead(), then ASSERT().\r
- If PcdMaximumLinkedListLenth is not zero, and the number of nodes \r
- in List, including the List node, is greater than or equal to \r
+ If PcdMaximumLinkedListLenth is not zero, and the number of nodes\r
+ in List, including the List node, is greater than or equal to\r
PcdMaximumLinkedListLength, then ASSERT().\r
\r
@param List A pointer to the head node of a doubly linked list.\r
PcdMaximumLinkedListLength, then ASSERT().\r
\r
@param List A pointer to the head node of a doubly linked list.\r
\r
If ListHead is NULL, then ASSERT().\r
If ListHead was not initialized with InitializeListHead(), then ASSERT().\r
\r
If ListHead is NULL, then ASSERT().\r
If ListHead was not initialized with InitializeListHead(), then ASSERT().\r
- If PcdMaximumLinkedListLenth is not zero, and the number of nodes \r
- in List, including the List node, is greater than or equal to \r
+ If PcdMaximumLinkedListLenth is not zero, and the number of nodes\r
+ in List, including the List node, is greater than or equal to\r
PcdMaximumLinkedListLength, then ASSERT().\r
\r
@param ListHead A pointer to the head node of a doubly linked list.\r
PcdMaximumLinkedListLength, then ASSERT().\r
\r
@param ListHead A pointer to the head node of a doubly linked list.\r
If List is NULL, then ASSERT().\r
If Node is NULL, then ASSERT().\r
If List was not initialized with InitializeListHead(), then ASSERT().\r
If List is NULL, then ASSERT().\r
If Node is NULL, then ASSERT().\r
If List was not initialized with InitializeListHead(), then ASSERT().\r
- If PcdMaximumLinkedListLenth is not zero, and the number of nodes \r
- in List, including the List node, is greater than or equal to \r
+ If PcdMaximumLinkedListLenth is not zero, and the number of nodes\r
+ in List, including the List node, is greater than or equal to\r
PcdMaximumLinkedListLength, then ASSERT().\r
If Node is not a node in List and Node is not equal to List, then ASSERT().\r
\r
PcdMaximumLinkedListLength, then ASSERT().\r
If Node is not a node in List and Node is not equal to List, then ASSERT().\r
\r
If List is NULL, then ASSERT().\r
If Node is NULL, then ASSERT().\r
If List was not initialized with InitializeListHead(), then ASSERT().\r
If List is NULL, then ASSERT().\r
If Node is NULL, then ASSERT().\r
If List was not initialized with InitializeListHead(), then ASSERT().\r
- If PcdMaximumLinkedListLenth is not zero, and the number of nodes \r
- in List, including the List node, is greater than or equal to \r
+ If PcdMaximumLinkedListLenth is not zero, and the number of nodes\r
+ in List, including the List node, is greater than or equal to\r
PcdMaximumLinkedListLength, then ASSERT().\r
If Node is not a node in List, then ASSERT().\r
\r
PcdMaximumLinkedListLength, then ASSERT().\r
If Node is not a node in List, then ASSERT().\r
\r
If SecondEntry and FirstEntry are not in the same linked list, then ASSERT().\r
If PcdMaximumLinkedListLength is not zero, and the number of nodes in the\r
linked list containing the FirstEntry and SecondEntry nodes, including\r
If SecondEntry and FirstEntry are not in the same linked list, then ASSERT().\r
If PcdMaximumLinkedListLength is not zero, and the number of nodes in the\r
linked list containing the FirstEntry and SecondEntry nodes, including\r
- the FirstEntry and SecondEntry nodes, is greater than or equal to \r
+ the FirstEntry and SecondEntry nodes, is greater than or equal to\r
PcdMaximumLinkedListLength, then ASSERT().\r
\r
@param FirstEntry A pointer to a node in a linked list.\r
PcdMaximumLinkedListLength, then ASSERT().\r
\r
@param FirstEntry A pointer to a node in a linked list.\r
\r
If Entry is NULL, then ASSERT().\r
If Entry is the head node of an empty list, then ASSERT().\r
\r
If Entry is NULL, then ASSERT().\r
If Entry is the head node of an empty list, then ASSERT().\r
- If PcdMaximumLinkedListLength is not zero, and the number of nodes in the \r
- linked list containing Entry, including the Entry node, is greater than \r
+ If PcdMaximumLinkedListLength is not zero, and the number of nodes in the\r
+ linked list containing Entry, including the Entry node, is greater than\r
or equal to PcdMaximumLinkedListLength, then ASSERT().\r
\r
@param Entry A pointer to a node in a linked list\r
or equal to PcdMaximumLinkedListLength, then ASSERT().\r
\r
@param Entry A pointer to a node in a linked list\r
// Byte packed structure for an IDTR, GDTR, LDTR descriptor\r
/// @bug How to make this structure byte-packed in a compiler independent way?\r
//\r
// Byte packed structure for an IDTR, GDTR, LDTR descriptor\r
/// @bug How to make this structure byte-packed in a compiler independent way?\r
//\r
typedef struct {\r
UINT16 Limit;\r
UINTN Base;\r
} IA32_DESCRIPTOR;\r
typedef struct {\r
UINT16 Limit;\r
UINTN Base;\r
} IA32_DESCRIPTOR;\r
\r
#define IA32_IDT_GATE_TYPE_TASK 0x85\r
#define IA32_IDT_GATE_TYPE_INTERRUPT_16 0x86\r
\r
#define IA32_IDT_GATE_TYPE_TASK 0x85\r
#define IA32_IDT_GATE_TYPE_INTERRUPT_16 0x86\r
; IN UINT64 Value\r
; )\r
;------------------------------------------------------------------------------\r
; IN UINT64 Value\r
; )\r
;------------------------------------------------------------------------------\r
-InternalMemSetMem64 PROC USES edi\r
- movq mm0, [esp + 16]\r
- mov ecx, [esp + 12]\r
- mov edi, [esp + 8]\r
- mov eax, edi\r
+InternalMemSetMem64 PROC\r
+ mov eax, [esp + 4]\r
+ mov ecx, [esp + 8]\r
+ movq mm0, [esp + 12]\r
+ mov edx, eax\r
- movntq [edi], mm0\r
- add edi, 8\r
+ movntq [edx], mm0\r
+ add edx, 8\r
\r
;------------------------------------------------------------------------------\r
; VOID *\r
\r
;------------------------------------------------------------------------------\r
; VOID *\r
+; InternalMemSetMem64 (\r
; IN VOID *Buffer,\r
; IN UINTN Count,\r
; IN UINT64 Value\r
; )\r
;------------------------------------------------------------------------------\r
; IN VOID *Buffer,\r
; IN UINTN Count,\r
; IN UINT64 Value\r
; )\r
;------------------------------------------------------------------------------\r
-InternalMemSetMem64 PROC USES edi\r
- mov ecx, [esp + 12]\r
- mov edi, [esp + 8]\r
- test edi, 8\r
- DB 0f2h, 0fh, 12h, 44h, 24h, 16 ; movddup xmm0, [esp + 16]\r
+InternalMemSetMem64 PROC\r
+ mov eax, [esp + 4]\r
+ mov ecx, [esp + 8]\r
+ test al, 8\r
+ mov edx, eax\r
+ movq xmm0, [esp + 12]\r
- movq [edi], xmm0\r
- add edi, 8\r
+ movq [edx], xmm0\r
+ add edx, 8\r
shr ecx, 1\r
jz @SetQwords\r
shr ecx, 1\r
jz @SetQwords\r
- movntdq [edi], xmm0\r
- add edi, 16\r
+ movntdq [edx], xmm0\r
+ lea edx, [edx + 16]\r
loop @B\r
mfence\r
@SetQwords:\r
loop @B\r
mfence\r
@SetQwords:\r
- test dl, 1\r
- jz @F\r
- movq [edi], xmm0\r
+ jnc @F\r
+ movq [edx], xmm0\r
@@:\r
ret\r
InternalMemSetMem64 ENDP\r
@@:\r
ret\r
InternalMemSetMem64 ENDP\r
\r
;------------------------------------------------------------------------------\r
; VOID *\r
\r
;------------------------------------------------------------------------------\r
; VOID *\r
+; InternalMemSetMem64 (\r
; IN VOID *Buffer,\r
; IN UINTN Count,\r
; IN VOID *Buffer,\r
; IN UINTN Count,\r
; )\r
;------------------------------------------------------------------------------\r
; )\r
;------------------------------------------------------------------------------\r
-InternalMemSetMem64 PROC USES rdi\r
- mov rdi, rcx\r
- mov r9, rcx\r
- test cl, 8\r
+InternalMemSetMem64 PROC\r
+ mov rax, rcx\r
+ test dl, 8\r
+ xchg rcx, rdx\r
- mov [rdi], r8\r
- add rdi, 8\r
- dec rdx\r
+ mov [rdx], r8\r
+ add rdx, 8\r
+ dec rcx\r
shr rcx, 1\r
jz @SetQwords\r
movd xmm0, r8\r
movlhps xmm0, xmm0\r
@@:\r
shr rcx, 1\r
jz @SetQwords\r
movd xmm0, r8\r
movlhps xmm0, xmm0\r
@@:\r
- movntdq [rdi], xmm0\r
- add rdi, 16\r
+ movntdq [rdx], xmm0\r
+ lea rdx, [rdx + 16]\r
loop @B\r
mfence\r
@SetQwords:\r
loop @B\r
mfence\r
@SetQwords:\r
- test dl, 1\r
- jz @F\r
- mov [rdi], r8\r
+ jnc @F\r
+ mov [rdx], r8\r
@@:\r
ret\r
InternalMemSetMem64 ENDP\r
@@:\r
ret\r
InternalMemSetMem64 ENDP\r