Skip to content

Commit

Permalink
w64: Fix size of ram_addr_t
Browse files Browse the repository at this point in the history
ram_addr_t must be large enough to address any address of the host.

For hosts with sizeof(unsigned long) == sizeof(void *), this patch
changes nothing. All currently supported hosts fall into this category.

For w64 hosts, sizeof(unsigned long) is 4 while sizeof(void *) is 8,
so the use of uintptr_t is needed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
  • Loading branch information
stweil authored and blueswirl committed Mar 3, 2012
1 parent 5a30d3f commit 5357699
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cpu-common.h
Expand Up @@ -28,9 +28,9 @@ typedef uint64_t ram_addr_t;
# define RAM_ADDR_MAX UINT64_MAX
# define RAM_ADDR_FMT "%" PRIx64
#else
typedef unsigned long ram_addr_t;
# define RAM_ADDR_MAX ULONG_MAX
# define RAM_ADDR_FMT "%lx"
typedef uintptr_t ram_addr_t;
# define RAM_ADDR_MAX UINTPTR_MAX
# define RAM_ADDR_FMT "%" PRIxPTR
#endif

/* memory API */
Expand Down

0 comments on commit 5357699

Please sign in to comment.