Source-Changes-HG archive

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

[src/trunk]: src/sys fix build errors with gcc 4.5.



details:   https://anonhg.NetBSD.org/src/rev/c36b7104dbdb
branches:  trunk
changeset: 770035:c36b7104dbdb
user:      chs <chs%NetBSD.org@localhost>
date:      Sat Oct 01 15:59:00 2011 +0000

description:
fix build errors with gcc 4.5.

diffstat:

 sys/arch/atari/include/disklabel.h             |   6 +++---
 sys/arch/atari/stand/edahdi/edahdi.c           |   8 +++++---
 sys/arch/atari/stand/installboot/disklabel.c   |  11 +++++++----
 sys/arch/atari/stand/tostools/aptck/ahdilbl.h  |   6 +++---
 sys/arch/atari/stand/tostools/libtos/ahdilbl.h |   6 +++---
 sys/arch/atari/stand/tostools/libtos/elf.c     |   7 ++++---
 sys/arch/atari/vme/if_we_vme.c                 |   6 +++---
 sys/arch/ia64/conf/files.ia64                  |   5 ++++-
 sys/arch/ia64/ia64/cpu.c                       |   5 +++--
 sys/arch/ia64/ia64/exception.S                 |   3 +--
 sys/arch/ia64/ia64/genassym.cf                 |   7 ++++++-
 sys/arch/ia64/ia64/interrupt.c                 |   5 +++--
 sys/arch/ia64/ia64/locore.S                    |   9 ++++-----
 sys/arch/ia64/ia64/machdep.c                   |   3 ++-
 sys/arch/ia64/ia64/sal.c                       |   8 +++++---
 sys/arch/ia64/include/cpu.h                    |  15 +++++++++++----
 sys/arch/ia64/include/param.h                  |   8 ++++++--
 sys/arch/ia64/include/types.h                  |   3 ++-
 sys/arch/next68k/next68k/nextrom.c             |   8 ++++----
 sys/arch/x68k/stand/mboot/mboot.c              |   6 ++++--
 sys/dev/ic/clmpcc.c                            |   8 ++++----
 21 files changed, 87 insertions(+), 56 deletions(-)

diffs (truncated from 571 to 300 lines):

diff -r 0e3d8a37db14 -r c36b7104dbdb sys/arch/atari/include/disklabel.h
--- a/sys/arch/atari/include/disklabel.h        Sat Oct 01 15:51:36 2011 +0000
+++ b/sys/arch/atari/include/disklabel.h        Sat Oct 01 15:59:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disklabel.h,v 1.9 2011/08/30 12:39:53 bouyer Exp $     */
+/*     $NetBSD: disklabel.h,v 1.10 2011/10/01 15:59:00 chs Exp $       */
 
 /*
  * Copyright (c) 1995 Leo Weppelman.
@@ -71,7 +71,7 @@
 };
 
 struct disklabel;
-#define        BBGETLABEL(bb, dl)      *(dl) = *((struct disklabel *)(bb)->bb_label)
-#define        BBSETLABEL(bb, dl)      *((struct disklabel *)(bb)->bb_label) = *(dl)
+#define        BBGETLABEL(bb, dl)      memcpy((dl), (bb)->bb_label, sizeof (struct disklabel))
+#define        BBSETLABEL(bb, dl)      memcpy((bb)->bb_label, (dl), sizeof (struct disklabel))
 
 #endif /* _MACHINE_DISKLABEL_H_ */
