Revision 53a5960a cpu-all.h

b/cpu-all.h
584 584

  
585 585
/* MMU memory access macros */
586 586

  
587
#if defined(CONFIG_USER_ONLY)
588
/* On some host systems the guest address space is reserved on the host.
589
 * This allows the guest address space to be offset to a convenient location.
590
 */
591
//#define GUEST_BASE 0x20000000
592
#define GUEST_BASE 0
593

  
594
/* All direct uses of g2h and h2g need to go away for usermode softmmu.  */
595
#define g2h(x) ((void *)((unsigned long)(x) + GUEST_BASE))
596
#define h2g(x) ((target_ulong)(x - GUEST_BASE))
597

  
598
#define saddr(x) g2h(x)
599
#define laddr(x) g2h(x)
600

  
601
#else /* !CONFIG_USER_ONLY */
587 602
/* NOTE: we use double casts if pointers and target_ulong have
588 603
   different sizes */
589
#define ldub_raw(p) ldub_p((uint8_t *)(long)(p))
590
#define ldsb_raw(p) ldsb_p((uint8_t *)(long)(p))
591
#define lduw_raw(p) lduw_p((uint8_t *)(long)(p))
592
#define ldsw_raw(p) ldsw_p((uint8_t *)(long)(p))
593
#define ldl_raw(p) ldl_p((uint8_t *)(long)(p))
594
#define ldq_raw(p) ldq_p((uint8_t *)(long)(p))
595
#define ldfl_raw(p) ldfl_p((uint8_t *)(long)(p))
596
#define ldfq_raw(p) ldfq_p((uint8_t *)(long)(p))
597
#define stb_raw(p, v) stb_p((uint8_t *)(long)(p), v)
598
#define stw_raw(p, v) stw_p((uint8_t *)(long)(p), v)
599
#define stl_raw(p, v) stl_p((uint8_t *)(long)(p), v)
600
#define stq_raw(p, v) stq_p((uint8_t *)(long)(p), v)
601
#define stfl_raw(p, v) stfl_p((uint8_t *)(long)(p), v)
602
#define stfq_raw(p, v) stfq_p((uint8_t *)(long)(p), v)
604
#define saddr(x) (uint8_t *)(long)(x)
605
#define laddr(x) (uint8_t *)(long)(x)
606
#endif
607

  
608
#define ldub_raw(p) ldub_p(laddr((p)))
609
#define ldsb_raw(p) ldsb_p(laddr((p)))
610
#define lduw_raw(p) lduw_p(laddr((p)))
611
#define ldsw_raw(p) ldsw_p(laddr((p)))
612
#define ldl_raw(p) ldl_p(laddr((p)))
613
#define ldq_raw(p) ldq_p(laddr((p)))
614
#define ldfl_raw(p) ldfl_p(laddr((p)))
615
#define ldfq_raw(p) ldfq_p(laddr((p)))
616
#define stb_raw(p, v) stb_p(saddr((p)), v)
617
#define stw_raw(p, v) stw_p(saddr((p)), v)
618
#define stl_raw(p, v) stl_p(saddr((p)), v)
619
#define stq_raw(p, v) stq_p(saddr((p)), v)
620
#define stfl_raw(p, v) stfl_p(saddr((p)), v)
621
#define stfq_raw(p, v) stfq_p(saddr((p)), v)
603 622

  
604 623

  
605 624
#if defined(CONFIG_USER_ONLY) 
......
648 667
#define TARGET_PAGE_MASK ~(TARGET_PAGE_SIZE - 1)
649 668
#define TARGET_PAGE_ALIGN(addr) (((addr) + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK)
650 669

  
670
/* ??? These should be the larger of unsigned long and target_ulong.  */
651 671
extern unsigned long qemu_real_host_page_size;
652 672
extern unsigned long qemu_host_page_bits;
653 673
extern unsigned long qemu_host_page_size;
......
666 686
#define PAGE_WRITE_ORG 0x0010 
667 687

  
668 688
void page_dump(FILE *f);
669
int page_get_flags(unsigned long address);
670
void page_set_flags(unsigned long start, unsigned long end, int flags);
671
void page_unprotect_range(uint8_t *data, unsigned long data_size);
689
int page_get_flags(target_ulong address);
690
void page_set_flags(target_ulong start, target_ulong end, int flags);
691
void page_unprotect_range(target_ulong data, target_ulong data_size);
672 692

  
673 693
#define SINGLE_CPU_DEFINES
674 694
#ifdef SINGLE_CPU_DEFINES

Also available in: Unified diff