Refine CPU I/O Protocol definition.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8718 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
xli24 2009-07-02 05:27:47 +00:00
parent 358e78ed4c
commit c715423427

View File

@ -2,7 +2,7 @@
This code abstracts the CPU IO Protocol which installed by some platform or chipset-specific This code abstracts the CPU IO Protocol which installed by some platform or chipset-specific
PEIM that abstracts the processor-visible I/O operations. PEIM that abstracts the processor-visible I/O operations.
Copyright (c) 2007, Intel Corporation Copyright (c) 2007 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -11,8 +11,6 @@
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: CpuIO.h
@par Revision Reference: @par Revision Reference:
CPU IO Protocol is defined in Framework of EFI CPU IO Protocol Spec CPU IO Protocol is defined in Framework of EFI CPU IO Protocol Spec
Version 0.9 Version 0.9
@ -31,11 +29,9 @@
typedef struct _EFI_CPU_IO_PROTOCOL EFI_CPU_IO_PROTOCOL; typedef struct _EFI_CPU_IO_PROTOCOL EFI_CPU_IO_PROTOCOL;
// ///
// ******************************************************* /// Enumeration that defines the width of the I/O operation.
// EFI_CPU_IO_PROTOCOL_WIDTH ///
// *******************************************************
//
typedef enum { typedef enum {
EfiCpuIoWidthUint8, EfiCpuIoWidthUint8,
EfiCpuIoWidthUint16, EfiCpuIoWidthUint16,
@ -52,11 +48,6 @@ typedef enum {
EfiCpuIoWidthMaximum EfiCpuIoWidthMaximum
} EFI_CPU_IO_PROTOCOL_WIDTH; } EFI_CPU_IO_PROTOCOL_WIDTH;
//
// *******************************************************
// EFI_CPU_IO_PROTOCOL_IO_MEM
// *******************************************************
//
/** /**
Enables a driver to access memory-mapped registers in the EFI system memory space. Enables a driver to access memory-mapped registers in the EFI system memory space.
Or, Enables a driver to access registers in the EFI CPU I/O space. Or, Enables a driver to access registers in the EFI CPU I/O space.
@ -85,40 +76,32 @@ EFI_STATUS
IN OUT VOID *Buffer IN OUT VOID *Buffer
); );
// ///
// ******************************************************* /// Servies for read and write accesses.
// EFI_CPU_IO_PROTOCOL_ACCESS ///
// *******************************************************
//
typedef struct { typedef struct {
///
/// This service provides the various modalities of memory and I/O read.
///
EFI_CPU_IO_PROTOCOL_IO_MEM Read; EFI_CPU_IO_PROTOCOL_IO_MEM Read;
///
/// This service provides the various modalities of memory and I/O write.
///
EFI_CPU_IO_PROTOCOL_IO_MEM Write; EFI_CPU_IO_PROTOCOL_IO_MEM Write;
} EFI_CPU_IO_PROTOCOL_ACCESS; } EFI_CPU_IO_PROTOCOL_ACCESS;
// ///
// ******************************************************* /// Provides the basic memory and I/O interfaces that are used to abstract
// EFI_CPU_IO_PROTOCOL /// accesses to devices in a system.
// ******************************************************* ///
//
/**
Provides the basic memory and I/O interfaces that are used to abstract
accesses to devices in a system.
@param Mem.Read
Allows reads from memory-mapped I/O space.
@param Mem.Write
Allows writes to memory-mapped I/O space.
@param Io.Read
Allows reads from I/O space.
@param Io.Write
Allows writes to I/O space.
**/
struct _EFI_CPU_IO_PROTOCOL { struct _EFI_CPU_IO_PROTOCOL {
///
/// Enables a driver to access memory-mapped registers in the EFI system memory space.
///
EFI_CPU_IO_PROTOCOL_ACCESS Mem; EFI_CPU_IO_PROTOCOL_ACCESS Mem;
///
/// Enables a driver to access registers in the EFI CPU I/O space.
///
EFI_CPU_IO_PROTOCOL_ACCESS Io; EFI_CPU_IO_PROTOCOL_ACCESS Io;
}; };