qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3] implementing victim TLB for QEMU system emul


From: Xin Tong
Subject: Re: [Qemu-devel] [PATCH v3] implementing victim TLB for QEMU system emulated TLB
Date: Sun, 2 Feb 2014 13:39:53 -0600

what should i do here? i want to pass the ADDR_READ/addr_write into
the macro. But i do not know how I can convert it into
env->tlb_v_table[mmu_idx][vidx].ADDR_READ/env->tlb_v_table[mmu_idx][vidx].addr_write.

Thanks a lot,
Xin

On Sun, Feb 2, 2014 at 1:29 PM, Peter Maydell <address@hidden> wrote:
> On 2 February 2014 19:01, Xin Tong <address@hidden> wrote:
>> I am getting some compilation errors while stringnifying the
>> ADDR_READ, addr_write.
>>
>> function helper_be_ldq_cmmu
>>
>>  if (!VICTIM_TLB_HIT(ADDR_READ)) {
>>
>>
>> macro
>>
>> #define VICTIM_TLB_HIT(ACCESS_TYPE)                                          
>>  \
>> ({                                                                           
>>  \
>>     /* we are about to do a page table walk. our last hope is the            
>>  \
>>      * victim tlb. try to refill from the victim tlb before walking the      
>>  \
>>      * page table. */                                                        
>>  \
>>     int vidx;                                                                
>>  \
>>     hwaddr tmpiotlb;                                                         
>>  \
>>     CPUTLBEntry tmptlb;                                                      
>>  \
>>     for (vidx = CPU_VTLB_SIZE; vidx >= 0; --vidx) {                          
>>  \
>>         if (env->tlb_v_table[mmu_idx][vidx].#ACCESS_TYPE                     
>>  \
>>             == (addr & TARGET_PAGE_MASK)) {                                  
>>  \
>>             /* found entry in victim tlb, swap tlb and iotlb */              
>>  \
>>             tmptlb = env->tlb_table[mmu_idx][index];                         
>>  \
>>             env->tlb_table[mmu_idx][index] = 
>> env->tlb_v_table[mmu_idx][vidx]; \
>>             env->tlb_v_table[mmu_idx][vidx] = tmptlb;                        
>>  \
>>             tmpiotlb = env->iotlb[mmu_idx][index];                           
>>  \
>>
>>
>> compilation error
>>
>> /home/xtong/qemu/include/exec/softmmu_template.h: In function
>> 'helper_be_ldq_cmmu':
>> /home/xtong/qemu/include/exec/softmmu_template.h:266: error: expected
>> identifier before string constant
>
> That's because you're trying to stringify the macro argument with
> that '#'. Don't do that -- you don't want a string.
>
> thanks
> -- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]