hosthooks.h revision 169689
1234353Sdim/* The host_hooks data structure. 2234353Sdim Copyright 2003, 2004 Free Software Foundation, Inc. 3193323Sed 4193323SedThis file is part of GCC. 5193323Sed 6193323SedGCC is free software; you can redistribute it and/or modify 7234353Sdimit under the terms of the GNU General Public License as published by 8193323Sedthe Free Software Foundation; either version 2, or (at your option) 9193323Sedany later version. 10193323Sed 11263508SdimGCC is distributed in the hope that it will be useful, 12193323Sedbut WITHOUT ANY WARRANTY; without even the implied warranty of 13193323SedMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14263508SdimGNU General Public License for more details. 15263508Sdim 16193323SedYou should have received a copy of the GNU General Public License 17193323Sedalong with GCC; see the file COPYING. If not, write to 18193323Sedthe Free Software Foundation, 51 Franklin Street, Fifth Floor, 19198090SrdivackyBoston, MA 02110-1301, USA. */ 20198090Srdivacky 21198090Srdivacky#ifndef GCC_HOST_HOOKS_H 22198090Srdivacky#define GCC_HOST_HOOKS_H 23208599Srdivacky 24263508Sdimstruct host_hooks 25263508Sdim{ 26263508Sdim void (*extra_signals) (void); 27263508Sdim 28208599Srdivacky /* Identify an address that's likely to be free in a subsequent invocation 29208599Srdivacky of the compiler. The area should be able to hold SIZE bytes. FD is an 30193323Sed open file descriptor if the host would like to probe with mmap. */ 31193323Sed void * (*gt_pch_get_address) (size_t size, int fd); 32263508Sdim 33263508Sdim /* ADDR is an address returned by gt_pch_get_address. Attempt to allocate 34193323Sed SIZE bytes at the same address and load it with the data from FD at 35263508Sdim OFFSET. Return -1 if we couldn't allocate memory at ADDR, return 0 36263508Sdim if the memory is allocated but the data not loaded, return 1 if done. */ 37193323Sed int (*gt_pch_use_address) (void *addr, size_t size, int fd, size_t offset); 38263508Sdim 39193323Sed /* Return the alignment required for allocating virtual memory. Usually 40208599Srdivacky this is the same as pagesize. */ 41234353Sdim size_t (*gt_pch_alloc_granularity) (void); 42193323Sed 43193323Sed /* Whenever you add entries here, make sure you adjust hosthooks-def.h. */ 44263508Sdim}; 45263508Sdim 46263508Sdim/* Each host provides its own. */ 47263508Sdimextern const struct host_hooks host_hooks; 48263508Sdim 49263508Sdim#endif /* GCC_LANG_HOOKS_H */ 50263508Sdim