1132718Skan/* The host_hooks data structure. 2169689Skan Copyright 2003, 2004 Free Software Foundation, Inc. 3132718Skan 4132718SkanThis file is part of GCC. 5132718Skan 6132718SkanGCC is free software; you can redistribute it and/or modify 7132718Skanit under the terms of the GNU General Public License as published by 8132718Skanthe Free Software Foundation; either version 2, or (at your option) 9132718Skanany later version. 10132718Skan 11132718SkanGCC is distributed in the hope that it will be useful, 12132718Skanbut WITHOUT ANY WARRANTY; without even the implied warranty of 13132718SkanMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14132718SkanGNU General Public License for more details. 15132718Skan 16132718SkanYou should have received a copy of the GNU General Public License 17132718Skanalong with GCC; see the file COPYING. If not, write to 18169689Skanthe Free Software Foundation, 51 Franklin Street, Fifth Floor, 19169689SkanBoston, MA 02110-1301, USA. */ 20132718Skan 21132718Skan#ifndef GCC_HOST_HOOKS_H 22132718Skan#define GCC_HOST_HOOKS_H 23132718Skan 24132718Skanstruct host_hooks 25132718Skan{ 26132718Skan void (*extra_signals) (void); 27132718Skan 28161651Skan /* Identify an address that's likely to be free in a subsequent invocation 29161651Skan of the compiler. The area should be able to hold SIZE bytes. FD is an 30161651Skan open file descriptor if the host would like to probe with mmap. */ 31161651Skan void * (*gt_pch_get_address) (size_t size, int fd); 32132718Skan 33161651Skan /* ADDR is an address returned by gt_pch_get_address. Attempt to allocate 34161651Skan SIZE bytes at the same address and load it with the data from FD at 35161651Skan OFFSET. Return -1 if we couldn't allocate memory at ADDR, return 0 36161651Skan if the memory is allocated but the data not loaded, return 1 if done. */ 37161651Skan int (*gt_pch_use_address) (void *addr, size_t size, int fd, size_t offset); 38161651Skan 39169689Skan /* Return the alignment required for allocating virtual memory. Usually 40169689Skan this is the same as pagesize. */ 41169689Skan size_t (*gt_pch_alloc_granularity) (void); 42169689Skan 43132718Skan /* Whenever you add entries here, make sure you adjust hosthooks-def.h. */ 44132718Skan}; 45132718Skan 46132718Skan/* Each host provides its own. */ 47132718Skanextern const struct host_hooks host_hooks; 48132718Skan 49132718Skan#endif /* GCC_LANG_HOOKS_H */ 50