diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/clock.h | 13 | ||||
-rw-r--r-- | include/hw/mips/cps.h | 2 | ||||
-rw-r--r-- | include/hw/mips/mips.h | 4 | ||||
-rw-r--r-- | include/qemu/cutils.h | 12 |
4 files changed, 30 insertions, 1 deletions
diff --git a/include/hw/clock.h b/include/hw/clock.h index d357594df9..cbc5e6ced1 100644 --- a/include/hw/clock.h +++ b/include/hw/clock.h @@ -91,6 +91,19 @@ extern const VMStateDescription vmstate_clock; void clock_setup_canonical_path(Clock *clk); /** + * clock_new: + * @parent: the clock parent + * @name: the clock object name + * + * Helper function to create a new clock and parent it to @parent. There is no + * need to call clock_setup_canonical_path on the returned clock as it is done + * by this function. + * + * @return the newly created clock + */ +Clock *clock_new(Object *parent, const char *name); + +/** * clock_set_callback: * @clk: the clock to register the callback into * @cb: the callback function diff --git a/include/hw/mips/cps.h b/include/hw/mips/cps.h index 9e35a88136..859a8d4a67 100644 --- a/include/hw/mips/cps.h +++ b/include/hw/mips/cps.h @@ -21,6 +21,7 @@ #define MIPS_CPS_H #include "hw/sysbus.h" +#include "hw/clock.h" #include "hw/misc/mips_cmgcr.h" #include "hw/intc/mips_gic.h" #include "hw/misc/mips_cpc.h" @@ -43,6 +44,7 @@ struct MIPSCPSState { MIPSGICState gic; MIPSCPCState cpc; MIPSITUState itu; + Clock *clock; }; qemu_irq get_cps_irq(MIPSCPSState *cps, int pin_number); diff --git a/include/hw/mips/mips.h b/include/hw/mips/mips.h index 0af4c3d5d7..6c9c8805f3 100644 --- a/include/hw/mips/mips.h +++ b/include/hw/mips/mips.h @@ -2,8 +2,10 @@ #define HW_MIPS_H /* Definitions for mips board emulation. */ +#include "qemu/units.h" + /* Kernels can be configured with 64KB pages */ -#define INITRD_PAGE_MASK (~((1 << 16) - 1)) +#define INITRD_PAGE_SIZE (64 * KiB) #include "exec/memory.h" diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index 3a86ec0321..4bbf4834ea 100644 --- a/include/qemu/cutils.h +++ b/include/qemu/cutils.h @@ -158,6 +158,18 @@ int qemu_strtosz_metric(const char *nptr, const char **end, uint64_t *result); char *size_to_str(uint64_t val); +/** + * freq_to_str: + * @freq_hz: frequency to stringify + * + * Return human readable string for frequency @freq_hz. + * Use SI units like KHz, MHz, and so forth. + * + * The caller is responsible for releasing the value returned + * with g_free() after use. + */ +char *freq_to_str(uint64_t freq_hz); + /* used to print char* safely */ #define STR_OR_NULL(str) ((str) ? (str) : "null") |