]> git.proxmox.com Git - mirror_edk2.git/blob - OldMdePkg/Include/Ipf/IpfMacro.i
Moved the MdePkg to OldMdePkg so that new code in MdePkg does not break existing...
[mirror_edk2.git] / OldMdePkg / Include / Ipf / IpfMacro.i
1 //++
2 // Copyright (c) 2006, Intel Corporation
3 // All rights reserved. This program and the accompanying materials
4 // are licensed and made available under the terms and conditions of the BSD License
5 // which accompanies this distribution. The full text of the license may be found at
6 // http://opensource.org/licenses/bsd-license.php
7 //
8 // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
9 // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
10 //
11 // Module Name:
12 // IpfMacro.i
13 //
14 // Abstract:
15 // Contains the macros needed for calling procedures in Itanium-based assembly code.
16 //
17 //
18 // Revision History:
19 //
20 //--
21
22 #ifndef __IA64PROC_I__
23 #define __IA64PROC_I__
24
25
26 #define PROCEDURE_ENTRY(name) .##text; \
27 .##type name, @function; \
28 .##proc name; \
29 name::
30
31 #define PROCEDURE_EXIT(name) .##endp name
32
33 // Note: use of NESTED_SETUP requires number of locals (l) >= 3
34
35 #define NESTED_SETUP(i,l,o,r) \
36 alloc loc1=ar##.##pfs,i,l,o,r ;\
37 mov loc0=b0
38
39 #define NESTED_RETURN \
40 mov b0=loc0 ;\
41 mov ar##.##pfs=loc1 ;;\
42 br##.##ret##.##dpnt b0;;
43
44 #define GLOBAL_FUNCTION(Function) \
45 .##type Function, @function; \
46 .##global Function
47
48 #define INTERRUPT_HANDLER_BEGIN(name) \
49 PROCEDURE_ENTRY(name##HandlerBegin) \
50 ;; \
51 PROCEDURE_EXIT(name##HandlerBegin)
52
53 #define INTERRUPT_HANDLER_END(name) \
54 PROCEDURE_ENTRY(name##HandlerEnd) \
55 ;; \
56 PROCEDURE_EXIT(name##HandlerEnd)
57
58
59 #define INTERRUPT_HANDLER_BLOCK_BEGIN \
60 INTERRUPT_HANDLER_BEGIN(First)
61
62 #define INTERRUPT_HANDLER_BLOCK_END \
63 INTERRUPT_HANDLER_END(Last)
64
65
66
67 #endif