1 //++
2 // Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
3 // 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 //
13 //  IpfMacro.i
14 //
15 // Abstract:
16 //
17 //  Contains the macros needed for calling procedures in Itanium-based assembly code.
18 //
19 //
20 // Revision History:
21 //
22 //--
23 
24 #ifndef  _IA64PROC_I
25 #define  _IA64PROC_I
26 
27 
28 #define PROCEDURE_ENTRY(name)   .##text;            \
29                                 .##type name, @function;    \
30                                 .##proc name;           \
31 name::
32 
33 #define PROCEDURE_EXIT(name)    .##endp name
34 
35 // Note: use of NESTED_SETUP requires number of locals (l) >= 3
36 
37 #define NESTED_SETUP(i,l,o,r) \
38          alloc loc1=ar##.##pfs,i,l,o,r ;\
39          mov loc0=b0
40 
41 #define NESTED_RETURN \
42          mov b0=loc0 ;\
43          mov ar##.##pfs=loc1 ;;\
44          br##.##ret##.##dpnt  b0;;
45 
46 
47 #define INTERRUPT_HANDLER_BEGIN(name) \
48 PROCEDURE_ENTRY(name##HandlerBegin) \
49 ;; \
50 PROCEDURE_EXIT(name##HandlerBegin)
51 
52 #define INTERRUPT_HANDLER_END(name) \
53 PROCEDURE_ENTRY(name##HandlerEnd) \
54 ;; \
55 PROCEDURE_EXIT(name##HandlerEnd)
56 
57 
58 #define INTERRUPT_HANDLER_BLOCK_BEGIN \
59 INTERRUPT_HANDLER_BEGIN(First)
60 
61 #define INTERRUPT_HANDLER_BLOCK_END \
62 INTERRUPT_HANDLER_END(Last)
63 
64 
65 
66 #endif  // _IA64PROC_I
67