From owner-svn-src-all@FreeBSD.ORG Thu Nov 11 13:35:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8814106564A; Thu, 11 Nov 2010 13:35:23 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D67DB8FC12; Thu, 11 Nov 2010 13:35:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oABDZNta068854; Thu, 11 Nov 2010 13:35:23 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oABDZNFr068849; Thu, 11 Nov 2010 13:35:23 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201011111335.oABDZNFr068849@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 11 Nov 2010 13:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r215119 - in head/sys/powerpc: booke include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 13:35:24 -0000 Author: raj Date: Thu Nov 11 13:35:23 2010 New Revision: 215119 URL: http://svn.freebsd.org/changeset/base/215119 Log: Use local TLB_UNLOCKED marker instead of MTX_UNOWNED for Book-E PowerPC trap routines. This unbreaks Book-E build after the recent machine/mutex.h removal. While there move tlb_*lock() prototypes to machine/tlb.h. Submitted by: jhb Modified: head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/booke/trap_subr.S head/sys/powerpc/include/tlb.h Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Thu Nov 11 12:13:41 2010 (r215118) +++ head/sys/powerpc/booke/machdep.c Thu Nov 11 13:35:23 2010 (r215119) @@ -453,7 +453,7 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpu ptr = &tlb0_miss_locks[cpuid * words_per_gran]; pcpu->pc_booke_tlb_lock = ptr; - *ptr = MTX_UNOWNED; + *ptr = TLB_UNLOCKED; *(ptr + 1) = 0; /* recurse counter */ #endif } Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Thu Nov 11 12:13:41 2010 (r215118) +++ head/sys/powerpc/booke/pmap.c Thu Nov 11 13:35:23 2010 (r215119) @@ -162,8 +162,6 @@ unsigned int kernel_ptbls; /* Number of #define PMAP_REMOVE_DONE(pmap) \ ((pmap) != kernel_pmap && (pmap)->pm_stats.resident_count == 0) -extern void tlb_lock(uint32_t *); -extern void tlb_unlock(uint32_t *); extern void tid_flush(tlbtid_t); /**************************************************************************/ Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Thu Nov 11 12:13:41 2010 (r215118) +++ head/sys/powerpc/booke/trap_subr.S Thu Nov 11 13:35:23 2010 (r215119) @@ -330,7 +330,7 @@ lwz %r22, PC_BOOKE_TLB_LOCK(%r20); \ \ 1: lwarx %r23, 0, %r22; \ - cmpwi %r23, MTX_UNOWNED; \ + cmpwi %r23, TLB_UNLOCKED; \ beq 2f; \ \ /* check if this is recursion */ \ @@ -364,7 +364,7 @@ msync; \ \ /* release the lock */ \ - li %r23, MTX_UNOWNED; \ + li %r23, TLB_UNLOCKED; \ stw %r23, 0(%r22); \ 1: isync; \ msync @@ -860,7 +860,7 @@ ENTRY(tlb_lock) GET_CPUINFO(%r5) lwz %r5, PC_CURTHREAD(%r5) 1: lwarx %r4, 0, %r3 - cmpwi %r4, MTX_UNOWNED + cmpwi %r4, TLB_UNLOCKED bne 1b stwcx. %r5, 0, %r3 bne- 1b @@ -871,11 +871,12 @@ ENTRY(tlb_lock) ENTRY(tlb_unlock) isync msync - li %r4, MTX_UNOWNED + li %r4, TLB_UNLOCKED stw %r4, 0(%r3) isync msync blr + /* * TLB miss spin locks. For each CPU we have a reservation granule (32 bytes); * only a single word from this granule will actually be used as a spin lock Modified: head/sys/powerpc/include/tlb.h ============================================================================== --- head/sys/powerpc/include/tlb.h Thu Nov 11 12:13:41 2010 (r215118) +++ head/sys/powerpc/include/tlb.h Thu Nov 11 13:35:23 2010 (r215119) @@ -129,6 +129,8 @@ #define TID_MAX 255 #define TID_NONE -1 +#define TLB_UNLOCKED 0 + #if !defined(LOCORE) typedef struct tlb_entry { uint32_t mas1; @@ -146,6 +148,9 @@ void tlb1_init(vm_offset_t); void tlb1_print_entries(void); void tlb1_print_tlbentries(void); +void tlb_lock(uint32_t *); +void tlb_unlock(uint32_t *); + #endif /* !LOCORE */ #endif /* _MACHINE_TLB_H_ */