From 364e9c641257738b3f1ba9f23d9fe0a0ccafce06 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Thu, 11 Jul 2019 15:06:20 -0700 Subject: Fix some 32-bit safety issues --- riscv/dts.cc | 2 +- riscv/jtag_dtm.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'riscv') diff --git a/riscv/dts.cc b/riscv/dts.cc index cea33ba..f730293 100644 --- a/riscv/dts.cc +++ b/riscv/dts.cc @@ -47,7 +47,7 @@ std::string make_dts(size_t insns_per_rtc_tick, size_t cpu_hz, " memory@" << m.first << " {\n" " device_type = \"memory\";\n" " reg = <0x" << (m.first >> 32) << " 0x" << (m.first & (uint32_t)-1) << - " 0x" << (m.second->size() >> 32) << " 0x" << (m.second->size() & (uint32_t)-1) << ">;\n" + " 0x" << (m.second->size() >> 16 >> 16) << " 0x" << (m.second->size() & (uint32_t)-1) << ">;\n" " };\n"; } s << " soc {\n" diff --git a/riscv/jtag_dtm.cc b/riscv/jtag_dtm.cc index 3e44c5e..576e495 100644 --- a/riscv/jtag_dtm.cc +++ b/riscv/jtag_dtm.cc @@ -25,8 +25,8 @@ enum { #define DTMCONTROL_DBUSRESET (1<<16) #define DMI_OP 3 -#define DMI_DATA (0xffffffffL<<2) -#define DMI_ADDRESS ((1L<<(abits+34)) - (1L<<34)) +#define DMI_DATA (0xffffffffLL<<2) +#define DMI_ADDRESS ((1LL<<(abits+34)) - (1LL<<34)) #define DMI_OP_STATUS_SUCCESS 0 #define DMI_OP_STATUS_RESERVED 1 -- cgit v1.1