Module Name: src
Committed By: mrg
Date: Wed Nov 6 06:23:15 UTC 2013
Modified Files:
src/sys/arch/amd64/amd64: machdep.c
src/sys/arch/xen/x86: mainbus.c x86_xpmap.c
src/sys/arch/xen/xen: privcmd.c xbd_xenbus.c xbdback_xenbus.c
Log Message:
- move variables inside their #ifdef use
- remove unused and set-but-unused variables
- use __USE() in a particularly ugly case
with these, and a couple of other changes, amd64 gcc 4.8.1 world
is able to complete build.sh release.
To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/xen/x86/mainbus.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/xen/x86/x86_xpmap.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/xen/xen/privcmd.c
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/xen/xen/xbd_xenbus.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/xen/xen/xbdback_xenbus.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.197 src/sys/arch/amd64/amd64/machdep.c:1.198
--- src/sys/arch/amd64/amd64/machdep.c:1.197 Wed Oct 23 20:18:50 2013
+++ src/sys/arch/amd64/amd64/machdep.c Wed Nov 6 06:23:15 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.197 2013/10/23 20:18:50 drochner Exp $ */
+/* $NetBSD: machdep.c,v 1.198 2013/11/06 06:23:15 mrg Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -111,7 +111,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.197 2013/10/23 20:18:50 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.198 2013/11/06 06:23:15 mrg Exp $");
/* #define XENDEBUG_LOW */
@@ -649,6 +649,7 @@ cpu_reboot(int howto, char *bootstr)
{
static bool syncdone = false;
int s = IPL_NONE;
+ __USE(s); /* ugly otherwise */
if (cold) {
howto |= RB_HALT;
Index: src/sys/arch/xen/x86/mainbus.c
diff -u src/sys/arch/xen/x86/mainbus.c:1.15 src/sys/arch/xen/x86/mainbus.c:1.16
--- src/sys/arch/xen/x86/mainbus.c:1.15 Tue Sep 20 00:12:24 2011
+++ src/sys/arch/xen/x86/mainbus.c Wed Nov 6 06:23:15 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: mainbus.c,v 1.15 2011/09/20 00:12:24 jym Exp $ */
+/* $NetBSD: mainbus.c,v 1.16 2013/11/06 06:23:15 mrg Exp $ */
/* NetBSD: mainbus.c,v 1.53 2003/10/27 14:11:47 junyoung Exp */
/*
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.15 2011/09/20 00:12:24 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.16 2013/11/06 06:23:15 mrg Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -133,7 +133,7 @@ mainbus_match(device_t parent, cfdata_t
void
mainbus_attach(device_t parent, device_t self, void *aux)
{
-#if defined(DOM0OPS) && NPCI > 0
+#if defined(DOM0OPS) && NPCI > 0 && defined(PCI_BUS_FIXUP)
int mode;
#endif
union mainbus_attach_args mba;
@@ -157,8 +157,8 @@ mainbus_attach(device_t parent, device_t
#endif
#if NPCI > 0
/* ACPI needs to be able to access PCI configuration space. */
- mode = pci_mode_detect();
#ifdef PCI_BUS_FIXUP
+ mode = pci_mode_detect();
if (mode != 0) {
pci_maxbus = pci_bus_fixup(NULL, 0);
aprint_debug_dev(self, "PCI bus max, after "
Index: src/sys/arch/xen/x86/x86_xpmap.c
diff -u src/sys/arch/xen/x86/x86_xpmap.c:1.49 src/sys/arch/xen/x86/x86_xpmap.c:1.50
--- src/sys/arch/xen/x86/x86_xpmap.c:1.49 Sun Sep 16 22:09:34 2012
+++ src/sys/arch/xen/x86/x86_xpmap.c Wed Nov 6 06:23:15 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: x86_xpmap.c,v 1.49 2012/09/16 22:09:34 rmind Exp $ */
+/* $NetBSD: x86_xpmap.c,v 1.50 2013/11/06 06:23:15 mrg Exp $ */
/*
* Copyright (c) 2006 Mathieu Ropert <[email protected]>
@@ -69,7 +69,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.49 2012/09/16 22:09:34 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.50 2013/11/06 06:23:15 mrg Exp $");
#include "opt_xen.h"
#include "opt_ddb.h"
@@ -701,7 +701,7 @@ xen_bootstrap_tables (vaddr_t old_pgd, v
int old_count, int new_count, int final)
{
pd_entry_t *pdtpe, *pde, *pte;
- pd_entry_t *cur_pgd, *bt_pgd;
+ pd_entry_t *bt_pgd;
paddr_t addr;
vaddr_t page, avail, text_end, map_end;
int i;
@@ -761,7 +761,6 @@ xen_bootstrap_tables (vaddr_t old_pgd, v
* - some PTEs (level 1)
*/
- cur_pgd = (pd_entry_t *) old_pgd;
bt_pgd = (pd_entry_t *) new_pgd;
memset (bt_pgd, 0, PAGE_SIZE);
avail = new_pgd + PAGE_SIZE;
Index: src/sys/arch/xen/xen/privcmd.c
diff -u src/sys/arch/xen/xen/privcmd.c:1.44 src/sys/arch/xen/xen/privcmd.c:1.45
--- src/sys/arch/xen/xen/privcmd.c:1.44 Wed Jun 27 00:37:10 2012
+++ src/sys/arch/xen/xen/privcmd.c Wed Nov 6 06:23:15 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: privcmd.c,v 1.44 2012/06/27 00:37:10 jym Exp $ */
+/* $NetBSD: privcmd.c,v 1.45 2013/11/06 06:23:15 mrg Exp $ */
/*-
* Copyright (c) 2004 Christian Limpach.
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: privcmd.c,v 1.44 2012/06/27 00:37:10 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: privcmd.c,v 1.45 2013/11/06 06:23:15 mrg Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -369,17 +369,15 @@ privcmd_ioctl(void *v)
{
int i;
privcmd_mmapbatch_t* pmb = ap->a_data;
- vaddr_t va0, va;
+ vaddr_t va0;
u_long mfn;
paddr_t ma;
struct vm_map *vmm;
struct vm_map_entry *entry;
vm_prot_t prot;
- pmap_t pmap;
vaddr_t trymap;
vmm = &curlwp->l_proc->p_vmspace->vm_map;
- pmap = vm_map_pmap(vmm);
va0 = pmb->addr & ~PAGE_MASK;
if (pmb->num == 0)
@@ -409,7 +407,6 @@ privcmd_ioctl(void *v)
}
for(i = 0; i < pmb->num; ++i) {
- va = va0 + (i * PAGE_SIZE);
error = copyin(&pmb->arr[i], &mfn, sizeof(mfn));
if (error != 0) {
/* XXX: mappings */
Index: src/sys/arch/xen/xen/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.60 src/sys/arch/xen/xen/xbd_xenbus.c:1.61
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.60 Sun Oct 13 06:55:34 2013
+++ src/sys/arch/xen/xen/xbd_xenbus.c Wed Nov 6 06:23:15 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: xbd_xenbus.c,v 1.60 2013/10/13 06:55:34 riz Exp $ */
+/* $NetBSD: xbd_xenbus.c,v 1.61 2013/11/06 06:23:15 mrg Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.60 2013/10/13 06:55:34 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.61 2013/11/06 06:23:15 mrg Exp $");
#include "opt_xen.h"
@@ -821,7 +821,6 @@ xbdioctl(dev_t dev, u_long cmd, void *da
device_lookup_private(&xbd_cd, DISKUNIT(dev));
struct dk_softc *dksc;
int error;
- struct disk *dk;
int s;
struct xbd_req *xbdreq;
blkif_request_t *req;
@@ -830,7 +829,6 @@ xbdioctl(dev_t dev, u_long cmd, void *da
DPRINTF(("xbdioctl(%d, %08lx, %p, %d, %p)\n",
dev, cmd, data, flag, l));
dksc = &sc->sc_dksc;
- dk = &dksc->sc_dkdev;
error = disk_ioctl(&sc->sc_dksc.sc_dkdev, cmd, data, flag, l);
if (error != EPASSTHROUGH)
Index: src/sys/arch/xen/xen/xbdback_xenbus.c
diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.58 src/sys/arch/xen/xen/xbdback_xenbus.c:1.59
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.58 Sun Oct 20 11:37:11 2013
+++ src/sys/arch/xen/xen/xbdback_xenbus.c Wed Nov 6 06:23:15 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: xbdback_xenbus.c,v 1.58 2013/10/20 11:37:11 bouyer Exp $ */
+/* $NetBSD: xbdback_xenbus.c,v 1.59 2013/11/06 06:23:15 mrg Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.58 2013/10/20 11:37:11 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.59 2013/11/06 06:23:15 mrg Exp $");
#include <sys/atomic.h>
#include <sys/buf.h>
@@ -1305,8 +1305,8 @@ xbdback_co_io_loop(struct xbdback_instan
KASSERT(xbdi->xbdi_req->rq_operation == BLKIF_OP_READ ||
xbdi->xbdi_req->rq_operation == BLKIF_OP_WRITE);
if (xbdi->xbdi_segno < xbdi->xbdi_xen_req.nr_segments) {
- uint8_t this_fs, this_ls, last_fs, last_ls;
- grant_ref_t thisgrt, lastgrt;
+ uint8_t this_fs, this_ls, last_ls;
+ grant_ref_t thisgrt;
/*
* Segment-level reason to coalesce: handling full
* pages, or adjacent sector ranges from the same page
@@ -1320,9 +1320,7 @@ xbdback_co_io_loop(struct xbdback_instan
"first,last_sect[%d]=0%o,0%o\n",
xbdi->xbdi_domid, xbdi->xbdi_segno,
this_fs, this_ls));
- last_fs = xbdi->xbdi_last_fs = xbdi->xbdi_this_fs;
last_ls = xbdi->xbdi_last_ls = xbdi->xbdi_this_ls;
- lastgrt = xbdi->xbdi_lastgrt = xbdi->xbdi_thisgrt;
xbdi->xbdi_this_fs = this_fs;
xbdi->xbdi_this_ls = this_ls;
xbdi->xbdi_thisgrt = thisgrt;