1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: abi.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _BRIDGES_CPP_UNO_X86_64_ABI_HXX_
32 #define _BRIDGES_CPP_UNO_X86_64_ABI_HXX_
34 // This is an implementation of the x86-64 ABI as described in 'System V
35 // Application Binary Interface, AMD64 Architecture Processor Supplement'
36 // (http://www.x86-64.org/documentation/abi-0.95.pdf)
38 #include <typelib/typedescription.hxx>
43 /* 6 general purpose registers are used for parameter passing */
44 const sal_uInt32 MAX_GPR_REGS
= 6;
46 /* 8 SSE registers are used for parameter passing */
47 const sal_uInt32 MAX_SSE_REGS
= 8;
49 /* Count number of required registers.
51 Examine the argument and return set number of register required in each
54 Return false iff parameter should be passed in memory.
56 bool examine_argument( typelib_TypeDescriptionReference
*pTypeRef
, bool bInReturn
, int &nUsedGPR
, int &nUsedSSE
);
58 /** Does function that returns this type use a hidden parameter, or registers?
60 The value can be returned either in a hidden 1st parameter (which is a
61 pointer to a structure allocated by the caller), or in registers (rax, rdx
62 for the integers, xmm0, xmm1 for the floating point numbers).
64 bool return_in_hidden_param( typelib_TypeDescriptionReference
*pTypeRef
);
66 void fill_struct( typelib_TypeDescriptionReference
*pTypeRef
, void * const *pGPR
, void * const *pSSE
, void *pStruct
);
70 #endif // _BRIDGES_CPP_UNO_X86_64_ABI_HXX_