OSDN Git Service

fix libpagemap for x86_64
authorColin Cross <ccross@android.com>
Tue, 17 Jun 2014 01:52:47 +0000 (18:52 -0700)
committerColin Cross <ccross@android.com>
Tue, 17 Jun 2014 01:54:43 +0000 (18:54 -0700)
libpagemap was storing a virtual pfn in an int, which works on arm64
with 39 bits of virtual address space but fails on x86_64.  Use an
unsigned long instead.

Fixes errors when running procrank on x86_64:
warning: could not read usage for 1

Change-Id: I171c8ee49faa51accf3c1bb69059d549aee04979

libpagemap/pm_process.c

index dcc9a55..e68263c 100644 (file)
@@ -102,7 +102,7 @@ int pm_process_usage(pm_process_t *proc, pm_memusage_t *usage_out) {
 int pm_process_pagemap_range(pm_process_t *proc,
                              unsigned long low, unsigned long high,
                              uint64_t **range_out, size_t *len) {
-    int firstpage, numpages;
+    unsigned long firstpage, numpages;
     uint64_t *range;
     off_t off;
     int error;