View Javadoc

1   // jq_RegisterState.java, created Mon Feb  5 23:23:21 2001 by joewhaley
2   // Copyright (C) 2001-3 John Whaley <jwhaley@alum.mit.edu>
3   // Licensed under the terms of the GNU LGPL; see COPYING for details.
4   package joeq.Scheduler;
5   
6   import joeq.Memory.CodeAddress;
7   import joeq.Memory.StackAddress;
8   
9   /*
10   * @author  John Whaley <jwhaley@alum.mit.edu>
11   * @version $Id: jq_RegisterState.java 1465 2004-03-10 22:40:47Z jwhaley $
12   */
13  public abstract class jq_RegisterState {
14  
15      public abstract static class Factory {
16          public abstract jq_RegisterState create();
17      }
18      public static Factory factory;
19      
20      public static jq_RegisterState create() {
21          return factory.create();
22      }
23      
24      public abstract CodeAddress getEip();
25      public abstract void setEip(CodeAddress a);
26      public abstract StackAddress getEsp();
27      public abstract void setEsp(StackAddress a);
28      public abstract StackAddress getEbp();
29      public abstract void setEbp(StackAddress a);
30      public abstract void setControlWord(int x);
31      public abstract void setStatusWord(int x);
32      public abstract void setTagWord(int x);
33      public abstract void setContextFlags(int x);
34      
35      public static final int CONTEXT_i386               = 0x00010000;
36      public static final int CONTEXT_CONTROL            = (CONTEXT_i386 | 0x00000001); // SS:SP, CS:IP, FLAGS, BP
37      public static final int CONTEXT_INTEGER            = (CONTEXT_i386 | 0x00000002); // AX, BX, CX, DX, SI, DI
38      public static final int CONTEXT_SEGMENTS           = (CONTEXT_i386 | 0x00000004); // DS, ES, FS, GS
39      public static final int CONTEXT_FLOATING_POINT     = (CONTEXT_i386 | 0x00000008); // 387 state
40      public static final int CONTEXT_DEBUG_REGISTERS    = (CONTEXT_i386 | 0x00000010); // DB 0-3,6,7
41      public static final int CONTEXT_EXTENDED_REGISTERS = (CONTEXT_i386 | 0x00000020); // cpu specific extensions
42      public static final int CONTEXT_FULL = (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS);
43  
44  }