VirtualBox

Changeset 36140 in vbox for trunk/src/recompiler/exec.c


Ignore:
Timestamp:
Mar 3, 2011 1:48:16 PM (14 years ago)
Author:
vboxsync
Message:

rem: Re-synced to svn://svn.savannah.nongnu.org/qemu/trunk@5495 (repo UUID c046a42c-6fe2-441c-8c8c-71466251a162).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/exec.c

    r36125 r36140  
    3131#ifndef VBOX
    3232#ifdef _WIN32
     33#define WIN32_LEAN_AND_MEAN
    3334#include <windows.h>
    3435#else
     
    5455#include "cpu.h"
    5556#include "exec-all.h"
     57#include "qemu-common.h"
     58#include "tcg.h"
     59#ifndef VBOX
     60#include "hw/hw.h"
     61#endif
     62#include "osdep.h"
    5663#if defined(CONFIG_USER_ONLY)
    5764#include <qemu.h>
     
    6673//#define DEBUG_TB_CHECK
    6774//#define DEBUG_TLB_CHECK
     75
     76//#define DEBUG_IOPORT
     77//#define DEBUG_SUBPAGE
    6878
    6979#if !defined(CONFIG_USER_ONLY)
     
    114124    __attribute__((aligned (32)))
    115125#endif
     126
    116127uint8_t code_gen_prologue[1024] code_gen_section;
    117 
    118128#else /* VBOX */
    119129extern uint8_t* code_gen_prologue;
    120130#endif /* VBOX */
    121 
    122131static uint8_t *code_gen_buffer;
    123132static unsigned long code_gen_buffer_size;
     
    171180
    172181typedef struct PhysPageDesc {
    173     /* offset in host memory of the page + io_index in the low 12 bits */
     182    /* offset in host memory of the page + io_index in the low bits */
    174183    ram_addr_t phys_offset;
    175184} PhysPageDesc;
     
    194203#define L1_SIZE (1 << L1_BITS)
    195204#define L2_SIZE (1 << L2_BITS)
    196 
    197 static void io_mem_init(void);
    198205
    199206unsigned long qemu_real_host_page_size;
     
    252259} subpage_t;
    253260
    254 
    255261#ifndef VBOX
    256262#ifdef _WIN32
     
    279285}
    280286#endif
    281 #else // VBOX
     287#else /* VBOX */
    282288static void map_exec(void *addr, long size)
    283289{
     
    285291                 RTMEM_PROT_EXEC | RTMEM_PROT_READ | RTMEM_PROT_WRITE);
    286292}
    287 #endif
     293#endif /* VBOX */
    288294
    289295static void page_init(void)
     
    325331    memset(l1_phys_map, 0, L1_SIZE * sizeof(void *));
    326332#endif
     333
    327334#ifdef VBOX
    328335    /* We use other means to set reserved bit on our pages */
    329 #else
     336#else  /* !VBOX */
    330337#if !defined(_WIN32) && defined(CONFIG_USER_ONLY)
    331338    {
     
    355362    }
    356363#endif
    357 #endif
     364#endif /* !VBOX */
    358365}
    359366
     
    498505#endif
    499506
    500 #ifdef VBOX
    501 /*
    502  * We don't need such huge codegen buffer size, as execute most of the code
    503  * in raw or hwacc mode
    504  */
     507#ifdef VBOX /*  We don't need such huge codegen buffer size, as execute
     508                most of the code  in raw or hwacc mode. */
    505509#define DEFAULT_CODE_GEN_BUFFER_SIZE (8 * 1024 * 1024)
    506 #else
     510#else  /* !VBOX */
    507511#define DEFAULT_CODE_GEN_BUFFER_SIZE (32 * 1024 * 1024)
    508 #endif
     512#endif /* !VBOX */
    509513
    510514#if defined(CONFIG_USER_ONLY)
    511 /* Currently it is not recommended to allocate big chunks of data in
     515/* Currently it is not recommanded to allocate big chunks of data in
    512516   user mode. It will change when a dedicated libc will be used */
    513517#define USE_STATIC_CODE_GEN_BUFFER
     
    829833    }
    830834}
    831 #endif // DEBUG_TB_CHECK
     835
     836#endif
    832837
    833838/* invalidate one TB */
     
    956961
    957962#ifdef VBOX
     963
    958964void tb_invalidate_virt(CPUState *env, uint32_t eip)
    959965{
     
    9981004}
    9991005# endif /* VBOX_STRICT */
     1006
    10001007#endif /* VBOX */
    10011008
     
    10321039    TranslationBlock *tb;
    10331040
    1034     p->code_bitmap = qemu_malloc(TARGET_PAGE_SIZE / 8);
     1041    p->code_bitmap = qemu_mallocz(TARGET_PAGE_SIZE / 8);
    10351042    if (!p->code_bitmap)
    10361043        return;
    1037     memset(p->code_bitmap, 0, TARGET_PAGE_SIZE / 8);
    10381044
    10391045    tb = p->first_tb;
     
    15161522static void breakpoint_invalidate(CPUState *env, target_ulong pc)
    15171523{
    1518     target_ulong addr, pd;
     1524    target_phys_addr_t addr;
     1525    target_ulong pd;
    15191526    ram_addr_t ram_addr;
    15201527    PhysPageDesc *p;
     
    16441651    if (env->singlestep_enabled != enabled) {
    16451652        env->singlestep_enabled = enabled;
    1646         /* must flush all the translated code to avoid inconsistencies */
     1653        /* must flush all the translated code to avoid inconsistancies */
    16471654        /* XXX: only flush what is necessary */
    16481655        tb_flush(env);
     
    16571664    loglevel = log_flags;
    16581665    if (loglevel && !logfile) {
    1659         logfile = fopen(logfilename, "w");
     1666        logfile = fopen(logfilename, log_append ? "a" : "w");
    16601667        if (!logfile) {
    16611668            perror(logfilename);
     
    16651672        /* must avoid mmap() usage of glibc by setting a buffer "by hand" */
    16661673        {
    1667             static uint8_t logfile_buf[4096];
     1674            static char logfile_buf[4096];
    16681675            setvbuf(logfile, logfile_buf, _IOLBF, sizeof(logfile_buf));
    16691676        }
     
    16711678        setvbuf(logfile, NULL, _IOLBF, 0);
    16721679#endif
     1680        log_append = 1;
     1681    }
     1682    if (!loglevel && logfile) {
     1683        fclose(logfile);
     1684        logfile = NULL;
    16731685    }
    16741686}
     
    16771689{
    16781690    logfilename = strdup(filename);
     1691    if (logfile) {
     1692        fclose(logfile);
     1693        logfile = NULL;
     1694    }
     1695    cpu_set_log(loglevel);
    16791696}
    16801697#endif /* !VBOX */
     
    17471764      "show target assembly code for each compiled TB" },
    17481765    { CPU_LOG_TB_OP, "op",
    1749       "show micro ops for each compiled TB (only usable if 'in_asm' used)" },
     1766      "show micro ops for each compiled TB" },
     1767    { CPU_LOG_TB_OP_OPT, "op_opt",
     1768      "show micro ops "
    17501769#ifdef TARGET_I386
    1751     { CPU_LOG_TB_OP_OPT, "op_opt",
    1752       "show micro ops after optimization for each compiled TB" },
    1753 #endif
     1770      "before eflags optimization and "
     1771#endif
     1772      "after liveness analysis" },
    17541773    { CPU_LOG_INT, "int",
    17551774      "show interrupts/exceptions in short format" },
     
    17571776      "show trace before each executed TB (lots of logs)" },
    17581777    { CPU_LOG_TB_CPU, "cpu",
    1759       "show CPU state before bloc translation" },
     1778      "show CPU state before block translation" },
    17601779#ifdef TARGET_I386
    17611780    { CPU_LOG_PCALL, "pcall",
     
    17791798int cpu_str_to_log_mask(const char *str)
    17801799{
    1781     CPULogItem *item;
     1800    const CPULogItem *item;
    17821801    int mask;
    17831802    const char *p, *p1;
     
    18141833{
    18151834    va_list ap;
     1835    va_list ap2;
    18161836
    18171837    va_start(ap, fmt);
     1838    va_copy(ap2, ap);
    18181839    fprintf(stderr, "qemu: fatal: ");
    18191840    vfprintf(stderr, fmt, ap);
     
    18241845    cpu_dump_state(env, stderr, fprintf, 0);
    18251846#endif
     1847    if (logfile) {
     1848        fprintf(logfile, "qemu: fatal: ");
     1849        vfprintf(logfile, fmt, ap2);
     1850        fprintf(logfile, "\n");
     1851#ifdef TARGET_I386
     1852        cpu_dump_state(env, logfile, fprintf, X86_DUMP_FPU | X86_DUMP_CCOP);
     1853#else
     1854        cpu_dump_state(env, logfile, fprintf, 0);
     1855#endif
     1856        fflush(logfile);
     1857        fclose(logfile);
     1858    }
     1859    va_end(ap2);
    18261860    va_end(ap);
    18271861    abort();
     
    18411875    return new_env;
    18421876}
    1843 #endif
     1877#endif /* !VBOX */
    18441878
    18451879#if !defined(CONFIG_USER_ONLY)
     
    18651899}
    18661900
     1901#ifdef VBOX
    18671902static CPUTLBEntry s_cputlb_empty_entry = {
    18681903    .addr_read  = -1,
     
    18711906    .addend     = -1,
    18721907};
     1908#endif /* VBOX */
    18731909
    18741910/* NOTE: if flush_global is true, also flush global entries (not
     
    18861922
    18871923    for(i = 0; i < CPU_TLB_SIZE; i++) {
     1924#ifdef VBOX
    18881925        int mmu_idx;
    18891926        for (mmu_idx = 0; mmu_idx < NB_MMU_MODES; mmu_idx++) {
    18901927            env->tlb_table[mmu_idx][i] = s_cputlb_empty_entry;
    18911928        }
     1929#else  /* !VBOX */
     1930        env->tlb_table[0][i].addr_read = -1;
     1931        env->tlb_table[0][i].addr_write = -1;
     1932        env->tlb_table[0][i].addr_code = -1;
     1933        env->tlb_table[1][i].addr_read = -1;
     1934        env->tlb_table[1][i].addr_write = -1;
     1935        env->tlb_table[1][i].addr_code = -1;
     1936#if (NB_MMU_MODES >= 3)
     1937        env->tlb_table[2][i].addr_read = -1;
     1938        env->tlb_table[2][i].addr_write = -1;
     1939        env->tlb_table[2][i].addr_code = -1;
     1940#if (NB_MMU_MODES == 4)
     1941        env->tlb_table[3][i].addr_read = -1;
     1942        env->tlb_table[3][i].addr_write = -1;
     1943        env->tlb_table[3][i].addr_code = -1;
     1944#endif
     1945#endif
     1946#endif /* !VBOX */
    18921947    }
    18931948
     
    19872042        addr = (tlb_entry->addr_write & TARGET_PAGE_MASK) + tlb_entry->addend;
    19882043        if ((addr - start) < length) {
    1989             tlb_entry->addr_write = (tlb_entry->addr_write & TARGET_PAGE_MASK) | IO_MEM_NOTDIRTY;
     2044            tlb_entry->addr_write = (tlb_entry->addr_write & TARGET_PAGE_MASK) | TLB_NOTDIRTY;
    19902045        }
    19912046    }
     
    21292184}
    21302185
    2131 
    2132 /* update the TLB corresponding to virtual page vaddr and phys addr
    2133    addr so that it is no longer dirty */
    2134 static inline void tlb_set_dirty(CPUState *env,
    2135                                  unsigned long addr, target_ulong vaddr)
     2186/* update the TLB corresponding to virtual page vaddr
     2187   so that it is no longer dirty */
     2188static inline void tlb_set_dirty(CPUState *env, target_ulong vaddr)
    21362189{
    21372190    int i;
    21382191
    2139     addr &= TARGET_PAGE_MASK;
     2192    vaddr &= TARGET_PAGE_MASK;
    21402193    i = (vaddr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
    2141     tlb_set_dirty1(&env->tlb_table[0][i], addr);
    2142     tlb_set_dirty1(&env->tlb_table[1][i], addr);
     2194    tlb_set_dirty1(&env->tlb_table[0][i], vaddr);
     2195    tlb_set_dirty1(&env->tlb_table[1][i], vaddr);
    21432196#if (NB_MMU_MODES >= 3)
    21442197    tlb_set_dirty1(&env->tlb_table[2][i], vaddr);
     
    23022355    return ret;
    23032356}
    2304 #if 0
    2305 /* called from signal handler: invalidate the code and unprotect the
    2306    page. Return TRUE if the fault was successfully handled. */
    2307 int page_unprotect(target_ulong addr, unsigned long pc, void *puc)
    2308 {
    2309 #if !defined(CONFIG_SOFTMMU)
    2310     VirtPageDesc *vp;
    2311 
    2312 #if defined(DEBUG_TLB)
    2313     printf("page_unprotect: addr=0x%08x\n", addr);
    2314 #endif
    2315     addr &= TARGET_PAGE_MASK;
    2316 
    2317     /* if it is not mapped, no need to worry here */
    2318     if (addr >= MMAP_AREA_END)
    2319         return 0;
    2320     vp = virt_page_find(addr >> TARGET_PAGE_BITS);
    2321     if (!vp)
    2322         return 0;
    2323     /* NOTE: in this case, validate_tag is _not_ tested as it
    2324        validates only the code TLB */
    2325     if (vp->valid_tag != virt_valid_tag)
    2326         return 0;
    2327     if (!(vp->prot & PAGE_WRITE))
    2328         return 0;
    2329 #if defined(DEBUG_TLB)
    2330     printf("page_unprotect: addr=0x%08x phys_addr=0x%08x prot=%x\n",
    2331            addr, vp->phys_addr, vp->prot);
    2332 #endif
    2333     if (mprotect((void *)addr, TARGET_PAGE_SIZE, vp->prot) < 0)
    2334         cpu_abort(cpu_single_env, "error mprotect addr=0x%lx prot=%d\n",
    2335                   (unsigned long)addr, vp->prot);
    2336     /* set the dirty bit */
    2337     phys_ram_dirty[vp->phys_addr >> TARGET_PAGE_BITS] = 0xff;
    2338     /* flush the code inside */
    2339     tb_invalidate_phys_page(vp->phys_addr, pc, puc);
    2340     return 1;
    2341 #elif defined(VBOX)
    2342     addr &= TARGET_PAGE_MASK;
    2343 
    2344     /* if it is not mapped, no need to worry here */
    2345     if (addr >= MMAP_AREA_END)
    2346         return 0;
    2347     return 1;
    2348 #else
    2349     return 0;
    2350 #endif
    2351 }
    2352 #endif /* 0 */
    23532357
    23542358#else
     
    24252429
    24262430/* modify the flags of a page and invalidate the code if
    2427    necessary. The flag PAGE_WRITE_ORG is positioned automatically
     2431   necessary. The flag PAGE_WRITE_ORG is positionned automatically
    24282432   depending on PAGE_WRITE */
    24292433void page_set_flags(target_ulong start, target_ulong end, int flags)
     
    24322436    target_ulong addr;
    24332437
     2438    /* mmap_lock should already be held.  */
    24342439    start = start & TARGET_PAGE_MASK;
    24352440    end = TARGET_PAGE_ALIGN(end);
     
    24392444    AssertMsgFailed(("We shouldn't be here, and if we should, we must have an env to do the proper locking!\n"));
    24402445#endif
    2441     spin_lock(&tb_lock);
    24422446    for(addr = start; addr < end; addr += TARGET_PAGE_SIZE) {
    24432447        p = page_find_alloc(addr >> TARGET_PAGE_BITS);
     2448        /* We may be called for host regions that are outside guest
     2449           address space.  */
     2450        if (!p)
     2451            return;
    24442452        /* if the write protection is set, then we invalidate the code
    24452453           inside */
     
    24512459        p->flags = flags;
    24522460    }
    2453     spin_unlock(&tb_lock);
    24542461}
    24552462
     
    24912498
    24922499/* called from signal handler: invalidate the code and unprotect the
    2493    page. Return TRUE if the fault was successfully handled. */
     2500   page. Return TRUE if the fault was succesfully handled. */
    24942501int page_unprotect(target_ulong address, unsigned long pc, void *puc)
    24952502{
     
    25702577    } while (0)
    25712578
    2572 
    25732579/* register physical memory. 'size' must be a multiple of the target
    25742580   page size. If (phys_offset & ~TARGET_PAGE_MASK) != 0, then it is an
    25752581   io memory page */
    25762582void cpu_register_physical_memory(target_phys_addr_t start_addr,
    2577                                   unsigned long size,
    2578                                   unsigned long phys_offset)
     2583                                  ram_addr_t size,
     2584                                  ram_addr_t phys_offset)
    25792585{
    25802586    target_phys_addr_t addr, end_addr;
     
    26132619            } else {
    26142620                p->phys_offset = phys_offset;
    2615         if ((phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM ||
    2616             (phys_offset & IO_MEM_ROMD))
     2621                if ((phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM ||
     2622                    (phys_offset & IO_MEM_ROMD))
    26172623                    phys_offset += TARGET_PAGE_SIZE;
    26182624            }
     
    26202626            p = phys_page_find_alloc(addr >> TARGET_PAGE_BITS, 1);
    26212627            p->phys_offset = phys_offset;
    2622         if ((phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM ||
    2623             (phys_offset & IO_MEM_ROMD))
     2628            if ((phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM ||
     2629                (phys_offset & IO_MEM_ROMD))
    26242630                phys_offset += TARGET_PAGE_SIZE;
    26252631            else {
     
    26392645        }
    26402646    }
     2647
    26412648    /* since each CPU stores ram addresses in its TLB cache, we must
    26422649       reset the modified entries */
     
    26482655
    26492656/* XXX: temporary until new memory mapping API */
    2650 uint32_t cpu_get_physical_page_desc(target_phys_addr_t addr)
     2657ram_addr_t cpu_get_physical_page_desc(target_phys_addr_t addr)
    26512658{
    26522659    PhysPageDesc *p;
     
    26762683{
    26772684}
    2678 #endif
    2679 
     2685#endif /* !VBOX */
    26802686
    26812687static uint32_t unassigned_mem_readb(void *opaque, target_phys_addr_t addr)
    26822688{
    26832689#ifdef DEBUG_UNASSIGNED
    2684     printf("Unassigned mem read  0x%08x\n", (int)addr);
     2690    printf("Unassigned mem read " TARGET_FMT_plx "\n", addr);
    26852691#endif
    26862692#if defined(TARGET_SPARC) || defined(TARGET_CRIS)
     
    27152721{
    27162722#ifdef DEBUG_UNASSIGNED
    2717     printf("Unassigned mem write 0x%08x = 0x%x\n", (int)addr, val);
     2723    printf("Unassigned mem write " TARGET_FMT_plx " = 0x%x\n", addr, val);
     2724#endif
     2725#if defined(TARGET_SPARC) || defined(TARGET_CRIS)
     2726    do_unassigned_access(addr, 1, 0, 0, 1);
    27182727#endif
    27192728}
     
    27382747#endif
    27392748}
     2749
    27402750static CPUReadMemoryFunc *unassigned_mem_read[3] = {
    27412751    unassigned_mem_readb,
     
    27502760};
    27512761
    2752 static void notdirty_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val)
    2753 {
    2754     unsigned long ram_addr;
     2762static void notdirty_mem_writeb(void *opaque, target_phys_addr_t ram_addr,
     2763                                uint32_t val)
     2764{
    27552765    int dirty_flags;
    2756 #if defined(VBOX)
    2757     ram_addr = addr;
    2758 #else
    2759     ram_addr = addr - (unsigned long)phys_ram_base;
    2760 #endif
    27612766#ifdef VBOX
    27622767    if (RT_UNLIKELY((ram_addr >> TARGET_PAGE_BITS) >= phys_ram_dirty_size))
     
    27772782    }
    27782783#if defined(VBOX) && !defined(REM_PHYS_ADDR_IN_TLB)
    2779     remR3PhysWriteU8(addr, val);
    2780 #else
    2781     stb_p((uint8_t *)(long)addr, val);
     2784    remR3PhysWriteU8(ram_addr, val);
     2785#else
     2786    stb_p(phys_ram_base + ram_addr, val);
    27822787#endif
    27832788#ifdef USE_KQEMU
     
    27942799       flushed */
    27952800    if (dirty_flags == 0xff)
    2796         tlb_set_dirty(cpu_single_env, addr, cpu_single_env->mem_io_vaddr);
    2797 }
    2798 
    2799 static void notdirty_mem_writew(void *opaque, target_phys_addr_t addr, uint32_t val)
    2800 {
    2801     unsigned long ram_addr;
     2801        tlb_set_dirty(cpu_single_env, cpu_single_env->mem_io_vaddr);
     2802}
     2803
     2804static void notdirty_mem_writew(void *opaque, target_phys_addr_t ram_addr,
     2805                                uint32_t val)
     2806{
    28022807    int dirty_flags;
    2803 #if defined(VBOX)
    2804     ram_addr = addr;
    2805 #else
    2806     ram_addr = addr - (unsigned long)phys_ram_base;
    2807 #endif
    28082808#ifdef VBOX
    28092809    if (RT_UNLIKELY((ram_addr >> TARGET_PAGE_BITS) >= phys_ram_dirty_size))
     
    28242824    }
    28252825#if defined(VBOX) && !defined(REM_PHYS_ADDR_IN_TLB)
    2826     remR3PhysWriteU16(addr, val);
    2827 #else
    2828     stw_p((uint8_t *)(long)addr, val);
     2826    remR3PhysWriteU16(ram_addr, val);
     2827#else
     2828    stw_p(phys_ram_base + ram_addr, val);
    28292829#endif
    28302830
     
    28422842       flushed */
    28432843    if (dirty_flags == 0xff)
    2844         tlb_set_dirty(cpu_single_env, addr, cpu_single_env->mem_io_vaddr);
    2845 }
    2846 
    2847 static void notdirty_mem_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
    2848 {
    2849     unsigned long ram_addr;
     2844        tlb_set_dirty(cpu_single_env, cpu_single_env->mem_io_vaddr);
     2845}
     2846
     2847static void notdirty_mem_writel(void *opaque, target_phys_addr_t ram_addr,
     2848                                uint32_t val)
     2849{
    28502850    int dirty_flags;
    2851 #if defined(VBOX)
    2852     ram_addr = addr;
    2853 #else
    2854     ram_addr = addr - (unsigned long)phys_ram_base;
    2855 #endif
    28562851#ifdef VBOX
    28572852    if (RT_UNLIKELY((ram_addr >> TARGET_PAGE_BITS) >= phys_ram_dirty_size))
     
    28722867    }
    28732868#if defined(VBOX) && !defined(REM_PHYS_ADDR_IN_TLB)
    2874     remR3PhysWriteU32(addr, val);
    2875 #else
    2876     stl_p((uint8_t *)(long)addr, val);
     2869    remR3PhysWriteU32(ram_addr, val);
     2870#else
     2871    stl_p(phys_ram_base + ram_addr, val);
    28772872#endif
    28782873#ifdef USE_KQEMU
     
    28892884       flushed */
    28902885    if (dirty_flags == 0xff)
    2891         tlb_set_dirty(cpu_single_env, addr, cpu_single_env->mem_io_vaddr);
     2886        tlb_set_dirty(cpu_single_env, cpu_single_env->mem_io_vaddr);
    28922887}
    28932888
     
    29032898    notdirty_mem_writel,
    29042899};
    2905 
    29062900
    29072901/* Generate a debug exception if a watchpoint has been hit.  */
     
    31843178    return io_mem_read[io_index >> IO_MEM_SHIFT];
    31853179}
     3180
    31863181#endif /* !defined(CONFIG_USER_ONLY) */
    31873182
     
    32103205                /* FIXME - should this return an error rather than just fail? */
    32113206                return;
    3212             memcpy(p, buf, len);
    3213             unlock_user(p, addr, len);
     3207            memcpy(p, buf, l);
     3208            unlock_user(p, addr, l);
    32143209        } else {
    32153210            if (!(flags & PAGE_READ))
    32163211                return;
     3212            /* XXX: this code should not depend on lock_user */
    32173213            if (!(p = lock_user(VERIFY_READ, addr, l, 1)))
    32183214                /* FIXME - should this return an error rather than just fail? */
    32193215                return;
    3220             memcpy(buf, p, len);
     3216            memcpy(buf, p, l);
    32213217            unlock_user(p, addr, 0);
    32223218        }
     
    35083504    } else {
    35093505#ifndef VBOX
    3510         ptr = phys_ram_base + (pd & TARGET_PAGE_MASK) +
    3511             (addr & ~TARGET_PAGE_MASK);
     3506        unsigned long addr1 = (pd & TARGET_PAGE_MASK) + (addr & ~TARGET_PAGE_MASK);
     3507        ptr = phys_ram_base + addr1;
    35123508        stl_p(ptr, val);
    35133509#else
     
    35213517                /* set dirty bit */
    35223518                phys_ram_dirty[addr1 >> TARGET_PAGE_BITS] |=
    3523                         (0xff & ~CODE_DIRTY_FLAG);
     3519                    (0xff & ~CODE_DIRTY_FLAG);
    35243520            }
    35253521        }
    3526 #endif
     3522#endif /* !VBOX */
    35273523    }
    35283524}
     
    35613557    }
    35623558}
    3563 
    35643559
    35653560/* warning: addr must be aligned */
     
    36323627{
    36333628    int l;
    3634     target_ulong page, phys_addr;
     3629    target_phys_addr_t phys_addr;
     3630    target_ulong page;
    36353631
    36363632    while (len > 0) {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette