mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
Clean up debugging code #ifdefs (Eduardo Habkost)
Use macros to avoid #ifdefs on debugging code. This patch doesn't try to merge logging macros from different files, but just unify the debugging code #ifdefs onto a macro on each file. A further cleanup can unify the debugging macros on a common header, later Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6332 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
40a4539e20
commit
d12d51d5ba
15 changed files with 532 additions and 963 deletions
|
@ -32,8 +32,10 @@
|
|||
|
||||
#ifdef DEBUG
|
||||
#define D(x) x
|
||||
#define D_LOG(...) fprintf(logfile, ## __VA_ARGS__)
|
||||
#else
|
||||
#define D(x)
|
||||
#define D_LOG(...) do { } while (0)
|
||||
#endif
|
||||
|
||||
void cris_mmu_init(CPUState *env)
|
||||
|
@ -180,9 +182,8 @@ static int cris_mmu_translate_page(struct cris_mmu_result_t *res,
|
|||
tlb_pid = EXTRACT_FIELD(hi, 0, 7);
|
||||
tlb_g = EXTRACT_FIELD(lo, 4, 4);
|
||||
|
||||
D(fprintf(logfile,
|
||||
"TLB[%d][%d][%d] v=%x vpage=%x lo=%x hi=%x\n",
|
||||
mmu, set, idx, tlb_vpn, vpage, lo, hi));
|
||||
D_LOG("TLB[%d][%d][%d] v=%x vpage=%x lo=%x hi=%x\n",
|
||||
mmu, set, idx, tlb_vpn, vpage, lo, hi);
|
||||
if ((tlb_g || (tlb_pid == pid))
|
||||
&& tlb_vpn == vpage) {
|
||||
match = 1;
|
||||
|
@ -314,9 +315,8 @@ void cris_mmu_flush_pid(CPUState *env, uint32_t pid)
|
|||
|
||||
if (tlb_v && !tlb_g && (tlb_pid == pid)) {
|
||||
vaddr = tlb_vpn << TARGET_PAGE_BITS;
|
||||
D(fprintf(logfile,
|
||||
"flush pid=%x vaddr=%x\n",
|
||||
pid, vaddr));
|
||||
D_LOG("flush pid=%x vaddr=%x\n",
|
||||
pid, vaddr);
|
||||
tlb_flush_page(env, vaddr);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue