/[dynamips]/upstream/dynamips-0.2.8-RC1/cpu.h
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /upstream/dynamips-0.2.8-RC1/cpu.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

upstream/dynamips-0.2.7/cpu.h revision 10 by dpavlin, Sat Oct 6 16:29:14 2007 UTC upstream/dynamips-0.2.8-RC1/cpu.h revision 11 by dpavlin, Sat Oct 6 16:33:40 2007 UTC
# Line 7  Line 7 
7  #define __CPU_H__  #define __CPU_H__
8    
9  #include <pthread.h>  #include <pthread.h>
10    #include <setjmp.h>
11  #include "utils.h"  #include "utils.h"
12  #include "jit_op.h"  #include "jit_op.h"
13    
# Line 49  struct memlog_access { Line 50  struct memlog_access {
50     m_uint32_t op_type;     m_uint32_t op_type;
51  };  };
52    
53    /* Undefined memory access handler */
54    typedef int (*cpu_undefined_mem_handler_t)(cpu_gen_t *cpu,m_uint64_t vaddr,
55                                               u_int op_size,u_int op_type,
56                                               m_uint64_t *data);
57    
58  /* Generic CPU definition */  /* Generic CPU definition */
59  struct cpu_gen {  struct cpu_gen {
60     /* CPU type and identifier for MP systems */     /* CPU type and identifier for MP systems */
# Line 62  struct cpu_gen { Line 68  struct cpu_gen {
68     pthread_t cpu_thread;     pthread_t cpu_thread;
69     int cpu_thread_running;     int cpu_thread_running;
70    
71       /* Exception restore point */
72       jmp_buf exec_loop_env;
73    
74     /* "Idle" loop management */     /* "Idle" loop management */
75     u_int idle_count,idle_max,idle_sleep_time;     u_int idle_count,idle_max,idle_sleep_time;
76     pthread_mutex_t idle_mutex;     pthread_mutex_t idle_mutex;
# Line 95  struct cpu_gen { Line 104  struct cpu_gen {
104     void (*mts_rebuild)(cpu_gen_t *cpu);     void (*mts_rebuild)(cpu_gen_t *cpu);
105     void (*mts_show_stats)(cpu_gen_t *cpu);     void (*mts_show_stats)(cpu_gen_t *cpu);
106    
107       cpu_undefined_mem_handler_t undef_mem_handler;
108    
109     /* Memory access log for fault debugging */     /* Memory access log for fault debugging */
110     u_int memlog_pos;     u_int memlog_pos;
111     memlog_access_t memlog_array[MEMLOG_COUNT];     memlog_access_t memlog_array[MEMLOG_COUNT];
# Line 136  static forced_inline m_uint64_t cpu_get_ Line 147  static forced_inline m_uint64_t cpu_get_
147  }  }
148    
149  /* Get CPU performance counter */  /* Get CPU performance counter */
150  static forced_inline m_uint64_t cpu_get_perf_counter(cpu_gen_t *cpu)  static forced_inline m_uint32_t cpu_get_perf_counter(cpu_gen_t *cpu)
151  {  {
152     switch(cpu->type) {     switch(cpu->type) {
153        case CPU_TYPE_MIPS64:        case CPU_TYPE_MIPS64:
# Line 205  void cpu_idle_loop(cpu_gen_t *cpu); Line 216  void cpu_idle_loop(cpu_gen_t *cpu);
216  /* Break idle wait state */  /* Break idle wait state */
217  void cpu_idle_break_wait(cpu_gen_t *cpu);  void cpu_idle_break_wait(cpu_gen_t *cpu);
218    
219    /* Returns to the CPU exec loop */
220    static inline void cpu_exec_loop_enter(cpu_gen_t *cpu)
221    {
222       longjmp(cpu->exec_loop_env,1);
223    }
224    
225    /* Set the exec loop entry point */
226    #define cpu_exec_loop_set(cpu) setjmp((cpu)->exec_loop_env)
227    
228  #endif  #endif

Legend:
Removed from v.10  
changed lines
  Added in v.11

  ViewVC Help
Powered by ViewVC 1.1.26