[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] gcc4isms part 1


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxxx
  • From: Rik van Riel <riel@xxxxxxxxxx>
  • Date: Fri, 4 Mar 2005 13:12:23 -0500 (EST)
  • Delivery-date: Fri, 04 Mar 2005 18:20:53 +0000
  • List-id: List for Xen developers <xen-devel.lists.sourceforge.net>

This patch gets rid of the compile warnings under the xen/
subdirectory, for an x86_32 compile.  The cpuid change has
also been sent to the upstream kernel.

I am not quite sure about the vmx_platform.c bits, since
__s8 should be the same as char, so gcc really shouldn't
warn...

Signed-off-by: Rik van Riel <riel@xxxxxxxxxx>

 arch/x86/acpi.c             |    2 +-
 arch/x86/domain_build.c     |    2 +-
 arch/x86/pci-pc.c           |    4 ++--
 arch/x86/setup.c            |   16 ++++++++--------
 arch/x86/vmx.c              |    2 +-
 arch/x86/vmx_platform.c     |   20 ++++++++++----------
 common/kernel.c             |    2 +-
 drivers/char/console.c      |    4 ++--
 drivers/char/serial.c       |    4 ++--
 include/asm-x86/processor.h |    2 +-
 include/public/xen.h        |    2 +-
 include/xen/serial.h        |    2 +-
 12 files changed, 31 insertions(+), 31 deletions(-)

--- xen-unstable/xen/include/public/xen.h.gcc4  2005-03-03 16:15:03.000000000 
-0500
+++ xen-unstable/xen/include/public/xen.h       2005-03-03 16:15:42.000000000 
-0500
@@ -428,7 +428,7 @@
     _MEMORY_PADDING(F);
     memory_t mod_len;         /* 56: Size (bytes) of pre-loaded module.    */
     _MEMORY_PADDING(G);
-    u8 cmd_line[MAX_CMDLINE]; /* 64 */
+    s8 cmd_line[MAX_CMDLINE]; /* 64 */
 } PACKED start_info_t; /* 320 bytes */
 
 /* These flags are passed in the 'flags' field of start_info_t. */
--- xen-unstable/xen/include/asm-x86/processor.h.gcc4   2005-03-03 
13:44:27.000000000 -0500
+++ xen-unstable/xen/include/asm-x86/processor.h        2005-03-03 
13:46:13.000000000 -0500
@@ -192,7 +192,7 @@
 /*
  * Generic CPUID function
  */
-static inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx)
+static inline void cpuid(int op, unsigned int *eax, unsigned int *ebx, 
unsigned int *ecx, unsigned int *edx)
 {
     __asm__("cpuid"
             : "=a" (*eax),
--- xen-unstable/xen/include/xen/serial.h.gcc4  2005-03-03 13:56:49.000000000 
-0500
+++ xen-unstable/xen/include/xen/serial.h       2005-03-03 13:57:26.000000000 
-0500
@@ -35,7 +35,7 @@
 void serial_putc(int handle, unsigned char c);
 
 /* Transmit a NULL-terminated string via the specified COM port. */
-void serial_puts(int handle, const unsigned char *s);
+void serial_puts(int handle, const char *s);
 
 /*
  * An alternative to registering a character-receive hook. This function
--- xen-unstable/xen/drivers/char/serial.c.gcc4 2005-03-03 13:58:24.000000000 
-0500
+++ xen-unstable/xen/drivers/char/serial.c      2005-03-03 13:56:18.000000000 
-0500
@@ -18,7 +18,7 @@
 #include <asm/io.h>
 
 /* Config serial port with a string <baud>,DPS,<io-base>,<irq>. */
-static unsigned char opt_com1[30] = OPT_COM1_STR, opt_com2[30] = OPT_COM2_STR;
+static char opt_com1[30] = OPT_COM1_STR, opt_com2[30] = OPT_COM2_STR;
 string_param("com1", opt_com1);
 string_param("com2", opt_com2);
 
@@ -395,7 +395,7 @@
     __serial_putc(uart, handle, c);
 }
 
-void serial_puts(int handle, const unsigned char *s)
+void serial_puts(int handle, const char *s)
 {
     struct uart *uart = &com[handle & SERHND_IDX];
 
--- xen-unstable/xen/drivers/char/console.c.gcc4        2005-03-03 
14:05:12.000000000 -0500
+++ xen-unstable/xen/drivers/char/console.c     2005-03-03 14:05:38.000000000 
-0500
@@ -22,7 +22,7 @@
 #include <asm/debugger.h>
 
 /* opt_console: comma-separated list of console outputs. */
-static unsigned char opt_console[30] = OPT_CONSOLE_STR;
+static char opt_console[30] = OPT_CONSOLE_STR;
 string_param("console", opt_console);
 
 /* opt_conswitch: a character pair controlling console switching. */
@@ -408,7 +408,7 @@
 
 void init_console(void)
 {
-    unsigned char *p;
+    char *p;
 
     /* Where should console output go? */
     for ( p = opt_console; p != NULL; p = strchr(p, ',') )
--- xen-unstable/xen/common/kernel.c.gcc4       2005-03-03 16:18:59.000000000 
-0500
+++ xen-unstable/xen/common/kernel.c    2005-03-03 16:20:03.000000000 -0500
@@ -16,7 +16,7 @@
 
 void cmdline_parse(char *cmdline)
 {
-    unsigned char *opt_end, *opt;
+    char *opt_end, *opt;
     struct kernel_param *param;
     
     if ( cmdline == NULL )
--- xen-unstable/xen/arch/x86/acpi.c.gcc4       2005-03-03 16:24:29.000000000 
-0500
+++ xen-unstable/xen/arch/x86/acpi.c    2005-03-03 16:24:40.000000000 -0500
@@ -97,7 +97,7 @@
                mapped_size += PAGE_SIZE;
        }
 
-       return ((unsigned char *) base + offset);
+       return ((char *) base + offset);
 }
 
 
--- xen-unstable/xen/arch/x86/domain_build.c.gcc4       2005-03-03 
16:27:00.000000000 -0500
+++ xen-unstable/xen/arch/x86/domain_build.c    2005-03-03 16:27:37.000000000 
-0500
@@ -481,7 +481,7 @@
                si->mod_len, si->mod_start);
     }
 
