aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-12-02 12:48:32 +0200
committerAvi Kivity <avi@redhat.com>2009-12-02 12:48:32 +0200
commit2e88035e52dee6b6efac71fbd1432ed1c117eab8 (patch)
tree943ab9665347abb29fdf6eb3a47205f4adbb3a2f /qemu-common.h
parentkvm_handle_internal_error should return 1 (diff)
parentUpdate SeaBIOS (diff)
downloadqemu-kvm-2e88035e52dee6b6efac71fbd1432ed1c117eab8.tar.gz
qemu-kvm-2e88035e52dee6b6efac71fbd1432ed1c117eab8.tar.bz2
qemu-kvm-2e88035e52dee6b6efac71fbd1432ed1c117eab8.zip
Merge commit 'b0293e54af32bcf08f4b4e5b4b472534de343972' into upstream-merge
* commit 'b0293e54af32bcf08f4b4e5b4b472534de343972': Update SeaBIOS ARM atomic ops rewrite ARM RealView I2C GPIO I2C rework DS1338 RTC BCD cleanup Makefile dependencies for device configs target-mips: fix physical address type in MMU functions [WIN32] Enable -k option on Windows too target-mips: make CP0_LLAddr register CPU dependent target-mips: rename CP0_LLAddr into lladdr Conflicts: pc-bios/bios.bin (pick upstream's) Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'qemu-common.h')
-rw-r--r--qemu-common.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/qemu-common.h b/qemu-common.h
index f08a1b670..05377b173 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -256,6 +256,17 @@ void qemu_iovec_from_buffer(QEMUIOVector *qiov, const void *buf, size_t count);
struct Monitor;
typedef struct Monitor Monitor;
+/* Convert a byte between binary and BCD. */
+static inline uint8_t to_bcd(uint8_t val)
+{
+ return ((val / 10) << 4) | (val % 10);
+}
+
+static inline uint8_t from_bcd(uint8_t val)
+{
+ return ((val >> 4) * 10) + (val & 0x0f);
+}
+
#include "module.h"
#endif /* dyngen-exec.h hack */