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
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.
15 // Contains the macros needed for calling procedures in Itanium-based assembly code.
22 #ifndef __IA64PROC_I__
23 #define __IA64PROC_I__
26 #define PROCEDURE_ENTRY(name) .##text; \
27 .##type name, @function; \
31 #define PROCEDURE_EXIT(name) .##endp name
33 // Note: use of NESTED_SETUP requires number of locals (l) >= 3
35 #define NESTED_SETUP(i,l,o,r) \
36 alloc loc1=ar##.##pfs,i,l,o,r ;\
39 #define NESTED_RETURN \
41 mov ar##.##pfs=loc1 ;;\
42 br##.##ret##.##dpnt b0;;
44 #define GLOBAL_FUNCTION(Function) \
45 .##type Function, @function; \
48 #define GLOBAL_OBJECT(Object) \
49 .##type Object, @object; \
52 #define GLOBAL_CONSTANT(Constant) \
53 .##type Constant, @notype; \
56 #define INTERRUPT_HANDLER_BEGIN(name) \
57 PROCEDURE_ENTRY(name##HandlerBegin) \
59 PROCEDURE_EXIT(name##HandlerBegin)
61 #define INTERRUPT_HANDLER_END(name) \
62 PROCEDURE_ENTRY(name##HandlerEnd) \
64 PROCEDURE_EXIT(name##HandlerEnd)
67 #define INTERRUPT_HANDLER_BLOCK_BEGIN \
68 INTERRUPT_HANDLER_BEGIN(First)
70 #define INTERRUPT_HANDLER_BLOCK_END \
71 INTERRUPT_HANDLER_END(Last)