-    dst = si->cmd_line;
+    dst = (char *)si->cmd_line;
     if ( cmdline != NULL )
     {
         for ( i = 0; i < 255; i++ )
--- xen-unstable/xen/arch/x86/pci-pc.c.gcc4     2005-03-03 16:30:11.000000000 
-0500
+++ xen-unstable/xen/arch/x86/pci-pc.c  2005-03-03 16:44:44.000000000 -0500
@@ -816,7 +816,7 @@
 static int pci_bios_read_config_byte(struct pci_dev *dev, int where, u8 *value)
 {
        int result; 
-       u32 data;
+       u32 data = 0;
 
        if (!value) 
                BUG();
@@ -832,7 +832,7 @@
 static int pci_bios_read_config_word(struct pci_dev *dev, int where, u16 
*value)
 {
        int result; 
-       u32 data;
+       u32 data = 0;
 
        if (!value) 
                BUG();
--- xen-unstable/xen/arch/x86/setup.c.gcc4      2005-03-03 16:47:28.000000000 
-0500
+++ xen-unstable/xen/arch/x86/setup.c   2005-03-03 16:59:49.000000000 -0500
@@ -201,8 +201,8 @@
  */
 void __init identify_cpu(struct cpuinfo_x86 *c)
 {
-    int junk, i, cpu = smp_processor_id();
-    u32 xlvl, tfms;
+    int i, cpu = smp_processor_id();
+    u32 xlvl, tfms, junk;
 
     phys_proc_id[cpu]    = cpu;
     logical_proc_id[cpu] = 0;
@@ -218,10 +218,10 @@
         panic("Ancient processors not supported\n");
 
     /* Get vendor name */
-    cpuid(0x00000000, &c->cpuid_level,
-          (int *)&c->x86_vendor_id[0],
-          (int *)&c->x86_vendor_id[8],
-          (int *)&c->x86_vendor_id[4]);
+    cpuid(0x00000000, (unsigned int *)&c->cpuid_level,
+          (unsigned int *)&c->x86_vendor_id[0],
+          (unsigned int *)&c->x86_vendor_id[8],
+          (unsigned int *)&c->x86_vendor_id[4]);
 
     get_cpu_vendor(c);
                
@@ -455,7 +455,7 @@
 
 void __init __start_xen(multiboot_info_t *mbi)
 {
-    unsigned char *cmdline;
+    char *cmdline;
     module_t *mod = (module_t *)__va(mbi->mods_addr);
     void *heap_start;
     unsigned long firsthole_start, nr_pages;
@@ -587,7 +587,7 @@
     set_bit(DF_PRIVILEGED, &dom0->d_flags);
 
     /* Grab the DOM0 command line. Skip past the image name. */
-    cmdline = (unsigned char *)(mod[0].string ? __va(mod[0].string) : NULL);
+    cmdline = (char *)(mod[0].string ? __va(mod[0].string) : NULL);
     if ( cmdline != NULL )
     {
         while ( *cmdline == ' ' ) cmdline++;
--- xen-unstable/xen/arch/x86/vmx.c.gcc4        2005-03-03 17:25:37.000000000 
-0500
+++ xen-unstable/xen/arch/x86/vmx.c     2005-03-03 17:26:40.000000000 -0500
@@ -178,7 +178,7 @@
 
 static void vmx_vmexit_do_cpuid(unsigned long input, struct xen_regs *regs) 
 {
-    int eax, ebx, ecx, edx;
+    unsigned int eax, ebx, ecx, edx;
     unsigned long eip;
 
     __vmread(GUEST_EIP, &eip);
--- xen-unstable/xen/arch/x86/vmx_platform.c.gcc4       2005-03-03 
17:29:21.000000000 -0500
+++ xen-unstable/xen/arch/x86/vmx_platform.c    2005-03-04 13:02:35.000000000 
-0500
@@ -290,7 +290,7 @@
         case 0xa4:
             /* movsb */
             thread_inst->op_size = BYTE;
-            strcpy(thread_inst->i_name, "movs");
+            strcpy((char *)thread_inst->i_name, "movs");
             
             return DECODE_success;
         case 0xa5:
@@ -300,7 +300,7 @@
                 thread_inst->op_size = LONG;
             }
             
-            strcpy(thread_inst->i_name, "movs");
+            strcpy((char *)thread_inst->i_name, "movs");
             
             return DECODE_success;
 
@@ -328,7 +328,7 @@
             return DECODE_failure;
     }
     
-    strcpy(thread_inst->i_name, "mov");
+    strcpy((char *)thread_inst->i_name, "mov");
     if (*inst != 0x0f) {
         return DECODE_success;
     }
@@ -346,14 +346,14 @@
                 
             }
             thread_inst->op_size = BYTE;
-            strcpy(thread_inst->i_name, "movzb");
+            strcpy((char *)thread_inst->i_name, "movzb");
             
             return DECODE_success;
         case 0xb7:
             thread_inst->op_size = WORD;
             index = get_index((inst + 1));
             thread_inst->operand[1] = mk_operand(LONG, index, 0, REGISTER);
-            strcpy(thread_inst->i_name, "movzw");
+            strcpy((char *)thread_inst->i_name, "movzw");
             
             return DECODE_success;
         default:
@@ -365,7 +365,7 @@
     return DECODE_failure;
 }
 
-static int inst_copy_from_guest(char *buf, unsigned long guest_eip, int 
inst_len)
+static int inst_copy_from_guest(unsigned char *buf, unsigned long guest_eip, 
int inst_len)
 {
     unsigned long gpte;
     unsigned long mfn;
@@ -382,7 +382,7 @@
         ma = (mfn << PAGE_SHIFT) | (guest_eip & (PAGE_SIZE - 1));
         inst_start = (unsigned char *)map_domain_mem(ma);
                 
-        memcpy(buf, inst_start, inst_len);
+        memcpy((char *)buf, inst_start, inst_len);
         unmap_domain_mem(inst_start);
     } else {
         // Todo: In two page frames
@@ -502,7 +502,7 @@
     store_xen_regs(inst_decoder_regs);
 
     // Only handle "mov" and "movs" instructions!
-    if (!strncmp(mmio_inst.i_name, "movz", 4)) {
+    if (!strncmp((char *)mmio_inst.i_name, "movz", 4)) {
         if (read_from_mmio(&mmio_inst)) {
             // Send the request and waiting for return value.
             mpci_p->mmio_target = mmio_inst.operand[1] | WZEROEXTEND;
@@ -514,7 +514,7 @@
         }
     }
 
-    if (!strncmp(mmio_inst.i_name, "movs", 4)) {
+    if (!strncmp((char *)mmio_inst.i_name, "movs", 4)) {
         int tmp_dir;
 
         tmp_dir = ((va == inst_decoder_regs->edi) ? IOREQ_WRITE : IOREQ_READ);
@@ -522,7 +522,7 @@
         return;
     }
 
-    if (!strncmp(mmio_inst.i_name, "mov", 3)) {
+    if (!strncmp((char *)mmio_inst.i_name, "mov", 3)) {
         long value = 0;
         int size, index;
 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.