source: trunk/source/lisp-kernel/ppc-constants.s @ 14347

Last change on this file since 14347 was 13337, checked in by plkrueger, 10 years ago

Don't change the m4 quoting characters from their defaults (`').
(On the ARM, square brackets are used to denote memory operands, curly
braces surround register lists, and multicharacter quoting delimeters
look funny ...)

Some versions (at least) of m4 are confused by quoting characters in
comments, so try to refrain from using contractions ...

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.9 KB
Line 
1/* Copyright (C) 2004-2009 Clozure Associates */
2/* This file is part of Clozure CL. */
3 
4/* Clozure CL is licensed under the terms of the Lisp Lesser GNU Public */
5/* License , known as the LLGPL and distributed with Clozure CL as the */
6/* file "LICENSE".  The LLGPL consists of a preamble and the LGPL, */
7/* which is distributed with Clozure CL as the file "LGPL".  Where these */
8/* conflict, the preamble takes precedence. */
9 
10/* Clozure CL is referenced in the preamble as the "LIBRARY." */
11 
12/* The LLGPL is also available online at */
13/* http://opensource.franz.com/preamble.html */
14
15
16/* Register usage: */
17
18
19define(`rzero',`r0')   
20define(`sp',`r1')
21
22define(`imm0',`r3')
23define(`imm1',`r4')
24define(`imm2',`r5')
25define(`imm3',`r6')
26define(`imm4',`r7')
27define(`imm5',`r8')
28define(`allocptr',`r9')
29define(`allocbase',`r10')
30define(`nargs',`r11')
31define(`tsp',`r12')      /* temp-consing stack. */
32
33define(`loc_pc',`r14')   /* code vector locative */
34define(`vsp',`r15')
35define(`fn',`r16')
36define(`temp3',`r17')
37define(`temp2',`r18')
38define(`temp1',`r19')
39define(`temp0',`r20')
40define(`arg_x',`r21')
41define(`arg_y',`r22')
42define(`arg_z',`r23')
43define(`save7',`r24')
44define(`save6',`r25')
45define(`save5',`r26')
46define(`save4',`r27')
47define(`save3',`r28')
48define(`save2',`r29')
49define(`save1',`r30')
50define(`save0',`r31')
51
52define(`fname',`temp3')
53define(`nfn',`temp2')
54define(`next_method_context',`temp1')
55define(`first_nvr',`save7')
56define(`second_nvr',`save6')       
57define(`third_nvr',`save5')
58define(`fourth_nvr',`save4')       
59define(`fifth_nvr',`save3')
60define(`sixth_nvr',`save2')       
61define(`seventh_nvr',`save1')
62define(`eighth_nvr',`save0')       
63define(`nargregs',`3')
64       
65r0 = 0
66r1 = 1
67r2 = 2
68r3 = 3
69r4 = 4
70r5 = 5
71r6 = 6
72r7 = 7
73r8 = 8
74r9 = 9
75r10 = 10
76r11 = 11
77r12 = 12
78r13 = 13
79r14 = 14
80r15 = 15
81r16 = 16
82r17 = 17
83r18 = 18
84r19 = 19
85r20 = 20
86r21 = 21
87r22 = 22
88r23 = 23
89r24 = 24
90r25 = 25
91r26 = 26
92r27 = 27
93r28 = 28
94r29 = 29
95r30 = 30
96r31 = 31
97
98/* Lisp code keeps 0.0 in fp_zero */
99define(`fp_zero',`f31')   /* a non-volatile reg as far as FFI is concerned. */
100define(`fp_s32conv',`f30')   /* for s32->fp conversion */
101       
102/* registers, as used in destrucuring-bind/macro-bind */
103
104define(`whole_reg',`temp1')
105define(`arg_reg',`temp3')
106define(`keyvect_reg',`temp2')
107define(`mask_req_start',`24')
108define(`mask_req_width',`8')
109define(`mask_opt_start',`16')
110define(`mask_opt_width',`8')
111define(`mask_key_start',`8')
112define(`mask_key_width',`8')
113define(`mask_initopt',`7')
114define(`mask_keyp',`6') /*  note that keyp can be true even when 0 keys. */
115define(`mask_aok',`5')
116define(`mask_restp',`4')
117
118ifdef(`DARWIN',`
119        define(`STACK_ALIGN',16)
120        define(`STACK_ALIGN_MASK',15)
121',`
122        define(`STACK_ALIGN',8)
123        define(`STACK_ALIGN_MASK',7)
124')
125
126/* Indices in %builtin-functions% */
127_builtin_plus = 0       /* +-2 */
128_builtin_minus = 1      /* --2 */
129_builtin_times = 2      /* *-2 */
130_builtin_div = 3        /* /-2 */
131_builtin_eq = 4         /* =-2 */
132_builtin_ne = 5         /* /-2 */
133_builtin_gt = 6         /* >-2 */
134_builtin_ge = 7         /* >=-2 */
135_builtin_lt = 8         /* <-2 */
136_builtin_le = 9         /* <=-2 */
137_builtin_eql = 10       /* eql */
138_builtin_length = 11    /* length */
139_builtin_seqtype = 12   /* sequence-type */
140_builtin_assq = 13      /* assq */
141_builtin_memq = 14      /* memq */
142_builtin_logbitp = 15   /* logbitp */
143_builtin_logior = 16    /* logior-2 */
144_builtin_logand = 17    /* logand-2 */
145_builtin_ash = 18       /* ash */
146_builtin_negate = 19    /* %negate */
147_builtin_logxor = 20    /* logxor-2 */
148_builtin_aref1 = 21     /* %aref1 */
149_builtin_aset1 = 22     /* %aset1 */
150
151        /* FPSCR status bits */
152fpscr_FX = 0
153fpscr_FEX = 1
154fpscr_VX = 2
155fpscr_OX = 3
156fpscr_UX = 4
157fpscr_ZX = 5
158fpscr_XX = 6
159        /* FPSCR control bits */
160fpscr_VE = 24
161fpscr_OE = 25
162fpscr_UE = 26
163fpscr_ZE = 27
164fpscr_XE = 28
165       
166
167/* This should be (a) an (UNSIGNED-BYTE 16) and (b) one less than */
168/* TSTACK_SOFTPROT (defined in "area.h") */
169               
170tstack_alloc_limit = 0xffff
171       
172define(`TCR_STATE_FOREIGN',1)
173define(`TCR_STATE_LISP',0)
174define(`TCR_STATE_EXCEPTION_WAIT',2)
175define(`TCR_STATE_EXCEPTION_RETURN',4)
176
177       
178
179               
180ifdef(`PPC64',`
181        include(ppc-constants64.s)
182',`
183        include(ppc-constants32.s)
184')
185
186num_lisp_globals = 49            /* MUST UPDATE THIS !!! */
187       
188        _struct(lisp_globals,lisp_globals_limit-(num_lisp_globals*node_size))
189         _node(weakvll)                 /* all populations as of last GC */
190         _node(initial_tcr)             /* initial thread tcr */
191         _node(image_name)              /* --image-name argument */
192         _node(BADfpscr_save_high)      /* high word of FP reg used to save FPSCR */
193         _node(unwind_resume)           /* _Unwind_Resume */
194         _node(batch_flag)              /* -b */
195         _node(host_platform)           /* for runtime platform-specific stuff */
196         _node(argv)                    /* address of argv`0' */
197         _node(ref_base)                        /* start of oldest pointer-bearing area */
198         _node(tenured_area)            /* the tenured_area */
199         _node(oldest_ephemeral)        /* dword address of oldest ephemeral object or 0 */
200         _node(lisp_exit_hook)          /* install foreign exception_handling */
201         _node(lisp_return_hook)        /* install lisp exception_handling */
202         _node(double_float_one)        /* high half of 1.0d0 */
203         _node(short_float_zero)        /* low half of 1.0d0 */
204         _node(objc2_end_catch)         /* objc_end_catch() */
205         _node(metering_info)           /* address of lisp_metering global */
206         _node(in_gc)                   /* non-zero when GC active */
207         _node(lexpr_return1v)          /* simpler when &lexpr called for single value. */
208         _node(lexpr_return)            /* magic &lexpr return code. */
209         _node(all_areas)               /* doubly-linked list of all memory areas */
210         _node(kernel_path)             /* real executable name */
211         _node(objc2_begin_catch)       /* objc_begin_catch */
212         _node(stack_size)              /* from command-line */
213         _node(statically_linked)       /* non-zero if -static */
214         _node(heap_end)                /* end of lisp heap */
215         _node(heap_start)              /* start of lisp heap */
216         _node(gcable_pointers)         /* linked-list of weak macptrs. */
217         _node(gc_num)                  /* fixnum: GC call count. */
218         _node(fwdnum)                  /* fixnum: GC "forwarder" call count. */
219         _node(altivec_present)         /* non-zero when AltiVec available */
220         _node(oldspace_dnode_count)    /* dynamic dnodes older than g0 start */
221         _node(refbits)                 /* EGC refbits */
222         _node(gc_inhibit_count)
223         _node(intflag)                 /* sigint pending */
224         _node(BAD_block_tag_counter)   /* counter for (immediate) block tag */
225         _node(deleted_static_pairs)           
226         _node(exception_lock)
227         _node(area_lock)
228         _node(tcr_key)                 /* tsd key for per-thread tcr */
229         _node(ret1val_addr)            /* address of "dynamic" subprims magic values return addr */
230         _node(subprims_base)           /* address of dynamic subprims jump table */
231         _node(saveR13)                 /* probably don't really need this */
232         _node(saveTOC)                 /* where the 68K emulator stores the  emulated regs */
233         _node(objc_2_personality)      /* exception "personality routine" address for ObjC 2.0 */ 
234         _node(kernel_imports)          /* some things we need imported for us */
235         _node(interrupt_signal)        /* signal used by PROCESS-INTERRUPT */
236         _node(tcr_count)               /* tcr_id for next tcr */
237         _node(get_tcr)                 /* address of get_tcr() */
238        _ends
239       
Note: See TracBrowser for help on using the repository browser.