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] mini-os: C programming

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] mini-os: C programming
From: PUCCETTI Armand <armand.puccetti@xxxxxx>
Date: Thu, 15 Mar 2007 14:39:21 +0100
Delivery-date: Thu, 15 Mar 2007 06:38:09 -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.9 (X11/20070103)
2 questions on the code of mini-os (the one in XEN 3.0.3):



1. In xen-3.0.3/extras/mini-os/mm.c:52 is a declaration of stack

extern char *stack;

but in file xen-3.0.3/extras/mini-os/arch/x86/setup.c:48, there is also a decl of stack:

char stack[8192];

If one dereferences the variable stack, which is apparently not the case yet, it gives surely a segfault!


2. In file xen-3.0.3/extras/mini-os/gnttab.c:140: the const variable gnttabop_error_msgs
is declared as

static const char *gnttabop_error_msgs[] = GNTTABOP_error_msgs;

shouldn't that instead be declared:

static const char * const gnttabop_error_msgs[] = GNTTABOP_error_msgs;
?
(BTW, even the first const is useless as there are consts in GNTTABOP_error_msgs)

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

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