Date: Tue, 16 May 2006 23:44:23 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 97306 for review Message-ID: <200605162344.k4GNiNX8008329@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=97306 Change 97306 by kmacy@kmacy_storage:sun4v_rwbuf on 2006/05/16 23:44:07 simplify bucket locking export hash_bucket locking function don't trash PCPU_REG when notifying of a duplicate TSB update Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/exception.S#51 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/exception.S#51 (text+ko) ==== @@ -1,4 +1,4 @@ -/*- +/* * Copyright (c) 2006 Kip Macy * All rights reserved. * @@ -1338,21 +1338,20 @@ #define LOADLOAD #LoadLoad #define LOADSTORE #LoadStore #define STORESTORE #StoreStore - + #define THE_LOCK_ENTER(addr, lock_bit, oldval, newval, label1) \ mov 1, lock_bit ; \ add addr, 8, addr ; \ sllx lock_bit, 56, lock_bit ; \ label1: ; \ ldxa [addr]%asi, oldval; \ - andcc %l7, lock_bit, %g0 ; \ - bnz,pn %xcc, label1 ## b ; \ - or oldval, lock_bit, newval; \ + or oldval, lock_bit, newval; \ + andn oldval, lock_bit, oldval; \ casxa [addr]%asi, oldval, newval; \ - cmp oldval, newval ; \ - bne,pn %icc, label1 ## b ; \ + cmp newval, oldval ; \ + bne,pn %xcc, label1 ## b ; \ membar LOADLOAD ; \ - sub addr, 8, addr ; + sub addr, 8, addr ; #define THE_LOCK_EXIT(addr, lock_bit, tmp)\ membar LOADSTORE | STORESTORE ; \ @@ -1382,7 +1381,30 @@ add pcpu, cansave, cansave ; \ RESTORE_LOCALS_ASI(cansave) ; \ label2: - + +ENTRY(hash_bucket_lock) +! MAGIC_TRAP_ON + wr %g0, ASI_N, %asi + rdpr %pstate, %o1 + and %o1, PSTATE_INTR_DISABLE, %o2 + wrpr %o2, %pstate + THE_LOCK_ENTER(%o0, %o3, %o4, %o5, 1) + mov %o1, %o0 + retl + nop +END(hash_bucket_lock) + + +ENTRY(hash_bucket_unlock) + mov 1, %g2 + wr %g0, ASI_N, %asi + sllx %g2, 56, %g2 + THE_LOCK_EXIT(%o0, %g2, %g3) + wrpr %o1, %pstate + retl + nop +END(hash_bucket_unlock) + ! %g3==trap type ! %g4==fault type (if data miss) @@ -1575,12 +1597,10 @@ ! is storing same data #else mov %o0, %g1 - mov %o5, %g7 - PUTCHAR(0x5a) - PUTCHAR(0x5a) + mov %o5, %g4 PUTCHAR(0x5a) mov %g1, %o0 - mov %g7, %o5 + mov %g4, %o5 MAGIC_TRAP_ON; MAGIC_TRAP_OFF #endif 12:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605162344.k4GNiNX8008329>