From owner-p4-projects@FreeBSD.ORG Sat May 31 19:30:59 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C0C1037B404; Sat, 31 May 2003 19:30:58 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7154637B401 for ; Sat, 31 May 2003 19:30:58 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CAC0043F93 for ; Sat, 31 May 2003 19:30:57 -0700 (PDT) (envelope-from jmallett@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h512Uv0U077996 for ; Sat, 31 May 2003 19:30:57 -0700 (PDT) (envelope-from jmallett@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h512UvTq077993 for perforce@freebsd.org; Sat, 31 May 2003 19:30:57 -0700 (PDT) Date: Sat, 31 May 2003 19:30:57 -0700 (PDT) Message-Id: <200306010230.h512UvTq077993@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jmallett@freebsd.org using -f From: Juli Mallett To: Perforce Change Reviews Subject: PERFORCE change 32257 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2003 02:30:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=32257 Change 32257 by jmallett@jmallett_dalek on 2003/05/31 19:30:13 Abstract out vector installing code, and print information as they are getting installed. Affected files ... .. //depot/projects/mips/sys/mips/mips/machdep.c#29 edit Differences ... ==== //depot/projects/mips/sys/mips/mips/machdep.c#29 (text+ko) ==== @@ -583,6 +583,22 @@ }; static void +mips64_vector_install(vm_offset_t addr, char *begin, char *end) +{ + size_t len, max; + + max = 0x80; + len = end - begin; + + if (len > max) + panic("Exception code too big for vector %lx\n", addr); + + printf("Installing exception code %p:%p at %lx, %zu bytes (%zu free)\n", + begin, end, addr, len, max - len); + memcpy((void *)addr, begin, len); +} + +static void mips64_vector_init(void) { /* r4000 exception handler address and end */ @@ -599,29 +615,17 @@ * Copy down exception vector code. */ - if (TLBMissVectorEnd - TLBMissVector > 0x80) - panic("startup: UTLB vector code too large"); - memcpy((void *)MIPS_UTLB_MISS_EXC_VEC, TLBMissVector, - TLBMissVectorEnd - TLBMissVector); - - if (XTLBMissVectorEnd - XTLBMissVector > 0x80) - panic("startup: XTLB vector code too large"); - memcpy((void *)MIPS3_XTLB_MISS_EXC_VEC, XTLBMissVector, - XTLBMissVectorEnd - XTLBMissVector); - - if (CacheVectorEnd - CacheVector > 0x80) - panic("startup: Cache error vector code too large"); - memcpy((void *)MIPS3_CACHE_ERR_EXC_VEC, CacheVector, - CacheVectorEnd - CacheVector); - - if (ExceptionVectorEnd - ExceptionVector > 0x80) - panic("startup: General exception vector code too large"); - memcpy((void *)MIPS3_GEN_EXC_VEC, ExceptionVector, - ExceptionVectorEnd - ExceptionVector); - + mips64_vector_install(MIPS_UTLB_MISS_EXC_VEC, + TLBMissVector, TLBMissVectorEnd); + mips64_vector_install(MIPS3_XTLB_MISS_EXC_VEC, + XTLBMissVector, XTLBMissVectorEnd); + mips64_vector_install(MIPS3_CACHE_ERR_EXC_VEC, + CacheVector, CacheVectorEnd); + mips64_vector_install(MIPS3_GEN_EXC_VEC, + ExceptionVector, ExceptionVectorEnd); /* XXX do a real interrupt vector for the mips32/64? */ - memcpy((void *)MIPS3_INTR_EXC_VEC, ExceptionVector, - ExceptionVectorEnd - ExceptionVector); + mips64_vector_install(MIPS3_INTR_EXC_VEC, + ExceptionVector, ExceptionVectorEnd); /* * Copy locore-function vector.