hosthooks.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* The host_hooks data structure.
  2. Copyright (C) 2003-2019 Free Software Foundation, Inc.
  3. This file is part of GCC.
  4. GCC is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3, or (at your option)
  7. any later version.
  8. GCC is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GCC; see the file COPYING3. If not see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef GCC_HOST_HOOKS_H
  16. #define GCC_HOST_HOOKS_H
  17. struct host_hooks
  18. {
  19. void (*extra_signals) (void);
  20. /* Identify an address that's likely to be free in a subsequent invocation
  21. of the compiler. The area should be able to hold SIZE bytes. FD is an
  22. open file descriptor if the host would like to probe with mmap. */
  23. void * (*gt_pch_get_address) (size_t size, int fd);
  24. /* ADDR is an address returned by gt_pch_get_address. Attempt to allocate
  25. SIZE bytes at the same address and load it with the data from FD at
  26. OFFSET. Return -1 if we couldn't allocate memory at ADDR, return 0
  27. if the memory is allocated but the data not loaded, return 1 if done. */
  28. int (*gt_pch_use_address) (void *addr, size_t size, int fd, size_t offset);
  29. /* Return the alignment required for allocating virtual memory. Usually
  30. this is the same as pagesize. */
  31. size_t (*gt_pch_alloc_granularity) (void);
  32. /* Whenever you add entries here, make sure you adjust hosthooks-def.h. */
  33. };
  34. /* Each host provides its own. */
  35. extern const struct host_hooks host_hooks;
  36. #endif /* GCC_LANG_HOOKS_H */