4 * Copyright (C) 2004-2008 Fabrice Bellard
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include "kqemu_int.h"
27 printf("#define KQEMU_STATE_%s %d\n", \
28 #x, (int)offsetof(struct kqemu_state, x))
30 #define OFFSET1(x, name) \
31 printf("#define KQEMU_STATE_%s %d\n", \
32 name, (int)offsetof(struct kqemu_state, x))
34 int main(int argc
, char **argv
)
38 OFFSET(monitor_tr_sel
);
39 OFFSET(monitor_ldt_sel
);
40 OFFSET(monitor_ds_sel
);
41 OFFSET(monitor_ss16_sel
);
42 OFFSET(monitor_cs_sel
);
43 OFFSET(monitor_vaddr
);
44 OFFSET(monitor_data_vaddr
);
45 OFFSET(monitor_data_kaddr
);
46 OFFSET(monitor_selector_base
);
54 OFFSET(kernel_tr_sel
);
55 OFFSET(kernel_ldt_sel
);
57 OFFSET(kernel_ss_sel
);
59 OFFSET(kernel_cs_sel
);
65 OFFSET(nexus_orig_pte
);
68 OFFSET(nexus_kaddr_vptep
);
70 OFFSET(monitor_cs32_sel
);
71 OFFSET(monitor_ss_null_sel
);
77 OFFSET(seg_desc_cache
);
79 OFFSET(tr_desc_cache
);
80 OFFSET(cpuid_features
);
82 OFFSET1(cpu_state
.cpl
, "cpu_state_cpl");