Xen 
 
Home About Xen.org Xen Xen Summit Wiki Mailing List Bug Tracker Xen Downloads
 
   
 

xen-devel

[Xen-devel] e820.c : why char* ? (2nd try)

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] e820.c : why char* ? (2nd try)
From: PUCCETTI Armand <armand.puccetti@xxxxxx>
Date: Thu, 29 Jun 2006 11:36:56 +0200
Delivery-date: Thu, 29 Jun 2006 02:38:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.2 (X11/20060521)
In function

sanitize_e820_map(struct e820entry * biosmap, char * pnr_map)

of file e820.c, the last argument is treated as an integer, but when compiling with gcc
it belongs to [-128,127].

Inside the body of that function, however, we use that argument as an int to fill up a table of a different
size, namely:

static struct change_member *change_point [256]
static struct change_member change_point_list [256]
static int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map)
{
...
old_nr = *pnr_map;
...
for (i=0; i < 2*old_nr; i++) {
      change_point[i] = &change_point_list[i];
...
}

After the loop, change_point is not completely filled-up, as change_point [254] and change_point [255]
are never filled nor used.

Is it voluntary that pnr_map gets typed and used like this?

Armand


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>