* src/vm/jit/i386/darwin/md-asm.h: Repaired --enable-cycles-stats.
[cacao.git] / src / vm / jit / i386 / md.h
1 /* src/vm/jit/i386/md.h - machine dependent i386 functions
2
3    Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
4    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6    J. Wenninger, Institut f. Computersprachen - TU Wien
7
8    This file is part of CACAO.
9
10    This program is free software; you can redistribute it and/or
11    modify it under the terms of the GNU General Public License as
12    published by the Free Software Foundation; either version 2, or (at
13    your option) any later version.
14
15    This program is distributed in the hope that it will be useful, but
16    WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23    02110-1301, USA.
24
25 */
26
27
28 #ifndef _VM_JIT_I386_MD_H
29 #define _VM_JIT_I386_MD_H
30
31 #include "config.h"
32
33 #include <assert.h>
34 #include <stdint.h>
35
36 #include "vm/jit/codegen-common.h"
37
38
39 /* inline functions ***********************************************************/
40
41 /* md_stacktrace_get_returnaddress *********************************************
42
43    Returns the return address of the current stackframe, specified by
44    the passed stack pointer and the stack frame size.
45
46 *******************************************************************************/
47
48 inline static void *md_stacktrace_get_returnaddress(void *sp, int32_t stackframesize)
49 {
50         void *ra;
51
52         /* On i386 the return address is above the current stack frame. */
53
54         ra = *((void **) (((uintptr_t) sp) + stackframesize));
55
56         return ra;
57 }
58
59
60 /* md_codegen_get_pv_from_pc ***************************************************
61
62    On this architecture just a wrapper function to
63    codegen_get_pv_from_pc.
64
65 *******************************************************************************/
66
67 inline static void *md_codegen_get_pv_from_pc(void *ra)
68 {
69         void *pv;
70
71         /* Get the start address of the function which contains this
72        address from the method table. */
73
74         pv = codegen_get_pv_from_pc(ra);
75
76         return pv;
77 }
78
79
80 /* md_cacheflush ***************************************************************
81
82    Calls the system's function to flush the instruction and data
83    cache.
84
85 *******************************************************************************/
86
87 inline static void md_cacheflush(void *addr, int nbytes)
88 {
89         /* do nothing */
90 }
91
92
93 /* md_icacheflush **************************************************************
94
95    Calls the system's function to flush the instruction cache.
96
97 *******************************************************************************/
98
99 inline static void md_icacheflush(void *addr, int nbytes)
100 {
101         /* do nothing */
102 }
103
104
105 /* md_dcacheflush **************************************************************
106
107    Calls the system's function to flush the data cache.
108
109 *******************************************************************************/
110
111 inline static void md_dcacheflush(void *addr, int nbytes)
112 {
113         /* do nothing */
114 }
115
116 #endif /* _VM_JIT_I386_MD_H */
117
118
119 /*
120  * These are local overrides for various environment variables in Emacs.
121  * Please do not remove this and leave it at the end of the file, where
122  * Emacs will automagically detect them.
123  * ---------------------------------------------------------------------
124  * Local variables:
125  * mode: c
126  * indent-tabs-mode: t
127  * c-basic-offset: 4
128  * tab-width: 4
129  * End:
130  * vim:noexpandtab:sw=4:ts=4:
131  */