]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/CpuDxe/CpuDxe.h
Clean up DEC files:
[mirror_edk2.git] / UefiCpuPkg / CpuDxe / CpuDxe.h
index 91ae2b598ac384aea303f26ca578c327edb5c4fc..d42f82e0bda6ea9cc1939041f0f5a59bfa6840cf 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   CPU DXE Module.\r
 \r
-  Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2008 - 2010, 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
@@ -12,8 +12,8 @@
 \r
 **/\r
 \r
-#ifndef _CPU_DXE_H\r
-#define _CPU_DXE_H\r
+#ifndef _CPU_DXE_H_\r
+#define _CPU_DXE_H_\r
 \r
 #include <PiDxe.h>\r
 \r
                                        )\r
 \r
 \r
-//\r
-// Function declarations\r
-//\r
+/**\r
+  Flush CPU data cache. If the instruction cache is fully coherent\r
+  with all DMA operations then function can just return EFI_SUCCESS.\r
+\r
+  @param  This              Protocol instance structure\r
+  @param  Start             Physical address to start flushing from.\r
+  @param  Length            Number of bytes to flush. Round up to chipset\r
+                            granularity.\r
+  @param  FlushType         Specifies the type of flush operation to perform.\r
+\r
+  @retval EFI_SUCCESS       If cache was flushed\r
+  @retval EFI_UNSUPPORTED   If flush type is not supported.\r
+  @retval EFI_DEVICE_ERROR  If requested range could not be flushed.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CpuFlushCpuDataCache (\r
@@ -54,18 +66,46 @@ CpuFlushCpuDataCache (
   IN EFI_CPU_FLUSH_TYPE        FlushType\r
   );\r
 \r
+/**\r
+  Enables CPU interrupts.\r
+\r
+  @param  This              Protocol instance structure\r
+\r
+  @retval EFI_SUCCESS       If interrupts were enabled in the CPU\r
+  @retval EFI_DEVICE_ERROR  If interrupts could not be enabled on the CPU.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CpuEnableInterrupt (\r
   IN EFI_CPU_ARCH_PROTOCOL     *This\r
   );\r
 \r
+/**\r
+  Disables CPU interrupts.\r
+\r
+  @param  This              Protocol instance structure\r
+\r
+  @retval EFI_SUCCESS       If interrupts were disabled in the CPU.\r
+  @retval EFI_DEVICE_ERROR  If interrupts could not be disabled on the CPU.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CpuDisableInterrupt (\r
   IN EFI_CPU_ARCH_PROTOCOL     *This\r
   );\r
 \r
+/**\r
+  Return the state of interrupts.\r
+\r
+  @param  This                   Protocol instance structure\r
+  @param  State                  Pointer to the CPU's current interrupt state\r
+\r
+  @retval EFI_SUCCESS            If interrupts were disabled in the CPU.\r
+  @retval EFI_INVALID_PARAMETER  State is NULL.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CpuGetInterruptState (\r
@@ -73,6 +113,18 @@ CpuGetInterruptState (
   OUT BOOLEAN                   *State\r
   );\r
 \r
+/**\r
+  Generates an INIT to the CPU.\r
+\r
+  @param  This              Protocol instance structure\r
+  @param  InitType          Type of CPU INIT to perform\r
+\r
+  @retval EFI_SUCCESS       If CPU INIT occurred. This value should never be\r
+                            seen.\r
+  @retval EFI_DEVICE_ERROR  If CPU INIT failed.\r
+  @retval EFI_UNSUPPORTED   Requested type of CPU INIT not supported.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CpuInit (\r
@@ -80,6 +132,26 @@ CpuInit (
   IN EFI_CPU_INIT_TYPE         InitType\r
   );\r
 \r
+/**\r
+  Registers a function to be called from the CPU interrupt handler.\r
+\r
+  @param  This                   Protocol instance structure\r
+  @param  InterruptType          Defines which interrupt to hook. IA-32\r
+                                 valid range is 0x00 through 0xFF\r
+  @param  InterruptHandler       A pointer to a function of type\r
+                                 EFI_CPU_INTERRUPT_HANDLER that is called\r
+                                 when a processor interrupt occurs.  A null\r
+                                 pointer is an error condition.\r
+\r
+  @retval EFI_SUCCESS            If handler installed or uninstalled.\r
+  @retval EFI_ALREADY_STARTED    InterruptHandler is not NULL, and a handler\r
+                                 for InterruptType was previously installed.\r
+  @retval EFI_INVALID_PARAMETER  InterruptHandler is NULL, and a handler for\r
+                                 InterruptType was not previously installed.\r
+  @retval EFI_UNSUPPORTED        The interrupt specified by InterruptType\r
+                                 is not supported.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CpuRegisterInterruptHandler (\r
@@ -88,6 +160,29 @@ CpuRegisterInterruptHandler (
   IN EFI_CPU_INTERRUPT_HANDLER     InterruptHandler\r
   );\r
 \r
+/**\r
+  Returns a timer value from one of the CPU's internal timers. There is no\r
+  inherent time interval between ticks but is a function of the CPU frequency.\r
+\r
+  @param  This                - Protocol instance structure.\r
+  @param  TimerIndex          - Specifies which CPU timer is requested.\r
+  @param  TimerValue          - Pointer to the returned timer value.\r
+  @param  TimerPeriod         - A pointer to the amount of time that passes\r
+                                in femtoseconds (10-15) for each increment\r
+                                of TimerValue. If TimerValue does not\r
+                                increment at a predictable rate, then 0 is\r
+                                returned.  The amount of time that has\r
+                                passed between two calls to GetTimerValue()\r
+                                can be calculated with the formula\r
+                                (TimerValue2 - TimerValue1) * TimerPeriod.\r
+                                This parameter is optional and may be NULL.\r
+\r
+  @retval EFI_SUCCESS           - If the CPU timer count was returned.\r
+  @retval EFI_UNSUPPORTED       - If the CPU does not have any readable timers.\r
+  @retval EFI_DEVICE_ERROR      - If an error occurred while reading the timer.\r
+  @retval EFI_INVALID_PARAMETER - TimerIndex is not valid or TimerValue is NULL.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CpuGetTimerValue (\r
@@ -97,6 +192,22 @@ CpuGetTimerValue (
   OUT UINT64                      *TimerPeriod OPTIONAL\r
   );\r
 \r
+/**\r
+  Set memory cacheability attributes for given range of memeory.\r
+\r
+  @param  This                   Protocol instance structure\r
+  @param  BaseAddress            Specifies the start address of the\r
+                                 memory range\r
+  @param  Length                 Specifies the length of the memory range\r
+  @param  Attributes             The memory cacheability for the memory range\r
+\r
+  @retval EFI_SUCCESS            If the cacheability of that memory range is\r
+                                 set successfully\r
+  @retval EFI_UNSUPPORTED        If the desired operation cannot be done\r
+  @retval EFI_INVALID_PARAMETER  The input parameter is not correct,\r
+                                 such as Length = 0\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 CpuSetMemoryAttributes (\r
@@ -106,29 +217,57 @@ CpuSetMemoryAttributes (
   IN UINT64                     Attributes\r
   );\r
 \r
+/**\r
+  Label of base address of IDT vector 0.\r
+\r
+  This is just a label of base address of IDT vector 0.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 AsmIdtVector00 (\r
   VOID\r
   );\r
 \r
+/**\r
+  Initializes the pointer to the external interrupt vector table.\r
+\r
+  @param  VectorTable  Address of the external interrupt vector table.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 InitializeExternalVectorTablePtr (\r
   EFI_CPU_INTERRUPT_HANDLER  *VectorTable\r
   );\r
 \r
+/**\r
+  Initialize Global Descriptor Table.\r
+\r
+**/\r
 VOID\r
 InitGlobalDescriptorTable (\r
   VOID\r
   );\r
 \r
+/**\r
+  Sets the code selector (CS).\r
+\r
+  @param  Selector  Value of code selector.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 SetCodeSelector (\r
   UINT16 Selector\r
   );\r
 \r
+/**\r
+  Sets the data selector (DS).\r
+\r
+  @param  Selector  Value of data selector.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 SetDataSelectors (\r