diff options
author | Avi Kivity <avi@redhat.com> | 2009-12-02 12:48:32 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-12-02 12:48:32 +0200 |
commit | 2e88035e52dee6b6efac71fbd1432ed1c117eab8 (patch) | |
tree | 943ab9665347abb29fdf6eb3a47205f4adbb3a2f /qemu-common.h | |
parent | kvm_handle_internal_error should return 1 (diff) | |
parent | Update SeaBIOS (diff) | |
download | qemu-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.h | 11 |
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 */ |