]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Ia32/Nasm.inc
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Include / Ia32 / Nasm.inc
index c018bb3cae5bdda796eaf9fcc8d236b7b40fd68c..e92c032bd8dbb6bfc72ba76c8ac72cbcf637beb8 100644 (file)
@@ -1,13 +1,7 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+; Copyright (c) 2019 - 2022, Intel Corporation. All rights reserved.<BR>\r
+; SPDX-License-Identifier: BSD-2-Clause-Patent\r
 ;\r
 ; Abstract:\r
 ;\r
 ;\r
 ;------------------------------------------------------------------------------\r
 \r
-%macro SETSSBSY        0\r
-    DB 0xF3, 0x0F, 0x01, 0xE8\r
-%endmacro\r
-\r
-%macro READSSP_EAX     0\r
-    DB 0xF3, 0x0F, 0x1E, 0xC8\r
-%endmacro\r
+; NASM provides built-in macros STRUC and ENDSTRUC for structure definition.\r
+; For example, to define a structure called mytype containing a longword,\r
+; a word, a byte and a string of bytes, you might code\r
+;\r
+; struc   mytype\r
+;\r
+;  mt_long:      resd    1\r
+;  mt_word:      resw    1\r
+;  mt_byte:      resb    1\r
+;  mt_str:       resb    32\r
+;\r
+; endstruc\r
+;\r
+; Below macros are help to map the C types and the RESB family of pseudo-instructions.\r
+; So that the above structure definition can be coded as\r
+;\r
+; struc   mytype\r
+;\r
+;  mt_long:      CTYPE_UINT32    1\r
+;  mt_word:      CTYPE_UINT16    1\r
+;  mt_byte:      CTYPE_UINT8     1\r
+;  mt_str:       CTYPE_CHAR8     32\r
+;\r
+; endstruc\r
+%define CTYPE_UINT64    resq\r
+%define CTYPE_INT64     resq\r
+%define CTYPE_UINT32    resd\r
+%define CTYPE_INT32     resd\r
+%define CTYPE_UINT16    resw\r
+%define CTYPE_INT16     resw\r
+%define CTYPE_BOOLEAN   resb\r
+%define CTYPE_UINT8     resb\r
+%define CTYPE_CHAR8     resb\r
+%define CTYPE_INT8      resb\r
 \r
-%macro INCSSP_EAX      0\r
-    DB 0xF3, 0x0F, 0xAE, 0xE8\r
-%endmacro\r
+%define CTYPE_UINTN     resd\r
+%define CTYPE_INTN      resd\r