From owner-p4-projects@FreeBSD.ORG Thu Aug 24 16:26:13 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7C8AB16A4E1; Thu, 24 Aug 2006 16:26:13 +0000 (UTC) X-Original-To: perforce@FreeBSD.org 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 5852316A4DE for ; Thu, 24 Aug 2006 16:26:13 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDF2B43D49 for ; Thu, 24 Aug 2006 16:26:12 +0000 (GMT) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k7OGQCsM004314 for ; Thu, 24 Aug 2006 16:26:12 GMT (envelope-from gonzo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k7OGQCxN004311 for perforce@freebsd.org; Thu, 24 Aug 2006 16:26:12 GMT (envelope-from gonzo@FreeBSD.org) Date: Thu, 24 Aug 2006 16:26:12 GMT Message-Id: <200608241626.k7OGQCxN004311@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko To: Perforce Change Reviews Cc: Subject: PERFORCE change 104951 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Aug 2006 16:26:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=104951 Change 104951 by gonzo@gonzo_hq on 2006/08/24 16:26:09 o Unbreak kernel build: move helper routines to the top of the file so they'll be defined before used. Affected files ... .. //depot/projects/mips2/src/sys/mips/include/cpufunc.h#16 edit Differences ... ==== //depot/projects/mips2/src/sys/mips/include/cpufunc.h#16 (text+ko) ==== @@ -28,13 +28,55 @@ #ifndef _MACHINE_CPUFUNC_H_ #define _MACHINE_CPUFUNC_H_ -#ifdef _KERNEL - #include #include +/* + * These functions are required by user-land atomi ops + */ static __inline void +mips_barrier(void) +{ + __asm __volatile (".set noreorder\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + "nop\n\t" + ".set reorder\n\t" + : : : "memory"); +} + +static __inline void +mips_wbflush(void) +{ + __asm __volatile ("sync" : : : "memory"); + mips_barrier(); +#if 0 + __asm __volatile("mtc0 %0, $12\n" /* MIPS_COP_0_STATUS */ + : : "r" (flag)); +#endif +} + +static __inline void +mips_read_membar(void) +{ + /* Nil */ +} + +static __inline void +mips_write_membar(void) +{ + mips_wbflush(); +} + +#ifdef _KERNEL + +static __inline void mips_tlbp(void) { __asm __volatile ("tlbp"); @@ -194,47 +236,4 @@ #endif /* _KERNEL */ -/* - * These functions are required by user-land atomi ops - */ - -static __inline void -mips_barrier(void) -{ - __asm __volatile (".set noreorder\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - ".set reorder\n\t" - : : : "memory"); -} - -static __inline void -mips_wbflush(void) -{ - __asm __volatile ("sync" : : : "memory"); - mips_barrier(); -#if 0 - __asm __volatile("mtc0 %0, $12\n" /* MIPS_COP_0_STATUS */ - : : "r" (flag)); -#endif -} - -static __inline void -mips_read_membar(void) -{ - /* Nil */ -} - -static __inline void -mips_write_membar(void) -{ - mips_wbflush(); -} - #endif /* !_MACHINE_CPUFUNC_H_ */