diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2011-10-08 10:01:46 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2011-10-08 10:01:46 +0000 |
commit | 6c731dc2af1e80c410e8605098deb1ac16ab72f0 (patch) | |
tree | 2d22e73f1e60ddff21fd4e6c1c8e9127b64b8868 /target-ppc/kvm_ppc.c | |
parent | 6e19a1379d3d12c2d8f934aa8154037a609f4507 (diff) | |
parent | 7c0a3409627604c111d5c5e1ce4e0224c2b56315 (diff) |
Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf
* 'ppc-next' of git://repo.or.cz/qemu/agraf: (64 commits)
ppc64: Fix linker script
pseries: Implement set-time-of-day RTAS function
pseries: Refactor spapr irq allocation
PPC: Clean up BookE timer code
PPC: booke timers
KVM: PPC: Use HIOR setting for -M pseries with PR KVM
KVM: Update kernel headers
KVM: Update kernel headers
PPC: Fix heathrow PIC to use little endian MMIO
PPC: Fix via-cuda memory registration
ppc: move ADB stuff from ppc_mac.h to adb.h
openpic: Unfold write_IRQreg
openpic: Unfold read_IRQreg
ppc405: use RAM_ADDR_FMT instead of %08lx
Gdbstub: handle read of fpscr
vscsi: send the CHECK_CONDITION status down together with autosense data
pseries: Implement hcall-bulk hypervisor interface
Implement POWER7's CFAR in TCG
ppc: booke206: use MAV=2.0 TSIZE definition, fix 4G pages
ppc: booke206: add "info tlb" support
...
Diffstat (limited to 'target-ppc/kvm_ppc.c')
-rw-r--r-- | target-ppc/kvm_ppc.c | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/target-ppc/kvm_ppc.c b/target-ppc/kvm_ppc.c index c031fcb75..24fc6bce3 100644 --- a/target-ppc/kvm_ppc.c +++ b/target-ppc/kvm_ppc.c @@ -21,71 +21,6 @@ static QEMUTimer *kvmppc_timer; static unsigned int kvmppc_timer_rate; -#ifdef CONFIG_FDT -int kvmppc_read_host_property(const char *node_path, const char *prop, - void *val, size_t len) -{ - char *path; - FILE *f; - int ret = 0; - int pathlen; - - pathlen = snprintf(NULL, 0, "%s/%s/%s", PROC_DEVTREE_PATH, node_path, prop) - + 1; - path = g_malloc(pathlen); - - snprintf(path, pathlen, "%s/%s/%s", PROC_DEVTREE_PATH, node_path, prop); - - f = fopen(path, "rb"); - if (f == NULL) { - ret = errno; - goto free; - } - - len = fread(val, len, 1, f); - if (len != 1) { - ret = ferror(f); - goto close; - } - -close: - fclose(f); -free: - free(path); - return ret; -} - -static int kvmppc_copy_host_cell(void *fdt, const char *node, const char *prop) -{ - uint32_t cell; - int ret; - - ret = kvmppc_read_host_property(node, prop, &cell, sizeof(cell)); - if (ret < 0) { - fprintf(stderr, "couldn't read host %s/%s\n", node, prop); - goto out; - } - - ret = qemu_devtree_setprop_cell(fdt, node, prop, cell); - if (ret < 0) { - fprintf(stderr, "couldn't set guest %s/%s\n", node, prop); - goto out; - } - -out: - return ret; -} - -void kvmppc_fdt_update(void *fdt) -{ - /* Copy data from the host device tree into the guest. Since the guest can - * directly access the timebase without host involvement, we must expose - * the correct frequencies. */ - kvmppc_copy_host_cell(fdt, "/cpus/cpu@0", "clock-frequency"); - kvmppc_copy_host_cell(fdt, "/cpus/cpu@0", "timebase-frequency"); -} -#endif - static void kvmppc_timer_hack(void *opaque) { qemu_notify_event(); |