source: release/1.9/source/lisp-kernel/x86-utils.h @ 16083

Last change on this file since 16083 was 15090, checked in by rme, 8 years ago

New functions ptr_in_area() and in_any_consing_area().

File size: 1.3 KB
Line 
1/*
2   Copyright (C) 2011 Clozure Associates
3   This file is part of Clozure CL. 
4
5   Clozure CL is licensed under the terms of the Lisp Lesser GNU Public
6   License , known as the LLGPL and distributed with Clozure CL as the
7   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
8   which is distributed with Clozure CL as the file "LGPL".  Where these
9   conflict, the preamble takes precedence. 
10
11   Clozure CL 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 X86_UTILS_H
18#define X86_UTILS_H
19
20extern LispObj tra_function(LispObj tra);
21extern int tra_offset(LispObj tra);
22extern int ptr_in_area(char *p, area* a);
23extern area *in_any_consing_area(LispObj thing);
24
25static inline LispObj
26function_to_function_vector(LispObj f)
27{
28#ifdef X8664
29  return f - fulltag_function + fulltag_misc;
30#else
31  return f;
32#endif
33}
34
35static inline int
36tra_p(LispObj thing)
37{
38#ifdef X8664
39  return tag_of(thing) == tag_tra;
40#else
41  return fulltag_of(thing) == fulltag_tra;
42#endif
43}
44
45static inline int
46functionp(LispObj f)
47{
48#ifdef X8664
49  return fulltag_of(f) == fulltag_function;
50#else
51  return fulltag_of(f) == fulltag_misc &&
52    header_subtag(header_of(f)) == subtag_function;
53#endif
54}
55
56#endif
Note: See TracBrowser for help on using the repository browser.