WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] e820.c : why char* ?

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] e820.c : why char* ?
From: PUCCETTI Armand <armand.puccetti@xxxxxx>
Date: Fri, 23 Jun 2006 18:09:51 +0200
Delivery-date: Fri, 23 Jun 2006 09:10:34 -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>
  • [Xen-devel] e820.c : why char* ?, PUCCETTI Armand <=