]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ipf/IpfMacro.i
506b4b328ca510d918ee39cfbc79341b78a3982b
[mirror_edk2.git] / MdePkg / 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
45 #define INTERRUPT_HANDLER_BEGIN(name) \
46 PROCEDURE_ENTRY(name##HandlerBegin) \
47 ;; \
48 PROCEDURE_EXIT(name##HandlerBegin)
49
50 #define INTERRUPT_HANDLER_END(name) \
51 PROCEDURE_ENTRY(name##HandlerEnd) \
52 ;; \
53 PROCEDURE_EXIT(name##HandlerEnd)
54
55
56 #define INTERRUPT_HANDLER_BLOCK_BEGIN \
57 INTERRUPT_HANDLER_BEGIN(First)
58
59 #define INTERRUPT_HANDLER_BLOCK_END \
60 INTERRUPT_HANDLER_END(Last)
61
62
63
64 #endif