source: branches/ia32/lisp-kernel/gc.h @ 8372

Last change on this file since 8372 was 8372, checked in by rme, 12 years ago

Merged changes 7685:8261 from branches/1.1/ccl.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1/*
2   Copyright (C) 1994-2001 Digitool, Inc
3   This file is part of OpenMCL. 
4
5   OpenMCL is licensed under the terms of the Lisp Lesser GNU Public
6   License , known as the LLGPL and distributed with OpenMCL as the
7   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
8   which is distributed with OpenMCL as the file "LGPL".  Where these
9   conflict, the preamble takes precedence. 
10
11   OpenMCL is referenced in the preamble as the "LIBRARY."
12
13   The LLGPL is also available online at
14   http://opensource.franz.com/preamble.html
15*/
16
17#ifndef __GC_H__
18#define __GC_H__ 1
19
20#include "lisp.h"
21#include "bits.h"
22#include "lisp-exceptions.h"
23#include "memprotect.h"
24
25
26
27#ifdef PPC
28#define is_node_fulltag(f)  ((1<<(f))&((1<<fulltag_cons)|(1<<fulltag_misc)))
29#ifdef PPC64
30#define PPC64_CODE_VECTOR_PREFIX (('C'<< 24) | ('O' << 16) | ('D' << 8) | 'E')
31#else
32/*
33  A code-vector's header can't look like a valid instruction or UUO:
34  the low 8 bits must be subtag_code_vector, and the top 6 bits
35  must be 0.  That means that the maximum length of a code vector
36  is 18 bits worth of elements (~1MB.)
37*/
38
39#define code_header_mask ((0x3f<<26) | subtag_code_vector)
40#endif
41#endif
42
43#ifdef X86
44#ifdef X8664
45#define is_node_fulltag(f)  ((1<<(f))&((1<<fulltag_cons)    | \
46                                       (1<<fulltag_tra_0)   | \
47                                       (1<<fulltag_tra_1)   | \
48                                       (1<<fulltag_misc)    | \
49                                       (1<<fulltag_symbol)  | \
50                                       (1<<fulltag_function)))
51#else
52#define is_node_fulltag(f)  ((1<<(f))&((1<<fulltag_cons) | \
53                                       (1<<fulltag_misc) | \
54                                       (1<<fulltag_tra)))
55#endif
56#endif
57
58
59extern void zero_memory_range(BytePtr,BytePtr);
60extern LispObj GCarealow, GCareadynamiclow;
61extern natural GCndnodes_in_area, GCndynamic_dnodes_in_area;
62extern bitvector GCmarkbits, GCdynamic_markbits;
63LispObj *global_reloctab, *GCrelocptr;
64LispObj GCfirstunmarked;
65
66extern natural lisp_heap_gc_threshold;
67void mark_root(LispObj);
68void mark_pc_root(LispObj);
69void mark_locative_root(LispObj);
70void rmark(LispObj);
71void postGCfree(void *);
72LispObj *skip_over_ivector(LispObj, LispObj);
73void mark_simple_area_range(LispObj *,LispObj *);
74LispObj calculate_relocation();
75LispObj locative_forwarding_address(LispObj);
76LispObj node_forwarding_address(LispObj);
77void forward_range(LispObj *, LispObj *);
78void note_memoized_references(ExceptionInformation *,LogicalAddress, LogicalAddress, BytePtr *, BytePtr *);
79void gc(TCR *, signed_natural);
80int  purify(TCR *, signed_natural);
81int impurify(TCR *, signed_natural);
82int change_hons_area_size(TCR *, signed_natural);
83void delete_protected_area(protected_area_ptr);
84Boolean egc_control(Boolean, BytePtr);
85Boolean free_segments_zero_filled_by_OS;
86
87/* an type representing 1/4 of a natural word */
88#if WORD_SIZE == 64
89typedef unsigned short qnode;
90#else
91typedef unsigned char qnode;
92#endif
93
94
95#define area_dnode(w,low) ((natural)(((ptr_to_lispobj(w)) - ptr_to_lispobj(low))>>dnode_shift))
96#define gc_area_dnode(w)  area_dnode(w,GCarealow)
97#define gc_dynamic_area_dnode(w) area_dnode(w,GCareadynamiclow)
98
99#ifdef PPC64
100#define forward_marker subtag_forward_marker
101#else
102#define forward_marker fulltag_nil
103#endif
104
105#ifdef PPC64
106#define VOID_ALLOCPTR ((LispObj)(0x8000000000000000-dnode_size))
107#else
108#define VOID_ALLOCPTR ((LispObj)(-dnode_size))
109#endif
110
111#ifdef DARWIN
112#include <mach/task_info.h>
113typedef struct task_events_info paging_info;
114#else
115#ifndef WINDOWS
116#include <sys/resource.h>
117typedef struct rusage paging_info;
118#endif
119#endif
120
121#include <stdio.h>
122
123void sample_paging_info(paging_info *);
124void report_paging_info_delta(FILE*, paging_info *, paging_info *);
125
126#define GC_TRAP_FUNCTION_IMMEDIATE_GC (-1)
127#define GC_TRAP_FUNCTION_GC 0
128#define GC_TRAP_FUNCTION_PURIFY 1
129#define GC_TRAP_FUNCTION_IMPURIFY 2
130#define GC_TRAP_FUNCTION_SAVE_APPLICATION 8
131
132#define GC_TRAP_FUNCTION_GET_LISP_HEAP_THRESHOLD 16
133#define GC_TRAP_FUNCTION_SET_LISP_HEAP_THRESHOLD 17
134#define GC_TRAP_FUNCTION_USE_LISP_HEAP_THRESHOLD 18
135#define GC_TRAP_FUNCTION_EGC_CONTROL 32
136#define GC_TRAP_FUNCTION_CONFIGURE_EGC 64
137#define GC_TRAP_FUNCTION_SET_HONS_AREA_SIZE 128
138#endif                          /* __GC_H__ */
Note: See TracBrowser for help on using the repository browser.