2008-04-09 09:07:50 +02:00
|
|
|
/** @file
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-04-09 09:07:50 +02:00
|
|
|
UEFI Event support functions and structure.
|
|
|
|
|
|
|
|
Copyright (c) 2006 - 2008, Intel Corporation
|
2007-07-04 12:51:54 +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.
|
|
|
|
|
2008-04-09 09:07:50 +02:00
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
|
|
|
|
#ifndef _EXEC_H_
|
|
|
|
#define _EXEC_H_
|
|
|
|
|
|
|
|
#define VALID_TPL(a) ((a) <= TPL_HIGH_LEVEL)
|
|
|
|
|
|
|
|
//
|
|
|
|
// EFI_EVENT
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define EVENT_SIGNATURE EFI_SIGNATURE_32('e','v','n','t')
|
|
|
|
typedef struct {
|
|
|
|
UINTN Signature;
|
|
|
|
UINT32 Type;
|
|
|
|
UINT32 SignalCount;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Entry if the event is registered to be signalled
|
|
|
|
//
|
|
|
|
|
|
|
|
LIST_ENTRY SignalLink;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Notification information for this event
|
|
|
|
//
|
|
|
|
|
|
|
|
EFI_TPL NotifyTpl;
|
|
|
|
EFI_EVENT_NOTIFY NotifyFunction;
|
|
|
|
VOID *NotifyContext;
|
|
|
|
EFI_GUID EventGroup;
|
|
|
|
LIST_ENTRY NotifyLink;
|
|
|
|
BOOLEAN ExFlag;
|
|
|
|
|
|
|
|
//
|
|
|
|
// A list of all runtime events
|
|
|
|
//
|
|
|
|
EFI_RUNTIME_EVENT_ENTRY RuntimeData;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Information by event type
|
|
|
|
//
|
|
|
|
|
|
|
|
union {
|
|
|
|
//
|
|
|
|
// For timer events
|
|
|
|
//
|
|
|
|
struct {
|
|
|
|
LIST_ENTRY Link;
|
|
|
|
UINT64 TriggerTime;
|
|
|
|
UINT64 Period;
|
|
|
|
} Timer;
|
|
|
|
} u;
|
|
|
|
|
|
|
|
} IEVENT;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Internal prototypes
|
|
|
|
//
|
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Dispatches all pending events.
|
|
|
|
|
|
|
|
@param Priority The task priority level of event notifications
|
|
|
|
to dispatch
|
|
|
|
|
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
VOID
|
|
|
|
CoreDispatchEventNotifies (
|
|
|
|
IN EFI_TPL Priority
|
|
|
|
)
|
2008-05-09 09:08:30 +02:00
|
|
|
;
|
2007-07-04 12:51:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
/**
|
|
|
|
Return the highest set bit.
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
@param Number The value to check
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
@return Bit position of the highest set bit
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
UINTN
|
|
|
|
CoreHighestSetBit (
|
|
|
|
IN UINTN Number
|
|
|
|
)
|
2008-05-09 09:08:30 +02:00
|
|
|
;
|
2007-07-04 12:51:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
/**
|
|
|
|
Disables CPU interrupts.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS If interrupts were disabled in the CPU.
|
|
|
|
@retval EFI_INVALID_PARAMETER State is NULL.
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
BOOLEAN
|
|
|
|
GetInterruptState (
|
|
|
|
VOID
|
|
|
|
)
|
|
|
|
;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Exported functions
|
|
|
|
//
|
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
A function out of date, should be removed.
|
|
|
|
|
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
VOID
|
|
|
|
CoreEventVirtualAddressFixup (
|
|
|
|
VOID
|
|
|
|
)
|
2008-05-09 09:08:30 +02:00
|
|
|
;
|
2007-07-04 12:51:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
/**
|
|
|
|
Initializes timer support.
|
2007-07-04 12:51:54 +02:00
|
|
|
|
2008-05-09 09:08:30 +02:00
|
|
|
**/
|
2007-07-04 12:51:54 +02:00
|
|
|
VOID
|
|
|
|
CoreInitializeTimer (
|
|
|
|
VOID
|
|
|
|
)
|
|
|
|
;
|
|
|
|
|
|
|
|
//
|
|
|
|
// extern data declarations
|
|
|
|
//
|
|
|
|
|
|
|
|
extern EFI_LOCK gEventQueueLock;
|
|
|
|
extern UINTN gEventPending;
|
|
|
|
extern LIST_ENTRY gEventQueue[];
|
|
|
|
extern LIST_ENTRY gEventSignalQueue;
|
|
|
|
|
|
|
|
#endif
|