diff -r 0e3d8a37db14 -r c36b7104dbdb sys/arch/atari/stand/edahdi/edahdi.c
--- a/sys/arch/atari/stand/edahdi/edahdi.c      Sat Oct 01 15:51:36 2011 +0000
+++ b/sys/arch/atari/stand/edahdi/edahdi.c      Sat Oct 01 15:59:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: edahdi.c,v 1.10 2010/02/10 14:48:26 roy Exp $  */
+/*     $NetBSD: edahdi.c,v 1.11 2011/10/01 15:59:00 chs Exp $  */
 
 /*
  * Copyright (c) 1996 Leo Weppelman, Waldi Ravens.
@@ -413,7 +413,9 @@
                end = &root->ar_parts[AHDI_MAXRPD];
        else end = &root->ar_parts[AHDI_MAXARPD];
        for (part = root->ar_parts; part < end; ++part) {
-               u_int   id = *((u_int32_t *)&part->ap_flg);
+               u_int   id;
+
+               memcpy(&id, &part->ap_flg, sizeof (id));
                if (!(id & 0x01000000))
                        continue;
                if ((id &= 0x00ffffff) == AHDI_PID_XGM) {
@@ -433,7 +435,7 @@
                                goto done;
                        }
                        p = &ptable->parts[--i];
-                       *((u_int32_t *)&p->id) = id << 8;
+                       memcpy(&p->id, &id, sizeof (id));
                        p->start = part->ap_st + rsec;
                        p->end   = p->start + part->ap_size - 1;
                        p->rsec  = rsec;
diff -r 0e3d8a37db14 -r c36b7104dbdb sys/arch/atari/stand/installboot/disklabel.c
--- a/sys/arch/atari/stand/installboot/disklabel.c      Sat Oct 01 15:51:36 2011 +0000
+++ b/sys/arch/atari/stand/installboot/disklabel.c      Sat Oct 01 15:59:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disklabel.c,v 1.5 2009/03/14 21:04:07 dsl Exp $        */
+/*     $NetBSD: disklabel.c,v 1.6 2011/10/01 15:59:00 chs Exp $        */
 
 /*
  * Copyright (c) 1995 Waldi Ravens
@@ -173,8 +173,9 @@
         */
        for (i = 0; i < al.nparts; ++i) {
                struct ahdi_part *pd = &al.parts[i];
-               u_int id = *((u_int32_t *)&pd->ap_flg);
+               u_int id;
 
+               memcpy(&id, &pd->ap_flg, sizeof (id));
                if (id == AHDI_PID_NBD || id == AHDI_PID_RAW) {
                        off_t   offs = pd->ap_st * AHDI_BSIZE;
                        if ((e = bsd_label(fd, offs, label)) < 0)
@@ -214,7 +215,9 @@
                end = &root.ar_parts[AHDI_MAXRPD];
        else end = &root.ar_parts[AHDI_MAXARPD];
        for (part = root.ar_parts; part < end; ++part) {
-               u_int   id = *((u_int32_t *)&part->ap_flg);
+               u_int   id;
+
+               memcpy(&id, &part->ap_flg, sizeof (id));
                if (!(id & 0x01000000))
                        continue;
                if ((id &= 0x00ffffff) == AHDI_PID_XGM) {
@@ -232,7 +235,7 @@
                        alab->parts = realloc(alab->parts,
                                        (alab->nparts + 1) * sizeof(*alab->parts));
                        p = &alab->parts[alab->nparts++];
-                       *((u_int32_t *)&p->ap_flg) = id;
+                       memcpy(&p->ap_flg, &id, sizeof (id));
                        p->ap_st = part->ap_st + rsec;
                        p->ap_end  = p->ap_st + part->ap_size - 1;
                }
diff -r 0e3d8a37db14 -r c36b7104dbdb sys/arch/atari/stand/tostools/aptck/ahdilbl.h
--- a/sys/arch/atari/stand/tostools/aptck/ahdilbl.h     Sat Oct 01 15:51:36 2011 +0000
+++ b/sys/arch/atari/stand/tostools/aptck/ahdilbl.h     Sat Oct 01 15:59:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahdilbl.h,v 1.4 2009/10/20 19:10:11 snj Exp $  */
+/*     $NetBSD: ahdilbl.h,v 1.5 2011/10/01 15:59:00 chs Exp $  */
 
 /*
  * Copyright (c) 1995 Leo Weppelman.
@@ -60,8 +60,8 @@
                                                /* second-stage boot loader*/
 };
 
-#define        BBGETLABEL(bb, dl)      *(dl) = *((struct disklabel *)(bb)->bb_label)
-#define        BBSETLABEL(bb, dl)      *((struct disklabel *)(bb)->bb_label) = *(dl)
+#define BBGETLABEL(bb, dl)     memcpy((dl), (bb)->bb_label, sizeof (struct disklabel))
+#define BBSETLABEL(bb, dl)     memcpy((bb)->bb_label, (dl), sizeof (struct disklabel))
 
 /***** from src/sys/arch/atari/include/ahdilabel.h *************************/
 
diff -r 0e3d8a37db14 -r c36b7104dbdb sys/arch/atari/stand/tostools/libtos/ahdilbl.h
--- a/sys/arch/atari/stand/tostools/libtos/ahdilbl.h    Sat Oct 01 15:51:36 2011 +0000
+++ b/sys/arch/atari/stand/tostools/libtos/ahdilbl.h    Sat Oct 01 15:59:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahdilbl.h,v 1.3 2009/10/20 19:10:11 snj Exp $  */
+/*     $NetBSD: ahdilbl.h,v 1.4 2011/10/01 15:59:00 chs Exp $  */
 
 /*
  * Copyright (c) 1995 Leo Weppelman.
@@ -60,8 +60,8 @@
                                                /* second-stage boot loader*/
 };
 
-#define        BBGETLABEL(bb, dl)      *(dl) = *((struct disklabel *)(bb)->bb_label)
-#define        BBSETLABEL(bb, dl)      *((struct disklabel *)(bb)->bb_label) = *(dl)
+#define BBGETLABEL(bb, dl)     memcpy((dl), (bb)->bb_label, sizeof (struct disklabel))
+#define BBSETLABEL(bb, dl)     memcpy((bb)->bb_label, (dl), sizeof (struct disklabel))
 
 /***** from src/sys/arch/atari/include/ahdilabel.h *************************/
 
diff -r 0e3d8a37db14 -r c36b7104dbdb sys/arch/atari/stand/tostools/libtos/elf.c
--- a/sys/arch/atari/stand/tostools/libtos/elf.c        Sat Oct 01 15:51:36 2011 +0000
+++ b/sys/arch/atari/stand/tostools/libtos/elf.c        Sat Oct 01 15:59:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: elf.c,v 1.13 2009/03/31 11:48:15 tsutsui Exp $ */
+/*     $NetBSD: elf.c,v 1.14 2011/10/01 15:59:00 chs Exp $     */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
        int             err;
        Elf32_Ehdr      ehdr;
        Elf32_Phdr      *phdrs;
-       Elf32_Word      symsize, symstart;
+       Elf32_Word      ident, symsize, symstart;
        long            kernsize;
 
        *errp = NULL;
@@ -79,7 +79,8 @@
        if (read(fd, (char *)&ehdr, sizeof(ehdr)) != sizeof(ehdr))
                return -1;
 
-       if (*((u_int *)ehdr.e_ident) != ELFMAGIC)
+       memcpy(&ident, ehdr.e_ident, sizeof ident);
+       if (ident != ELFMAGIC)
                return -1;
 
        /*
diff -r 0e3d8a37db14 -r c36b7104dbdb sys/arch/atari/vme/if_we_vme.c
--- a/sys/arch/atari/vme/if_we_vme.c    Sat Oct 01 15:51:36 2011 +0000
+++ b/sys/arch/atari/vme/if_we_vme.c    Sat Oct 01 15:59:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_we_vme.c,v 1.2 2010/03/16 18:50:14 tsutsui Exp $    */
+/*     $NetBSD: if_we_vme.c,v 1.3 2011/10/01 15:59:01 chs Exp $        */
 
 /*-
  * Copyright (c) 1997, 1998, 2010 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_we_vme.c,v 1.2 2010/03/16 18:50:14 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_we_vme.c,v 1.3 2011/10/01 15:59:01 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -132,7 +132,7 @@
        struct atari_bus_space t;
        bus_space_tag_t asict, memt;
        bus_space_handle_t asich, asich1, memh;
-       bus_size_t memsize;
+       bus_size_t memsize = 0;
        bool asich_valid, asich1_valid, memh_valid;
        int i, rv;
        uint8_t sum, reg, type, hwr;
diff -r 0e3d8a37db14 -r c36b7104dbdb sys/arch/ia64/conf/files.ia64
--- a/sys/arch/ia64/conf/files.ia64     Sat Oct 01 15:51:36 2011 +0000
+++ b/sys/arch/ia64/conf/files.ia64     Sat Oct 01 15:59:00 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.ia64,v 1.6 2011/06/12 03:35:42 rmind Exp $
+#      $NetBSD: files.ia64,v 1.7 2011/10/01 15:59:27 chs Exp $
 #
 # new style config file for ia64 architecture
 #
@@ -73,6 +73,9 @@
 defpseudo ssccons
 file   arch/ia64/ia64/ssc.c            ssccons                 needs-flag
 
+include        "dev/i2o/files.i2o"
+include        "dev/pci/files.pci"
+include "dev/pci/files.agp"
 
 include "dev/isa/files.isa"            # XXXXXXX: Oops, required by acpi
 include "dev/apm/files.apm"            # XXXXXXX: Oops, required by acpi
diff -r 0e3d8a37db14 -r c36b7104dbdb sys/arch/ia64/ia64/cpu.c
--- a/sys/arch/ia64/ia64/cpu.c  Sat Oct 01 15:51:36 2011 +0000
+++ b/sys/arch/ia64/ia64/cpu.c  Sat Oct 01 15:59:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.9 2010/06/28 12:08:13 kiyohara Exp $ */
+/*     $NetBSD: cpu.c,v 1.10 2011/10/01 15:59:27 chs Exp $     */
 
 /*
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.9 2010/06/28 12:08:13 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.10 2011/10/01 15:59:27 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -45,6 +45,7 @@
 #define GHz    (1000L * MHz)
 
 struct cpu_info cpu_info_primary __aligned(CACHE_LINE_SIZE);
+struct cpu_info *cpu_info_list = &cpu_info_primary;
 
 struct cpu_softc {
        device_t sc_dev;                /* device tree glue */
diff -r 0e3d8a37db14 -r c36b7104dbdb sys/arch/ia64/ia64/exception.S
--- a/sys/arch/ia64/ia64/exception.S    Sat Oct 01 15:51:36 2011 +0000
+++ b/sys/arch/ia64/ia64/exception.S    Sat Oct 01 15:59:00 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exception.S,v 1.4 2009/07/20 04:41:37 kiyohara Exp $ */
+/*     $NetBSD: exception.S,v 1.5 2011/10/01 15:59:27 chs Exp $ */
 
 /*-
  * Copyright (c) 2003,2004 Marcel Moolenaar
@@ -29,7 +29,6 @@
 
 #include <machine/asm.h>
 #include <machine/pte.h>
-#include <machine/vmparam.h>
 
 #include "assym.h"
        
diff -r 0e3d8a37db14 -r c36b7104dbdb sys/arch/ia64/ia64/genassym.cf
--- a/sys/arch/ia64/ia64/genassym.cf    Sat Oct 01 15:51:36 2011 +0000
+++ b/sys/arch/ia64/ia64/genassym.cf    Sat Oct 01 15:59:00 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: genassym.cf,v 1.9 2010/12/20 00:25:35 matt Exp $
+#      $NetBSD: genassym.cf,v 1.10 2011/10/01 15:59:28 chs Exp $
 
 #
 # Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -90,6 +90,7 @@
 include <machine/intr.h>
 include <machine/frame.h>
 include <machine/types.h>
+include <machine/pcb.h>
 
 ifdef COMPAT_LINUX
 include <compat/linux/common/linux_signal.h>
@@ -108,6 +109,10 @@
 include <machine/cpu.h>
 endif
 
+define PAGE_SIZE               PAGE_SIZE
+define PAGE_SHIFT              PAGE_SHIFT
+define KSTACK_PAGES            KSTACK_PAGES
+
 define DT_NULL                 DT_NULL
 define DT_RELA                 DT_RELA
 define DT_RELAENT              DT_RELAENT
diff -r 0e3d8a37db14 -r c36b7104dbdb sys/arch/ia64/ia64/interrupt.c
--- a/sys/arch/ia64/ia64/interrupt.c    Sat Oct 01 15:51:36 2011 +0000
+++ b/sys/arch/ia64/ia64/interrupt.c    Sat Oct 01 15:59:00 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: interrupt.c,v 1.5 2010/12/20 00:25:35 matt Exp $ */
+/* $NetBSD: interrupt.c,v 1.6 2011/10/01 15:59:28 chs Exp $ */
 
 /*-
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -33,13 +33,14 @@
  */
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.5 2010/12/20 00:25:35 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.6 2011/10/01 15:59:28 chs Exp $");
 
 #include "opt_ddb.h"
 
 #include <sys/param.h>
 #include <sys/evcnt.h>
 #include <sys/lwp.h>
+#include <sys/proc.h>
 #include <sys/malloc.h>
 #include <sys/sched.h>
 
diff -r 0e3d8a37db14 -r c36b7104dbdb sys/arch/ia64/ia64/locore.S
--- a/sys/arch/ia64/ia64/locore.S       Sat Oct 01 15:51:36 2011 +0000



Home | Main Index | Thread Index | Old Index