2007-06-15 12:02:42 +02:00
|
|
|
/** @file
|
2009-07-28 15:25:37 +02:00
|
|
|
This file declares the SMM SMRAM Access abstraction protocol, which is used to control
|
2008-04-08 09:40:30 +02:00
|
|
|
the visibility of the SMRAM on the platform. The expectation is
|
|
|
|
that the north bridge or memory controller would publish this protocol.
|
|
|
|
For example, the Memory Controller Hub (MCH) has the hardware provision for this
|
|
|
|
type of control. Because of the protected, distinguished class of memory for IA-32
|
|
|
|
systems, the expectation is that this protocol would be supported only on IA-32 systems.
|
2007-06-15 12:02:42 +02:00
|
|
|
|
2009-07-02 09:40:24 +02:00
|
|
|
Copyright (c) 2007 - 2009, Intel Corporation
|
2007-06-15 12:02:42 +02:00
|
|
|
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.
|
|
|
|
|
|
|
|
@par Revision Reference:
|
|
|
|
This Protocol is defined in Framework of EFI SMM Core Interface Spec
|
|
|
|
Version 0.9.
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef _SMM_ACCESS_H_
|
|
|
|
#define _SMM_ACCESS_H_
|
|
|
|
|
2007-06-28 14:23:11 +02:00
|
|
|
#include <Guid/SmramMemoryReserve.h>
|
2007-06-15 12:02:42 +02:00
|
|
|
|
|
|
|
typedef struct _EFI_SMM_ACCESS_PROTOCOL EFI_SMM_ACCESS_PROTOCOL;
|
|
|
|
|
|
|
|
#define EFI_SMM_ACCESS_PROTOCOL_GUID \
|
|
|
|
{ \
|
|
|
|
0x3792095a, 0xe309, 0x4c1e, {0xaa, 0x01, 0x85, 0xf5, 0x65, 0x5a, 0x17, 0xf1 } \
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// SMM Access specification Member Function
|
|
|
|
//
|
|
|
|
/**
|
|
|
|
Opens the SMRAM area to be accessible by a boot-service driver.
|
|
|
|
|
|
|
|
@param This The EFI_SMM_ACCESS_PROTOCOL instance.
|
|
|
|
@param DescriptorIndex Indicates that the driver wishes to open
|
|
|
|
the memory tagged by this index.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The operation was successful.
|
|
|
|
@retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
|
|
|
|
@retval EFI_NOT_STARTED The SMM base service has not been initialized.
|
|
|
|
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-07-31 09:44:54 +02:00
|
|
|
(EFIAPI *EFI_SMM_OPEN)(
|
2007-06-15 12:02:42 +02:00
|
|
|
IN EFI_SMM_ACCESS_PROTOCOL *This,
|
|
|
|
UINTN DescriptorIndex
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Inhibits access to the SMRAM.
|
|
|
|
|
|
|
|
@param This The EFI_SMM_ACCESS_PROTOCOL instance.
|
2009-06-03 07:59:40 +02:00
|
|
|
@param DescriptorIndex Indicates that the driver wishes to close
|
2007-06-15 12:02:42 +02:00
|
|
|
the memory tagged by this index.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The operation was successful.
|
|
|
|
@retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.
|
|
|
|
@retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
|
|
|
|
@retval EFI_NOT_STARTED The SMM base service has not been initialized.
|
|
|
|
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-07-31 09:44:54 +02:00
|
|
|
(EFIAPI *EFI_SMM_CLOSE)(
|
2007-06-15 12:02:42 +02:00
|
|
|
IN EFI_SMM_ACCESS_PROTOCOL *This,
|
|
|
|
UINTN DescriptorIndex
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Inhibits access to the SMRAM.
|
2009-06-03 07:59:40 +02:00
|
|
|
|
2007-06-15 12:02:42 +02:00
|
|
|
@param This The EFI_SMM_ACCESS_PROTOCOL instance.
|
2009-06-03 07:59:40 +02:00
|
|
|
@param DescriptorIndex Indicates that the driver wishes to lock
|
2007-06-15 12:02:42 +02:00
|
|
|
the memory tagged by this index.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The operation was successful.
|
|
|
|
@retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.
|
|
|
|
@retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
|
|
|
|
@retval EFI_NOT_STARTED The SMM base service has not been initialized.
|
|
|
|
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-07-31 09:44:54 +02:00
|
|
|
(EFIAPI *EFI_SMM_LOCK)(
|
2007-06-15 12:02:42 +02:00
|
|
|
IN EFI_SMM_ACCESS_PROTOCOL *This,
|
|
|
|
UINTN DescriptorIndex
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Queries the memory controller for the possible regions that will support SMRAM.
|
|
|
|
|
|
|
|
@param This The EFI_SMM_ACCESS_PROTOCOL instance.
|
|
|
|
@param SmramMapSize A pointer to the size, in bytes, of the SmramMemoryMap buffer.
|
|
|
|
@param SmramMap A pointer to the buffer in which firmware places the current memory map.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The chipset supported the given resource.
|
|
|
|
@retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small.
|
|
|
|
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-07-31 09:44:54 +02:00
|
|
|
(EFIAPI *EFI_SMM_CAPABILITIES)(
|
2007-06-15 12:02:42 +02:00
|
|
|
IN EFI_SMM_ACCESS_PROTOCOL *This,
|
|
|
|
IN OUT UINTN *SmramMapSize,
|
|
|
|
IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
This protocol is used to control the visibility of the SMRAM on the platform.
|
|
|
|
**/
|
|
|
|
struct _EFI_SMM_ACCESS_PROTOCOL {
|
2009-07-02 09:40:24 +02:00
|
|
|
EFI_SMM_OPEN Open; ///< Opens the SMRAM.
|
|
|
|
EFI_SMM_CLOSE Close; ///< Closes the SMRAM.
|
|
|
|
EFI_SMM_LOCK Lock; ///< Locks the SMRAM.
|
|
|
|
EFI_SMM_CAPABILITIES GetCapabilities; ///< Gets information on possible SMRAM regions.
|
|
|
|
BOOLEAN LockState; ///< Indicates the current state of the SMRAM. Set to TRUE if any region is locked.
|
|
|
|
BOOLEAN OpenState; ///< Indicates the current state of the SMRAM. Set to TRUE if any region is open.
|
2007-06-15 12:02:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
extern EFI_GUID gEfiSmmAccessProtocolGuid;
|
|
|
|
|
|
|
|
#endif
|