mirror of
				https://git.proxmox.com/git/mirror_edk2
				synced 2025-10-31 09:21:56 +00:00 
			
		
		
		
	 7d7c2b4640
			
		
	
	
		7d7c2b4640
		
	
	
	
	
		
			
			Added SwitchStack.c in Baselib\ Rename Ia32/SwitchStack.c to Ia32/InternalSwitchStack.c Changed _SwitchStack() into InternalSwitchStack() in SwitchStack.asm and SwitchStack.s Fixed one bug in LinkedList.c, that List length couldn't up to PcdMaximumLinkedListLength. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@394 6f19259b-4bc3-4df7-8a09-765794883524
		
			
				
	
	
		
			205 lines
		
	
	
		
			4.5 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			205 lines
		
	
	
		
			4.5 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| /** @file
 | |
|   Declaration of internal functions in BaseLib.
 | |
| 
 | |
|   Copyright (c) 2006, Intel Corporation<BR>
 | |
|   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:  BaseLibInternals.h
 | |
| 
 | |
| **/
 | |
| 
 | |
| #ifndef __BASE_LIB_INTERNALS__
 | |
| #define __BASE_LIB_INTERNALS__
 | |
| 
 | |
| //
 | |
| // Math functions
 | |
| //
 | |
| 
 | |
| UINT64
 | |
| EFIAPI
 | |
| InternalMathLShiftU64 (
 | |
|   IN      UINT64                    Operand,
 | |
|   IN      UINTN                     Count
 | |
|   );
 | |
| 
 | |
| UINT64
 | |
| EFIAPI
 | |
| InternalMathRShiftU64 (
 | |
|   IN      UINT64                    Operand,
 | |
|   IN      UINTN                     Count
 | |
|   );
 | |
| 
 | |
| UINT64
 | |
| EFIAPI
 | |
| InternalMathARShiftU64 (
 | |
|   IN      UINT64                    Operand,
 | |
|   IN      UINTN                     Count
 | |
|   );
 | |
| 
 | |
| UINT64
 | |
| EFIAPI
 | |
| InternalMathLRotU64 (
 | |
|   IN      UINT64                    Operand,
 | |
|   IN      UINTN                     Count
 | |
|   );
 | |
| 
 | |
| UINT64
 | |
| EFIAPI
 | |
| InternalMathRRotU64 (
 | |
|   IN      UINT64                    Operand,
 | |
|   IN      UINTN                     Count
 | |
|   );
 | |
| 
 | |
| UINT64
 | |
| EFIAPI
 | |
| InternalMathSwapBytes64 (
 | |
|   IN      UINT64                    Operand
 | |
|   );
 | |
| 
 | |
| UINT64
 | |
| EFIAPI
 | |
| InternalMathMultU64x32 (
 | |
|   IN      UINT64                    Multiplicand,
 | |
|   IN      UINT32                    Multiplier
 | |
|   );
 | |
| 
 | |
| UINT64
 | |
| EFIAPI
 | |
| InternalMathMultU64x64 (
 | |
|   IN      UINT64                    Multiplicand,
 | |
|   IN      UINT64                    Multiplier
 | |
|   );
 | |
| 
 | |
| UINT64
 | |
| EFIAPI
 | |
| InternalMathDivU64x32 (
 | |
|   IN      UINT64                    Dividend,
 | |
|   IN      UINT32                    Divisor
 | |
|   );
 | |
| 
 | |
| UINT32
 | |
| EFIAPI
 | |
| InternalMathModU64x32 (
 | |
|   IN      UINT64                    Dividend,
 | |
|   IN      UINT32                    Divisor
 | |
|   );
 | |
| 
 | |
| UINT64
 | |
| EFIAPI
 | |
| InternalMathDivRemU64x32 (
 | |
|   IN      UINT64                    Dividend,
 | |
|   IN      UINT32                    Divisor,
 | |
|   OUT     UINT32                    *Remainder
 | |
|   );
 | |
