From 53ee4dac02ad1749d1579c998e8105f5fcff29a9 Mon Sep 17 00:00:00 2001 From: rth Date: Thu, 11 Mar 2004 03:19:04 +0000 Subject: * c-pch.c (c_common_no_more_pch): Update for gt_pch_use_address extra arguments. * config.host (*-*-solaris2*, *-*-linux*): Add out_host_hook_obj and host_xmake_file fragments. * ggc-common.c (gt_pch_save): Update for gt_pch_get_address change. (gt_pch_restore): Similarly for gt_pch_use_address. (default_gt_pch_get_address): New. (mmap_gt_pch_get_address): Split out of gt_pch_save. (default_gt_pch_use_address): Split out of gt_pch_restore. (mmap_gt_pch_use_address): Likewise. * hooks.c (hook_voidp_size_t_null): Remove. (hook_bool_voidp_size_t_false): Remove. * hooks.h: Likewise. * hosthooks-def.h (HOST_HOOKS_GT_PCH_GET_ADDRESS): Use one of the default_ or mmap_ definitions. (HOST_HOOKS_GT_PCH_USE_ADDRESS): Likewise. * hosthooks.h (struct host_hooks): Update gt_pch_get_address and gt_pch_use_address. * config/host-linux.c, config/host-solaris.c: New files. * config/x-linux, config/x-solaris: New files. * config/rs6000/host-darwin.c darwin_rs6000_gt_pch_get_address): Update for changed definition. (darwin_rs6000_gt_pch_use_address): Likewise. * doc/hostconfig.texi: Update docs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79295 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/doc/hostconfig.texi | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) (limited to 'gcc/doc/hostconfig.texi') diff --git a/gcc/doc/hostconfig.texi b/gcc/doc/hostconfig.texi index 5c38313efd2..8830c6b8ac1 100644 --- a/gcc/doc/hostconfig.texi +++ b/gcc/doc/hostconfig.texi @@ -42,35 +42,31 @@ This host hook is used to set up handling for extra signals. The most common thing to do in this hook is to detect stack overflow. @end deftypefn -@deftypefn {Host Hook} void * HOST_HOOKS_GT_PCH_GET_ADDRESS (size_t @var{size}) -This host hook returns the address of some space in which a PCH may be -loaded with @samp{HOST_HOOKS_PCH_LOAD_PCH}. The space will need to -have @var{size} bytes. If insufficient space is available, -@samp{NULL} may be returned; the PCH machinery will try to find a -suitable address using a heuristic. - -The memory does not have to be available now. In fact, usually -@samp{HOST_HOOKS_PCH_LOAD_PCH} will already have been called. The memory -need only be available in future invocations of GCC. +@deftypefn {Host Hook} void * HOST_HOOKS_GT_PCH_GET_ADDRESS (size_t @var{size}, int @var{fd}) +This host hook returns the address of some space that is likely to be +free in some subsequent invocation of the compiler. We intend to load +the PCH data at this address such that the data need not be relocated. +The area should be able to hold @var{size} bytes. If the host uses +@code{mmap}, @var{fd} is an open file descriptor that can be used for +probing. @end deftypefn -@deftypefn {Host Hook} bool HOST_HOOKS_GT_PCH_USE_ADDRESS (size_t @var{size}, void * @var{address}) -This host hook is called when a PCH file is about to be loaded. If -@var{address} is the address that would have been returned by -@samp{HOST_HOOKS_PCH_MEMORY_ADDRESS}, and @var{size} is smaller than -the maximum than @samp{HOST_HOOKS_PCH_MEMORY_ADDRESS} would have -accepted, return true, otherwise return false. +@deftypefn {Host Hook} int HOST_HOOKS_GT_PCH_USE_ADDRESS (void * @var{address}, size_t @var{size}, int @var{fd}, size_t @var{offset}) +This host hook is called when a PCH file is about to be loaded. +We want to load @var{size} bytes from @var{fd} at @var{offset} +into memory at @var{address}. The given address will be the result of +a previous invocation of @code{HOST_HOOKS_GT_PCH_GET_ADDRESS}. +Return @minus{}1 if we couldn't allocate @var{size} bytes at @var{address}. +Return 0 if the memory is allocated but the data is not loaded. Return 1 +if the hook has performed everything. -In addition, free any address space reserved that isn't needed to hold -@var{size} bytes (whether or not true is returned). The PCH machinery will -use @samp{mmap} with @samp{MAP_FIXED} to load the PCH if @samp{HAVE_MMAP_FILE}, -or will use @samp{fread} otherwise. - -If no PCH will be loaded, this hook may be called with @var{size} -zero, in which case all reserved address space should be freed. +If the implementation uses reserved address space, free any reserved +space beyond @var{size}, regardless of the return value. If no PCH will +be loaded, this hook may be called with @var{size} zero, in which case +all reserved address space should be freed. Do not try to handle values of @var{address} that could not have been -returned by this executable; just return false. Such values usually +returned by this executable; just return @minus{}1. Such values usually indicate an out-of-date PCH file (built by some other GCC executable), and such a PCH file won't work. @end deftypefn -- cgit v1.2.1