summaryrefslogtreecommitdiff
path: root/MdePkg/Library/SmmIoLibCpuIo/SmmCpuIoLibInternal.h
diff options
context:
space:
mode:
authordavidhuang <davidhuang@6f19259b-4bc3-4df7-8a09-765794883524>2009-12-23 06:44:33 +0000
committerdavidhuang <davidhuang@6f19259b-4bc3-4df7-8a09-765794883524>2009-12-23 06:44:33 +0000
commitb7c5912af1b21abba963fe1a3904d80ecaa41505 (patch)
treee892daf5aaa156059b6db2bacac6d6c48db9aba9 /MdePkg/Library/SmmIoLibCpuIo/SmmCpuIoLibInternal.h
parent2983a79df5840d344194da662e34877483bda903 (diff)
downloadedk2-platforms-b7c5912af1b21abba963fe1a3904d80ecaa41505.tar.xz
PI 1.1 SMM Feature Check-in
1. Add SmmServicesTableLib library class/instance. 2. Add SmmIoLibCpuIo/SmmPciLibPciRootBridgeIo library instance. 3. Update some library INF to support SMM_CORE module type. 4. Update dec/dsc to include new modules. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9590 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/SmmIoLibCpuIo/SmmCpuIoLibInternal.h')
-rw-r--r--MdePkg/Library/SmmIoLibCpuIo/SmmCpuIoLibInternal.h121
1 files changed, 121 insertions, 0 deletions
diff --git a/MdePkg/Library/SmmIoLibCpuIo/SmmCpuIoLibInternal.h b/MdePkg/Library/SmmIoLibCpuIo/SmmCpuIoLibInternal.h
new file mode 100644
index 0000000000..e221bc8d9e
--- /dev/null
+++ b/MdePkg/Library/SmmIoLibCpuIo/SmmCpuIoLibInternal.h
@@ -0,0 +1,121 @@
+/** @file
+ Internal include file of SMM CPU IO Library.
+ It includes all necessary protocol/library class's header file
+ for implementation of IoLib library instance. It is included
+ all source code of this library instance.
+
+ Copyright (c) 2009, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ Module Name: DxeCpuIoLibInternal.h
+
+**/
+
+#ifndef _SMM_CPUIO_LIB_INTERNAL_H_
+#define _SMM_CPUIO_LIB_INTERNAL_H_
+
+
+#include <PiSmm.h>
+#include <Protocol/SmmCpuIo.h>
+#include <Protocol/SmmPciRootBridgeIo.h>
+#include <Library/IoLib.h>
+#include <Library/DebugLib.h>
+#include <Library/BaseLib.h>
+#include <Library/SmmServicesTableLib.h>
+
+
+/**
+ Reads registers in the EFI CPU I/O space.
+
+ Reads the I/O port specified by Port with registers width specified by Width.
+ The read value is returned. If such operations are not supported, then ASSERT().
+ This function must guarantee that all I/O read and write operations are serialized.
+
+ @param Port The base address of the I/O operation.
+ The caller is responsible for aligning the Address if required.
+ @param Width The width of the I/O operation.
+
+ @return Data read from registers in the EFI CPU I/O space.
+
+**/
+UINT64
+EFIAPI
+IoReadWorker (
+ IN UINTN Port,
+ IN EFI_SMM_IO_WIDTH Width
+ );
+
+/**
+ Writes registers in the EFI CPU I/O space.
+
+ Writes the I/O port specified by Port with registers width and value specified by Width
+ and Data respectively. Data is returned. If such operations are not supported, then ASSERT().
+ This function must guarantee that all I/O read and write operations are serialized.
+
+ @param Port The base address of the I/O operation.
+ The caller is responsible for aligning the Address if required.
+ @param Width The width of the I/O operation.
+ @param Data The value to write to the I/O port.
+
+ @return The paramter of Data.
+
+**/
+UINT64
+EFIAPI
+IoWriteWorker (
+ IN UINTN Port,
+ IN EFI_SMM_IO_WIDTH Width,
+ IN UINT64 Data
+ );
+
+/**
+ Reads memory-mapped registers in the EFI system memory space.
+
+ Reads the MMIO registers specified by Address with registers width specified by Width.
+ The read value is returned. If such operations are not supported, then ASSERT().
+ This function must guarantee that all MMIO read and write operations are serialized.
+
+ @param Address The MMIO register to read.
+ The caller is responsible for aligning the Address if required.
+ @param Width The width of the I/O operation.
+
+ @return Data read from registers in the EFI system memory space.
+
+**/
+UINT64
+EFIAPI
+MmioReadWorker (
+ IN UINTN Address,
+ IN EFI_SMM_IO_WIDTH Width
+ );
+
+/**
+ Writes memory-mapped registers in the EFI system memory space.
+
+ Writes the MMIO registers specified by Address with registers width and value specified by Width
+ and Data respectively. Data is returned. If such operations are not supported, then ASSERT().
+ This function must guarantee that all MMIO read and write operations are serialized.
+
+ @param Address The MMIO register to read.
+ The caller is responsible for aligning the Address if required.
+ @param Width The width of the I/O operation.
+ @param Data The value to write to the I/O port.
+
+ @return Data read from registers in the EFI system memory space.
+
+**/
+UINT64
+EFIAPI
+MmioWriteWorker (
+ IN UINTN Address,
+ IN EFI_SMM_IO_WIDTH Width,
+ IN UINT64 Data
+ );
+
+#endif