cpu-all.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. /*
  2. * defines common to all virtual CPUs
  3. *
  4. * Copyright (c) 2003 Fabrice Bellard
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef CPU_ALL_H
  20. #define CPU_ALL_H
  21. #include "qemu-common.h"
  22. #include "qemu-tls.h"
  23. #include "cpu-common.h"
  24. /* some important defines:
  25. *
  26. * WORDS_ALIGNED : if defined, the host cpu can only make word aligned
  27. * memory accesses.
  28. *
  29. * HOST_WORDS_BIGENDIAN : if defined, the host cpu is big endian and
  30. * otherwise little endian.
  31. *
  32. * (TARGET_WORDS_ALIGNED : same for target cpu (not supported yet))
  33. *
  34. * TARGET_WORDS_BIGENDIAN : same for target cpu
  35. */
  36. #if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
  37. #define BSWAP_NEEDED
  38. #endif
  39. #ifdef BSWAP_NEEDED
  40. static inline uint16_t tswap16(uint16_t s)
  41. {
  42. return bswap16(s);
  43. }
  44. static inline uint32_t tswap32(uint32_t s)
  45. {
  46. return bswap32(s);
  47. }
  48. static inline uint64_t tswap64(uint64_t s)
  49. {
  50. return bswap64(s);
  51. }
  52. static inline void tswap16s(uint16_t *s)
  53. {
  54. *s = bswap16(*s);
  55. }
  56. static inline void tswap32s(uint32_t *s)
  57. {
  58. *s = bswap32(*s);
  59. }
  60. static inline void tswap64s(uint64_t *s)
  61. {
  62. *s = bswap64(*s);
  63. }
  64. #else
  65. static inline uint16_t tswap16(uint16_t s)
  66. {
  67. return s;
  68. }
  69. static inline uint32_t tswap32(uint32_t s)
  70. {
  71. return s;
  72. }
  73. static inline uint64_t tswap64(uint64_t s)
  74. {
  75. return s;
  76. }
  77. static inline void tswap16s(uint16_t *s)
  78. {
  79. }
  80. static inline void tswap32s(uint32_t *s)
  81. {
  82. }
  83. static inline void tswap64s(uint64_t *s)
  84. {
  85. }
  86. #endif
  87. #if TARGET_LONG_SIZE == 4
  88. #define tswapl(s) tswap32(s)
  89. #define tswapls(s) tswap32s((uint32_t *)(s))
  90. #define bswaptls(s) bswap32s(s)
  91. #else
  92. #define tswapl(s) tswap64(s)
  93. #define tswapls(s) tswap64s((uint64_t *)(s))
  94. #define bswaptls(s) bswap64s(s)
  95. #endif
  96. /* CPU memory access without any memory or io remapping */
  97. /*
  98. * the generic syntax for the memory accesses is:
  99. *
  100. * load: ld{type}{sign}{size}{endian}_{access_type}(ptr)
  101. *
  102. * store: st{type}{size}{endian}_{access_type}(ptr, val)
  103. *
  104. * type is:
  105. * (empty): integer access
  106. * f : float access
  107. *
  108. * sign is:
  109. * (empty): for floats or 32 bit size
  110. * u : unsigned
  111. * s : signed
  112. *
  113. * size is:
  114. * b: 8 bits
  115. * w: 16 bits
  116. * l: 32 bits
  117. * q: 64 bits
  118. *
  119. * endian is:
  120. * (empty): target cpu endianness or 8 bit access
  121. * r : reversed target cpu endianness (not implemented yet)
  122. * be : big endian (not implemented yet)
  123. * le : little endian (not implemented yet)
  124. *
  125. * access_type is:
  126. * raw : host memory access
  127. * user : user mode access using soft MMU
  128. * kernel : kernel mode access using soft MMU
  129. */
  130. /* target-endianness CPU memory access functions */
  131. #if defined(TARGET_WORDS_BIGENDIAN)
  132. #define lduw_p(p) lduw_be_p(p)
  133. #define ldsw_p(p) ldsw_be_p(p)
  134. #define ldl_p(p) ldl_be_p(p)
  135. #define ldq_p(p) ldq_be_p(p)
  136. #define ldfl_p(p) ldfl_be_p(p)
  137. #define ldfq_p(p) ldfq_be_p(p)
  138. #define stw_p(p, v) stw_be_p(p, v)
  139. #define stl_p(p, v) stl_be_p(p, v)
  140. #define stq_p(p, v) stq_be_p(p, v)
  141. #define stfl_p(p, v) stfl_be_p(p, v)
  142. #define stfq_p(p, v) stfq_be_p(p, v)
  143. #else
  144. #define lduw_p(p) lduw_le_p(p)
  145. #define ldsw_p(p) ldsw_le_p(p)
  146. #define ldl_p(p) ldl_le_p(p)
  147. #define ldq_p(p) ldq_le_p(p)
  148. #define ldfl_p(p) ldfl_le_p(p)
  149. #define ldfq_p(p) ldfq_le_p(p)
  150. #define stw_p(p, v) stw_le_p(p, v)
  151. #define stl_p(p, v) stl_le_p(p, v)
  152. #define stq_p(p, v) stq_le_p(p, v)
  153. #define stfl_p(p, v) stfl_le_p(p, v)
  154. #define stfq_p(p, v) stfq_le_p(p, v)
  155. #endif
  156. /* MMU memory access macros */
  157. #if defined(CONFIG_USER_ONLY)
  158. #include <assert.h>
  159. #include "qemu-types.h"
  160. /* On some host systems the guest address space is reserved on the host.
  161. * This allows the guest address space to be offset to a convenient location.
  162. */
  163. #if defined(CONFIG_USE_GUEST_BASE)
  164. extern unsigned long guest_base;
  165. extern int have_guest_base;
  166. extern unsigned long reserved_va;
  167. #define GUEST_BASE guest_base
  168. #define RESERVED_VA reserved_va
  169. #else
  170. #define GUEST_BASE 0ul
  171. #define RESERVED_VA 0ul
  172. #endif
  173. /* All direct uses of g2h and h2g need to go away for usermode softmmu. */
  174. #define g2h(x) ((void *)((unsigned long)(x) + GUEST_BASE))
  175. #if HOST_LONG_BITS <= TARGET_VIRT_ADDR_SPACE_BITS
  176. #define h2g_valid(x) 1
  177. #else
  178. #define h2g_valid(x) ({ \
  179. unsigned long __guest = (unsigned long)(x) - GUEST_BASE; \
  180. __guest < (1ul << TARGET_VIRT_ADDR_SPACE_BITS); \
  181. })
  182. #endif
  183. #define h2g(x) ({ \
  184. unsigned long __ret = (unsigned long)(x) - GUEST_BASE; \
  185. /* Check if given address fits target address space */ \
  186. assert(h2g_valid(x)); \
  187. (abi_ulong)__ret; \
  188. })
  189. #define saddr(x) g2h(x)
  190. #define laddr(x) g2h(x)
  191. #else /* !CONFIG_USER_ONLY */
  192. /* NOTE: we use double casts if pointers and target_ulong have
  193. different sizes */
  194. #define saddr(x) (uint8_t *)(long)(x)
  195. #define laddr(x) (uint8_t *)(long)(x)
  196. #endif
  197. #define ldub_raw(p) ldub_p(laddr((p)))
  198. #define ldsb_raw(p) ldsb_p(laddr((p)))
  199. #define lduw_raw(p) lduw_p(laddr((p)))
  200. #define ldsw_raw(p) ldsw_p(laddr((p)))
  201. #define ldl_raw(p) ldl_p(laddr((p)))
  202. #define ldq_raw(p) ldq_p(laddr((p)))
  203. #define ldfl_raw(p) ldfl_p(laddr((p)))
  204. #define ldfq_raw(p) ldfq_p(laddr((p)))
  205. #define stb_raw(p, v) stb_p(saddr((p)), v)
  206. #define stw_raw(p, v) stw_p(saddr((p)), v)
  207. #define stl_raw(p, v) stl_p(saddr((p)), v)
  208. #define stq_raw(p, v) stq_p(saddr((p)), v)
  209. #define stfl_raw(p, v) stfl_p(saddr((p)), v)
  210. #define stfq_raw(p, v) stfq_p(saddr((p)), v)
  211. #if defined(CONFIG_USER_ONLY)
  212. /* if user mode, no other memory access functions */
  213. #define ldub(p) ldub_raw(p)
  214. #define ldsb(p) ldsb_raw(p)
  215. #define lduw(p) lduw_raw(p)
  216. #define ldsw(p) ldsw_raw(p)
  217. #define ldl(p) ldl_raw(p)
  218. #define ldq(p) ldq_raw(p)
  219. #define ldfl(p) ldfl_raw(p)
  220. #define ldfq(p) ldfq_raw(p)
  221. #define stb(p, v) stb_raw(p, v)
  222. #define stw(p, v) stw_raw(p, v)
  223. #define stl(p, v) stl_raw(p, v)
  224. #define stq(p, v) stq_raw(p, v)
  225. #define stfl(p, v) stfl_raw(p, v)
  226. #define stfq(p, v) stfq_raw(p, v)
  227. #define ldub_code(p) ldub_raw(p)
  228. #define ldsb_code(p) ldsb_raw(p)
  229. #define lduw_code(p) lduw_raw(p)
  230. #define ldsw_code(p) ldsw_raw(p)
  231. #define ldl_code(p) ldl_raw(p)
  232. #define ldq_code(p) ldq_raw(p)
  233. #define ldub_kernel(p) ldub_raw(p)
  234. #define ldsb_kernel(p) ldsb_raw(p)
  235. #define lduw_kernel(p) lduw_raw(p)
  236. #define ldsw_kernel(p) ldsw_raw(p)
  237. #define ldl_kernel(p) ldl_raw(p)
  238. #define ldq_kernel(p) ldq_raw(p)
  239. #define ldfl_kernel(p) ldfl_raw(p)
  240. #define ldfq_kernel(p) ldfq_raw(p)
  241. #define stb_kernel(p, v) stb_raw(p, v)
  242. #define stw_kernel(p, v) stw_raw(p, v)
  243. #define stl_kernel(p, v) stl_raw(p, v)
  244. #define stq_kernel(p, v) stq_raw(p, v)
  245. #define stfl_kernel(p, v) stfl_raw(p, v)
  246. #define stfq_kernel(p, vt) stfq_raw(p, v)
  247. #endif /* defined(CONFIG_USER_ONLY) */
  248. /* page related stuff */
  249. #define TARGET_PAGE_SIZE (1 << TARGET_PAGE_BITS)
  250. #define TARGET_PAGE_MASK ~(TARGET_PAGE_SIZE - 1)
  251. #define TARGET_PAGE_ALIGN(addr) (((addr) + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK)
  252. /* ??? These should be the larger of unsigned long and target_ulong. */
  253. extern unsigned long qemu_real_host_page_size;
  254. extern unsigned long qemu_host_page_size;
  255. extern unsigned long qemu_host_page_mask;
  256. #define HOST_PAGE_ALIGN(addr) (((addr) + qemu_host_page_size - 1) & qemu_host_page_mask)
  257. /* same as PROT_xxx */
  258. #define PAGE_READ 0x0001
  259. #define PAGE_WRITE 0x0002
  260. #define PAGE_EXEC 0x0004
  261. #define PAGE_BITS (PAGE_READ | PAGE_WRITE | PAGE_EXEC)
  262. #define PAGE_VALID 0x0008
  263. /* original state of the write flag (used when tracking self-modifying
  264. code */
  265. #define PAGE_WRITE_ORG 0x0010
  266. #if defined(CONFIG_BSD) && defined(CONFIG_USER_ONLY)
  267. /* FIXME: Code that sets/uses this is broken and needs to go away. */
  268. #define PAGE_RESERVED 0x0020
  269. #endif
  270. #if defined(CONFIG_USER_ONLY)
  271. void page_dump(FILE *f);
  272. typedef int (*walk_memory_regions_fn)(void *, abi_ulong,
  273. abi_ulong, unsigned long);
  274. int walk_memory_regions(void *, walk_memory_regions_fn);
  275. int page_get_flags(target_ulong address);
  276. void page_set_flags(target_ulong start, target_ulong end, int flags);
  277. int page_check_range(target_ulong start, target_ulong len, int flags);
  278. #endif
  279. CPUState *cpu_copy(CPUState *env);
  280. CPUState *qemu_get_cpu(int cpu);
  281. #define CPU_DUMP_CODE 0x00010000
  282. void cpu_dump_state(CPUState *env, FILE *f, fprintf_function cpu_fprintf,
  283. int flags);
  284. void cpu_dump_statistics(CPUState *env, FILE *f, fprintf_function cpu_fprintf,
  285. int flags);
  286. void QEMU_NORETURN cpu_abort(CPUState *env, const char *fmt, ...)
  287. GCC_FMT_ATTR(2, 3);
  288. extern CPUState *first_cpu;
  289. DECLARE_TLS(CPUState *,cpu_single_env);
  290. #define cpu_single_env get_tls(cpu_single_env)
  291. /* Flags for use in ENV->INTERRUPT_PENDING.
  292. The numbers assigned here are non-sequential in order to preserve
  293. binary compatibility with the vmstate dump. Bit 0 (0x0001) was
  294. previously used for CPU_INTERRUPT_EXIT, and is cleared when loading
  295. the vmstate dump. */
  296. /* External hardware interrupt pending. This is typically used for
  297. interrupts from devices. */
  298. #define CPU_INTERRUPT_HARD 0x0002
  299. /* Exit the current TB. This is typically used when some system-level device
  300. makes some change to the memory mapping. E.g. the a20 line change. */
  301. #define CPU_INTERRUPT_EXITTB 0x0004
  302. /* Halt the CPU. */
  303. #define CPU_INTERRUPT_HALT 0x0020
  304. /* Debug event pending. */
  305. #define CPU_INTERRUPT_DEBUG 0x0080
  306. /* Several target-specific external hardware interrupts. Each target/cpu.h
  307. should define proper names based on these defines. */
  308. #define CPU_INTERRUPT_TGT_EXT_0 0x0008
  309. #define CPU_INTERRUPT_TGT_EXT_1 0x0010
  310. #define CPU_INTERRUPT_TGT_EXT_2 0x0040
  311. #define CPU_INTERRUPT_TGT_EXT_3 0x0200
  312. #define CPU_INTERRUPT_TGT_EXT_4 0x1000
  313. /* Several target-specific internal interrupts. These differ from the
  314. preceeding target-specific interrupts in that they are intended to
  315. originate from within the cpu itself, typically in response to some
  316. instruction being executed. These, therefore, are not masked while
  317. single-stepping within the debugger. */
  318. #define CPU_INTERRUPT_TGT_INT_0 0x0100
  319. #define CPU_INTERRUPT_TGT_INT_1 0x0400
  320. #define CPU_INTERRUPT_TGT_INT_2 0x0800
  321. /* First unused bit: 0x2000. */
  322. /* The set of all bits that should be masked when single-stepping. */
  323. #define CPU_INTERRUPT_SSTEP_MASK \
  324. (CPU_INTERRUPT_HARD \
  325. | CPU_INTERRUPT_TGT_EXT_0 \
  326. | CPU_INTERRUPT_TGT_EXT_1 \
  327. | CPU_INTERRUPT_TGT_EXT_2 \
  328. | CPU_INTERRUPT_TGT_EXT_3 \
  329. | CPU_INTERRUPT_TGT_EXT_4)
  330. #ifndef CONFIG_USER_ONLY
  331. typedef void (*CPUInterruptHandler)(CPUState *, int);
  332. extern CPUInterruptHandler cpu_interrupt_handler;
  333. static inline void cpu_interrupt(CPUState *s, int mask)
  334. {
  335. cpu_interrupt_handler(s, mask);
  336. }
  337. #else /* USER_ONLY */
  338. void cpu_interrupt(CPUState *env, int mask);
  339. #endif /* USER_ONLY */
  340. void cpu_reset_interrupt(CPUState *env, int mask);
  341. void cpu_exit(CPUState *s);
  342. bool qemu_cpu_has_work(CPUState *env);
  343. /* Breakpoint/watchpoint flags */
  344. #define BP_MEM_READ 0x01
  345. #define BP_MEM_WRITE 0x02
  346. #define BP_MEM_ACCESS (BP_MEM_READ | BP_MEM_WRITE)
  347. #define BP_STOP_BEFORE_ACCESS 0x04
  348. #define BP_WATCHPOINT_HIT 0x08
  349. #define BP_GDB 0x10
  350. #define BP_CPU 0x20
  351. int cpu_breakpoint_insert(CPUState *env, target_ulong pc, int flags,
  352. CPUBreakpoint **breakpoint);
  353. int cpu_breakpoint_remove(CPUState *env, target_ulong pc, int flags);
  354. void cpu_breakpoint_remove_by_ref(CPUState *env, CPUBreakpoint *breakpoint);
  355. void cpu_breakpoint_remove_all(CPUState *env, int mask);
  356. int cpu_watchpoint_insert(CPUState *env, target_ulong addr, target_ulong len,
  357. int flags, CPUWatchpoint **watchpoint);
  358. int cpu_watchpoint_remove(CPUState *env, target_ulong addr,
  359. target_ulong len, int flags);
  360. void cpu_watchpoint_remove_by_ref(CPUState *env, CPUWatchpoint *watchpoint);
  361. void cpu_watchpoint_remove_all(CPUState *env, int mask);
  362. #define SSTEP_ENABLE 0x1 /* Enable simulated HW single stepping */
  363. #define SSTEP_NOIRQ 0x2 /* Do not use IRQ while single stepping */
  364. #define SSTEP_NOTIMER 0x4 /* Do not Timers while single stepping */
  365. void cpu_single_step(CPUState *env, int enabled);
  366. void cpu_reset(CPUState *s);
  367. int cpu_is_stopped(CPUState *env);
  368. void run_on_cpu(CPUState *env, void (*func)(void *data), void *data);
  369. #define CPU_LOG_TB_OUT_ASM (1 << 0)
  370. #define CPU_LOG_TB_IN_ASM (1 << 1)
  371. #define CPU_LOG_TB_OP (1 << 2)
  372. #define CPU_LOG_TB_OP_OPT (1 << 3)
  373. #define CPU_LOG_INT (1 << 4)
  374. #define CPU_LOG_EXEC (1 << 5)
  375. #define CPU_LOG_PCALL (1 << 6)
  376. #define CPU_LOG_IOPORT (1 << 7)
  377. #define CPU_LOG_TB_CPU (1 << 8)
  378. #define CPU_LOG_RESET (1 << 9)
  379. /* define log items */
  380. typedef struct CPULogItem {
  381. int mask;
  382. const char *name;
  383. const char *help;
  384. } CPULogItem;
  385. extern const CPULogItem cpu_log_items[];
  386. void cpu_set_log(int log_flags);
  387. void cpu_set_log_filename(const char *filename);
  388. int cpu_str_to_log_mask(const char *str);
  389. #if !defined(CONFIG_USER_ONLY)
  390. /* Return the physical page corresponding to a virtual one. Use it
  391. only for debugging because no protection checks are done. Return -1
  392. if no page found. */
  393. target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr);
  394. /* memory API */
  395. extern int phys_ram_fd;
  396. extern ram_addr_t ram_size;
  397. /* RAM is pre-allocated and passed into qemu_ram_alloc_from_ptr */
  398. #define RAM_PREALLOC_MASK (1 << 0)
  399. typedef struct RAMBlock {
  400. uint8_t *host;
  401. ram_addr_t offset;
  402. ram_addr_t length;
  403. uint32_t flags;
  404. char idstr[256];
  405. QLIST_ENTRY(RAMBlock) next;
  406. #if defined(__linux__) && !defined(TARGET_S390X)
  407. int fd;
  408. #endif
  409. } RAMBlock;
  410. typedef struct RAMList {
  411. uint8_t *phys_dirty;
  412. QLIST_HEAD(, RAMBlock) blocks;
  413. } RAMList;
  414. extern RAMList ram_list;
  415. extern const char *mem_path;
  416. extern int mem_prealloc;
  417. /* physical memory access */
  418. /* MMIO pages are identified by a combination of an IO device index and
  419. 3 flags. The ROMD code stores the page ram offset in iotlb entry,
  420. so only a limited number of ids are avaiable. */
  421. #define IO_MEM_NB_ENTRIES (1 << (TARGET_PAGE_BITS - IO_MEM_SHIFT))
  422. /* Flags stored in the low bits of the TLB virtual address. These are
  423. defined so that fast path ram access is all zeros. */
  424. /* Zero if TLB entry is valid. */
  425. #define TLB_INVALID_MASK (1 << 3)
  426. /* Set if TLB entry references a clean RAM page. The iotlb entry will
  427. contain the page physical address. */
  428. #define TLB_NOTDIRTY (1 << 4)
  429. /* Set if TLB entry is an IO callback. */
  430. #define TLB_MMIO (1 << 5)
  431. #define VGA_DIRTY_FLAG 0x01
  432. #define CODE_DIRTY_FLAG 0x02
  433. #define MIGRATION_DIRTY_FLAG 0x08
  434. /* read dirty bit (return 0 or 1) */
  435. static inline int cpu_physical_memory_is_dirty(ram_addr_t addr)
  436. {
  437. return ram_list.phys_dirty[addr >> TARGET_PAGE_BITS] == 0xff;
  438. }
  439. static inline int cpu_physical_memory_get_dirty_flags(ram_addr_t addr)
  440. {
  441. return ram_list.phys_dirty[addr >> TARGET_PAGE_BITS];
  442. }
  443. static inline int cpu_physical_memory_get_dirty(ram_addr_t addr,
  444. int dirty_flags)
  445. {
  446. return ram_list.phys_dirty[addr >> TARGET_PAGE_BITS] & dirty_flags;
  447. }
  448. static inline void cpu_physical_memory_set_dirty(ram_addr_t addr)
  449. {
  450. ram_list.phys_dirty[addr >> TARGET_PAGE_BITS] = 0xff;
  451. }
  452. static inline int cpu_physical_memory_set_dirty_flags(ram_addr_t addr,
  453. int dirty_flags)
  454. {
  455. return ram_list.phys_dirty[addr >> TARGET_PAGE_BITS] |= dirty_flags;
  456. }
  457. static inline void cpu_physical_memory_mask_dirty_range(ram_addr_t start,
  458. int length,
  459. int dirty_flags)
  460. {
  461. int i, mask, len;
  462. uint8_t *p;
  463. len = length >> TARGET_PAGE_BITS;
  464. mask = ~dirty_flags;
  465. p = ram_list.phys_dirty + (start >> TARGET_PAGE_BITS);
  466. for (i = 0; i < len; i++) {
  467. p[i] &= mask;
  468. }
  469. }
  470. void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t end,
  471. int dirty_flags);
  472. void cpu_tlb_update_dirty(CPUState *env);
  473. int cpu_physical_memory_set_dirty_tracking(int enable);
  474. int cpu_physical_memory_get_dirty_tracking(void);
  475. int cpu_physical_sync_dirty_bitmap(target_phys_addr_t start_addr,
  476. target_phys_addr_t end_addr);
  477. int cpu_physical_log_start(target_phys_addr_t start_addr,
  478. ram_addr_t size);
  479. int cpu_physical_log_stop(target_phys_addr_t start_addr,
  480. ram_addr_t size);
  481. void dump_exec_info(FILE *f, fprintf_function cpu_fprintf);
  482. #endif /* !CONFIG_USER_ONLY */
  483. int cpu_memory_rw_debug(CPUState *env, target_ulong addr,
  484. uint8_t *buf, int len, int is_write);
  485. #endif /* CPU_ALL_H */