summaryrefslogtreecommitdiff
path: root/hw/mips_r4k.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2006-12-21 13:48:28 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2006-12-21 13:48:28 +0000
commit5dc4b744806b5f7487989e42a84322fbd5810877 (patch)
tree9694eb3eefb095920f55af4c92b7dd37e9482bb9 /hw/mips_r4k.c
parentc570fd169c16f110781f31e0e963542a15229ee9 (diff)
downloadqemu-5dc4b744806b5f7487989e42a84322fbd5810877.tar.gz
qemu-5dc4b744806b5f7487989e42a84322fbd5810877.tar.bz2
qemu-5dc4b744806b5f7487989e42a84322fbd5810877.zip
Scrap SIGN_EXTEND32.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2251 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/mips_r4k.c')
-rw-r--r--hw/mips_r4k.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/hw/mips_r4k.c b/hw/mips_r4k.c
index ca3a4ffce9..1f779b2ff6 100644
--- a/hw/mips_r4k.c
+++ b/hw/mips_r4k.c
@@ -11,10 +11,14 @@
#define BIOS_FILENAME "mips_bios.bin"
//#define BIOS_FILENAME "system.bin"
-#define KERNEL_LOAD_ADDR SIGN_EXTEND32(0x80010000)
-#define INITRD_LOAD_ADDR SIGN_EXTEND32(0x80800000)
+#define KERNEL_LOAD_ADDR (int32_t)0x80010000
+#ifdef MIPS_HAS_MIPS64
+#define INITRD_LOAD_ADDR (int64_t)0x80800000
+#else
+#define INITRD_LOAD_ADDR (int32_t)0x80800000
+#endif
-#define VIRT_TO_PHYS_ADDEND (-SIGN_EXTEND32(0x80000000LL))
+#define VIRT_TO_PHYS_ADDEND (-((int64_t)(int32_t)0x80000000))
static const int ide_iobase[2] = { 0x1f0, 0x170 };
static const int ide_iobase2[2] = { 0x3f6, 0x376 };
@@ -76,7 +80,7 @@ void load_kernel (CPUState *env, int ram_size, const char *kernel_filename,
kernel_size = load_elf(kernel_filename, VIRT_TO_PHYS_ADDEND, &entry);
if (kernel_size >= 0) {
if ((entry & ~0x7fffffffULL) == 0x80000000)
- entry = SIGN_EXTEND32(entry);
+ entry = (int32_t)entry;
env->PC = entry;
} else {
kernel_size = load_image(kernel_filename,