]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/Ebc/Dxe/EbcInt.c
Add some definitions for efi event in Uefi/UefiSpec.h to follow spec.
[mirror_edk2.git] / EdkModulePkg / Universal / Ebc / Dxe / EbcInt.c
index b42ff170560992b05d32ce7b7981334ddf1baa08..2b647d9bae3792c8a0d29b590d0f95db85bdb88f 100644 (file)
@@ -1,24 +1,24 @@
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. 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) 2006, Intel Corporation\r
+All rights reserved. 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
-Module Name:  \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
+\r
+Module Name:\r
 \r
   EbcInt.c\r
-  \r
+\r
 Abstract:\r
 \r
   Top level module for the EBC virtual machine implementation.\r
   Provides auxilliary support routines for the VM. That is, routines\r
   that are not particularly related to VM execution of EBC instructions.\r
-  \r
+\r
 --*/\r
 \r
 #include "EbcInt.h"\r
@@ -196,17 +196,17 @@ InitializeEbcDriver (
   )\r
 /*++\r
 \r
-Routine Description: \r
+Routine Description:\r
 \r
-  Initializes the VM EFI interface.  Allocates memory for the VM interface \r
+  Initializes the VM EFI interface.  Allocates memory for the VM interface\r
   and registers the VM protocol.\r
 \r
-Arguments:  \r
+Arguments:\r
 \r
   ImageHandle - EFI image handle.\r
   SystemTable - Pointer to the EFI system table.\r
 \r
-Returns:  \r
+Returns:\r
   Standard EFI status code.\r
 \r
 --*/\r
