1 /* src/vm/jit/executionstate.h - execution-state handling
3 Copyright (C) 2007, 2008
4 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
6 This file is part of CACAO.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2, or (at
11 your option) any later version.
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 #ifndef _EXECUTIONSTATE_H
27 #define _EXECUTIONSTATE_H
29 /* forward typedefs ***********************************************************/
31 typedef struct executionstate_t executionstate_t;
41 #include "vm/jit/code.hpp"
44 /* executionstate_t ************************************************************
46 An execution-state represents the state of a thread containing all
47 registers that are important. This structure is an internal
48 structure similar to mcontext_t.
50 *******************************************************************************/
52 struct executionstate_t {
53 uint8_t *pc; /* program counter */
54 uint8_t *sp; /* stack pointer within method */
55 uint8_t *pv; /* procedure value. NULL means */
56 /* search the AVL tree */
57 uint8_t *ra; /* return address / link register */
59 uintptr_t intregs[INT_REG_CNT]; /* register values */
60 double fltregs[FLT_REG_CNT]; /* register values */
61 #if defined(HAS_ADDRESS_REGISTER_FILE)
62 uintptr_t adrregs[ADR_REG_CNT]; /* register values */
65 codeinfo *code; /* codeinfo corresponding to the pv */
69 /* prototypes *****************************************************************/
76 void executionstate_sanity_check(void *context);
77 void executionstate_println(executionstate_t *es);
80 /* Machine and OS dependent functions (code in ARCH_DIR/OS_DIR/md-os.c) */
82 void md_executionstate_read(executionstate_t *es, void *ucontext);
83 void md_executionstate_write(executionstate_t *es, void *ucontext);
89 #endif /* _EXECUTIONSTATE_H */
93 * These are local overrides for various environment variables in Emacs.
94 * Please do not remove this and leave it at the end of the file, where
95 * Emacs will automagically detect them.
96 * ---------------------------------------------------------------------
103 * vim:noexpandtab:sw=4:ts=4: