From 11f834a44a04284ab4f4bacbc5e32e7a994efd06 Mon Sep 17 00:00:00 2001 From: he Date: Thu, 6 Nov 2003 00:32:27 +0000 Subject: [PATCH] Add a default: branch with a panic() to the switch statement to handle "impossible" segment types, so that the compiler can know that 'pt' has been initialized after the switch statement. --- sys/arch/vax/vax/pmap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/arch/vax/vax/pmap.c b/sys/arch/vax/vax/pmap.c index 49cae531c3cb..759c33c329f8 100644 --- a/sys/arch/vax/vax/pmap.c +++ b/sys/arch/vax/vax/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.129 2003/10/19 14:58:22 ragge Exp $ */ +/* $NetBSD: pmap.c,v 1.130 2003/11/06 00:32:27 he Exp $ */ /* * Copyright (c) 1994, 1998, 1999, 2003 Ludd, University of Lule}, Sweden. * All rights reserved. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.129 2003/10/19 14:58:22 ragge Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.130 2003/11/06 00:32:27 he Exp $"); #include "opt_ddb.h" #include "opt_cputype.h" @@ -1309,6 +1309,8 @@ pmap_protect_long(pmap_t pmap, vaddr_t start, vaddr_t end, vm_prot_t prot) pt = pmap->pm_p0br; pr = (prot & VM_PROT_WRITE ? PROT_RW : PROT_RO); break; + default: + panic("unsupported segtype: %d", SEGTYPE(start)); } pts = &pt[start >> VAX_PGSHIFT];