-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDECAF_target.c
65 lines (51 loc) · 1.65 KB
/
DECAF_target.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
Copyright (C) <2012> <Syracuse System Security (Sycure) Lab>
DECAF is based on QEMU, a whole-system emulator. You can redistribute
and modify it under the terms of the GNU LGPL, version 2.1 or later,
but it is made available WITHOUT ANY WARRANTY. See the top-level
README file for more details.
For more information about DECAF and other softwares, see our
web site at:
http://sycurelab.ecs.syr.edu/
If you have any questions about DECAF,please post it on
http://code.google.com/p/decaf-platform/
*/
#include <assert.h>
#include <sys/queue.h>
#include "sysemu.h" // AWH
#include "qemu-timer.h" // AWH
#include "hw/hw.h"
#include "hw/isa.h" /* for register_ioport_write */
#include "blockdev.h" // AWH
#include "shared/DECAF_main.h" // AWH
#include "shared/DECAF_callback.h"
#include "shared/hookapi.h" // AWH
#include "DECAF_target.h"
#include "shared/linux_vmi.h"
gpa_t DECAF_get_phys_addr_with_pgd(CPUState* env, gpa_t pgd, gva_t addr)
{
monitor_printf(default_mon, "ERROR: DECAF_get_phys_addr_with_pgd doesn't work for MIPS.\n");
return -1;
// if (env == NULL)
// {
// #ifdef DECAF_NO_FAIL_SAFE
// return (INV_ADDR);
// #else
// env = cpu_single_env ? cpu_single_env : first_cpu;
// #endif
// }
// gpa_t old = env->CP0_EntryLo0;
// gpa_t old1 = env->CP0_EntryLo1;
// gpa_t phys_addr;
// env->CP0_EntryLo0 = pgd;
// env->CP0_EntryLo1 = pgd;
// phys_addr = cpu_get_phys_page_debug(env, addr & TARGET_PAGE_MASK);
// env->CP0_EntryLo0 = old;
// env->CP0_EntryLo1 = old1;
// return (phys_addr | (addr & (~TARGET_PAGE_MASK)));
}
// FIXME: assume only one processor
gpa_t DECAF_getPGD(CPUState* env)
{
return mips_get_cur_pgd(env);
}