1295016Sjkim/* The host_hooks data structure.
2183234Ssimon   Copyright 2003, 2004 Free Software Foundation, Inc.
3183234Ssimon
4183234SsimonThis file is part of GCC.
5183234Ssimon
6183234SsimonGCC is free software; you can redistribute it and/or modify
7183234Ssimonit under the terms of the GNU General Public License as published by
8183234Ssimonthe Free Software Foundation; either version 2, or (at your option)
9183234Ssimonany later version.
10280304Sjkim
11183234SsimonGCC is distributed in the hope that it will be useful,
12183234Ssimonbut WITHOUT ANY WARRANTY; without even the implied warranty of
13183234SsimonMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14183234SsimonGNU General Public License for more details.
15183234Ssimon
16183234SsimonYou should have received a copy of the GNU General Public License
17183234Ssimonalong with GCC; see the file COPYING.  If not, write to
18183234Ssimonthe Free Software Foundation, 51 Franklin Street, Fifth Floor,
19183234SsimonBoston, MA 02110-1301, USA.  */
20183234Ssimon
21183234Ssimon#ifndef GCC_HOST_HOOKS_H
22183234Ssimon#define GCC_HOST_HOOKS_H
23183234Ssimon
24183234Ssimonstruct host_hooks
25183234Ssimon{
26183234Ssimon  void (*extra_signals) (void);
27183234Ssimon
28183234Ssimon  /* Identify an address that's likely to be free in a subsequent invocation
29183234Ssimon     of the compiler.  The area should be able to hold SIZE bytes.  FD is an
30183234Ssimon     open file descriptor if the host would like to probe with mmap.  */
31183234Ssimon  void * (*gt_pch_get_address) (size_t size, int fd);
32183234Ssimon
33183234Ssimon  /* ADDR is an address returned by gt_pch_get_address.  Attempt to allocate
34183234Ssimon     SIZE bytes at the same address and load it with the data from FD at
35183234Ssimon     OFFSET.  Return -1 if we couldn't allocate memory at ADDR, return 0
36183234Ssimon     if the memory is allocated but the data not loaded, return 1 if done.  */
37183234Ssimon  int (*gt_pch_use_address) (void *addr, size_t size, int fd, size_t offset);
38183234Ssimon
39183234Ssimon  /*  Return the alignment required for allocating virtual memory. Usually
40183234Ssimon      this is the same as pagesize.  */
41183234Ssimon  size_t (*gt_pch_alloc_granularity) (void);
42183234Ssimon
43183234Ssimon  /* Whenever you add entries here, make sure you adjust hosthooks-def.h.  */
44183234Ssimon};
45183234Ssimon
46183234Ssimon/* Each host provides its own.  */
47183234Ssimonextern const struct host_hooks host_hooks;
48183234Ssimon
49183234Ssimon#endif /* GCC_LANG_HOOKS_H */
50183234Ssimon