| 
 | |
| UINT64
 | |
| EFIAPI
 | |
| InternalMathDivRemU64x64 (
 | |
|   IN      UINT64                    Dividend,
 | |
|   IN      UINT64                    Divisor,
 | |
|   OUT     UINT64                    *Remainder
 | |
|   );
 | |
| 
 | |
| INT64
 | |
| EFIAPI
 | |
| InternalMathDivRemS64x64 (
 | |
|   IN      INT64                     Dividend,
 | |
|   IN      INT64                     Divisor,
 | |
|   OUT     INT64                     *Remainder
 | |
|   );
 | |
| 
 | |
| VOID
 | |
| EFIAPI
 | |
| InternalSwitchStack (
 | |
|   IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,
 | |
|   IN      VOID                      *Context1,
 | |
|   IN      VOID                      *Context2,
 | |
|   IN      VOID                      *NewStack
 | |
|   );
 | |
| 
 | |
| //
 | |
| // Ia32 and x64 specific functions
 | |
| //
 | |
| 
 | |
| VOID
 | |
| EFIAPI
 | |
| InternalX86ReadGdtr (
 | |
|   OUT     IA32_DESCRIPTOR           *Gdtr
 | |
|   );
 | |
| 
 | |
| VOID
 | |
| EFIAPI
 | |
| InternalX86WriteGdtr (
 | |
|   IN      CONST IA32_DESCRIPTOR     *Gdtr
 | |
|   );
 | |
| 
 | |
| VOID
 | |
| EFIAPI
 | |
| InternalX86ReadIdtr (
 | |
|   OUT     IA32_DESCRIPTOR           *Idtr
 | |
|   );
 | |
| 
 | |
| VOID
 | |
| EFIAPI
 | |
| InternalX86WriteIdtr (
 | |
|   IN      CONST IA32_DESCRIPTOR     *Idtr
 | |
|   );
 | |
| 
 | |
| VOID
 | |
| EFIAPI
 | |
| InternalX86FxSave (
 | |
|   OUT     IA32_FX_BUFFER            *Buffer
 | |
|   );
 | |
| 
 | |
| VOID
 | |
| EFIAPI
 | |
| InternalX86FxRestore (
 | |
|   IN      CONST IA32_FX_BUFFER      *Buffer
 | |
|   );
 | |
| 
 | |
| VOID
 | |
| EFIAPI
 | |
| InternalX86EnablePaging32 (
 | |
|   IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,
 | |
|   IN      VOID                      *Context1,  OPTIONAL
 | |
|   IN      VOID                      *Context2,  OPTIONAL
 | |
|   IN      VOID                      *NewStack
 | |
|   );
 | |
| 
 | |
| VOID
 | |
| EFIAPI
 | |
| InternalX86DisablePaging32 (
 | |
|   IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,
 | |
|   IN      VOID                      *Context1,  OPTIONAL
 | |
|   IN      VOID                      *Context2,  OPTIONAL
 | |
|   IN      VOID                      *NewStack
 | |
|   );
 | |
| 
 | |
| VOID
 | |
| EFIAPI
 | |
| InternalX86EnablePaging64 (
 | |
|   IN      UINT16                    Cs,
 | |
|   IN      UINT64                    EntryPoint,
 | |
|   IN      UINT64                    Context1,  OPTIONAL
 | |
|   IN      UINT64                    Context2,  OPTIONAL
 | |
|   IN      UINT64                    NewStack
 | |
|   );
 | |
| 
 | |
| VOID
 | |
| EFIAPI
 | |
| InternalX86DisablePaging64 (
 | |
|   IN      UINT16                    Cs,
 | |
|   IN      UINT32                    EntryPoint,
 | |
|   IN      UINT32                    Context1,  OPTIONAL
 | |
|   IN      UINT32                    Context2,  OPTIONAL
 | |
|   IN      UINT32                    NewStack
 | |
|   );
 | |
| 
 | |
| #endif
 |