@@ -396,9 +396,9 @@ EbcCreateThunk (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   This is the top-level routine plugged into the EBC protocol. Since thunks\r
-  are very processor-specific, from here we dispatch directly to the very \r
+  are very processor-specific, from here we dispatch directly to the very\r
   processor-specific routine EbcCreateThunks().\r
 \r
 Arguments:\r
@@ -438,7 +438,7 @@ EbcDebugGetMaximumProcessorIndex (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   This EBC debugger protocol service is called by the debug agent\r
 \r
 Arguments:\r
@@ -446,7 +446,7 @@ Arguments:
   This              - pointer to the caller's debug support protocol interface\r
   MaxProcessorIndex - pointer to a caller allocated UINTN in which the maximum\r
                       processor index is returned.\r
-                                               \r
+\r
 Returns:\r
 \r
   Standard EFI_STATUS\r
@@ -468,10 +468,10 @@ EbcDebugRegisterPeriodicCallback (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   This protocol service is called by the debug agent to register a function\r
   for us to call on a periodic basis.\r
-  \r
+\r
 \r
 Arguments:\r
 \r
@@ -490,7 +490,7 @@ Returns:
   if ((mDebugPeriodicCallback != NULL) && (PeriodicCallback != NULL)) {\r
     return EFI_ALREADY_STARTED;\r
   }\r
-       \r
+\r
   mDebugPeriodicCallback = PeriodicCallback;\r
   return EFI_SUCCESS;\r
 }\r
@@ -507,10 +507,10 @@ EbcDebugRegisterExceptionCallback (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   This protocol service is called by the debug agent to register a function\r
   for us to call when we detect an exception.\r
-  \r
+\r
 \r
 Arguments:\r
 \r
@@ -548,12 +548,12 @@ EbcDebugInvalidateInstructionCache (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   This EBC debugger protocol service is called by the debug agent.  Required\r
   for DebugSupport compliance but is only stubbed out for EBC.\r
 \r
 Arguments:\r
-                                               \r
+\r
 Returns:\r
 \r
   EFI_SUCCESS\r
@@ -574,7 +574,7 @@ EbcDebugSignalException (
 Routine Description:\r
 \r
   The VM interpreter calls this function when an exception is detected.\r
-  \r
+\r
 Arguments:\r
 \r
   VmPtr - pointer to a VM context for passing info to the EFI debugger.\r
@@ -582,7 +582,7 @@ Arguments:
 Returns:\r
 \r
   EFI_SUCCESS if it returns at all\r
-  \r
+\r
 --*/\r
 {\r
   EFI_SYSTEM_CONTEXT_EBC  EbcContext;\r
@@ -641,7 +641,7 @@ Returns:
     VmPtr->Ip    = (VMIP)(UINTN)EbcContext.Ip;\r
     VmPtr->Flags = EbcContext.Flags;\r
   }\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -655,7 +655,7 @@ InitializeEbcCallback (
 Routine Description:\r
 \r
   To install default Callback function for the VM interpreter.\r
-  \r
+\r
 Arguments:\r
 \r
   This - pointer to the instance of DebugSupport protocol\r
@@ -663,7 +663,7 @@ Arguments:
 Returns:\r
 \r
   None\r
-  \r
+\r
 --*/\r
 {\r
   INTN       Index;\r
@@ -685,8 +685,8 @@ Returns:
   // For PeriodicCallback\r
   //\r
   Status = gBS->CreateEvent (\r
-                  EFI_EVENT_TIMER | EFI_EVENT_NOTIFY_SIGNAL,\r
-                  EFI_TPL_NOTIFY,\r
+                  EVT_TIMER | EVT_NOTIFY_SIGNAL,\r
+                  TPL_NOTIFY,\r
                   EbcPeriodicNotifyFunction,\r
                   &mVmPtr,\r
                   &mEbcPeriodicEvent\r
@@ -720,7 +720,7 @@ Routine Description:
   The default Exception Callback for the VM interpreter.\r
   In this function, we report status code, and print debug information\r
   about EBC_CONTEXT, then dead loop.\r
-  \r
+\r
 Arguments:\r
 \r
   InterruptType - Interrupt type.\r
@@ -729,7 +729,7 @@ Arguments:
 Returns:\r
 \r
   None\r
-  \r
+\r
 --*/\r
 {\r
   //\r
@@ -753,7 +753,7 @@ Routine Description:
 \r
   The periodic callback function for EBC VM interpreter, which is used\r
   to support the EFI debug support protocol.\r
-  \r
+\r
 Arguments:\r
 \r
   Event   - The Periodic Callback Event.\r
@@ -762,7 +762,7 @@ Arguments:
 Returns:\r
 \r
   None.\r
-  \r
+\r
 --*/\r
 {\r
   VM_CONTEXT *VmPtr;\r
@@ -787,7 +787,7 @@ Routine Description:
 \r
   The VM interpreter calls this function on a periodic basis to support\r
   the EFI debug support protocol.\r
-  \r
+\r
 Arguments:\r
 \r
   VmPtr - pointer to a VM context for passing info to the debugger.\r
@@ -795,12 +795,12 @@ Arguments:
 Returns:\r
 \r
   Standard EFI status.\r
-  \r
+\r
 --*/\r
 {\r
   EFI_SYSTEM_CONTEXT_EBC   EbcContext;\r
   EFI_SYSTEM_CONTEXT       SystemContext;\r
-  \r
+\r
   //\r
   // If someone's registered for periodic callbacks, then call them.\r
   //\r
@@ -838,7 +838,7 @@ Returns:
     VmPtr->Ip    = (VMIP)(UINTN)EbcContext.Ip;\r
     VmPtr->Flags = EbcContext.Flags;\r
   }\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -852,8 +852,8 @@ EbcUnloadImage (
 /*++\r
 \r
 Routine Description:\r
-  \r
-  This routine is called by the core when an image is being unloaded from \r
+\r
+  This routine is called by the core when an image is being unloaded from\r
   memory. Basically we now have the opportunity to do any necessary cleanup.\r
   Typically this will include freeing any memory allocated for thunk-creation.\r
 \r
@@ -931,8 +931,8 @@ EbcAddImageThunk (
 /*++\r
 \r
 Routine Description:\r
-  \r
-  Add a thunk to our list of thunks for a given image handle. \r
+\r
+  Add a thunk to our list of thunks for a given image handle.\r
   Also flush the instruction cache since we've written thunk code\r
   to memory that will be executed eventually.\r
 \r
@@ -943,7 +943,7 @@ Arguments:
   ThunkSize    - the size of the thunk memory allocated\r
 \r
 Returns:\r
\r
+\r
   EFI_OUT_OF_RESOURCES    - memory allocation failed\r
   EFI_SUCCESS             - successful completion\r
 \r
@@ -1041,7 +1041,7 @@ GetEBCStack(
 {\r
   UINTN   Index;\r
   EFI_TPL OldTpl;\r
-  OldTpl = gBS->RaiseTPL(EFI_TPL_HIGH_LEVEL);\r
+  OldTpl = gBS->RaiseTPL(TPL_HIGH_LEVEL);\r
   for (Index = 0; Index < mStackNum; Index ++) {\r
     if (mStackBufferIndex[Index] == NULL) {\r
       mStackBufferIndex[Index] = Handle;\r
@@ -1121,7 +1121,7 @@ InitEbcVmTestProtocol (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Produce an EBC VM test protocol that can be used for regression tests.\r
 \r
 Arguments:\r