*参照元 [#ifcbabc9]
#backlinks

*説明 [#nd70ad90]
-パス: 複数あり
--汎用       : [[linux-2.6.33/include/asm-generic/mutex-dec.h]]
--ARM 用     : [[linux-2.6.33/arch/arm/include/asm/mutex.h]]
--Blackfin 用: [[linux-2.6.33/arch/blackfin/include/asm/mutex.h]]
--IA64 用    : [[linux-2.6.33/arch/ia64/include/asm/mutex.h]]
--PowerPC 用 : [[linux-2.6.33/arch/powerpc/include/asm/mutex.h]]
--SH 用      : [[linux-2.6.33/arch/sh/include/asm/mutex-llsc.h]]
--x86(32bit) 用   : [[linux-2.6.33/arch/x86/include/asm/mutex_32.h]]
--x86_64(64bit) 用: [[linux-2.6.33/arch/x86/include/asm/mutex_64.h]]

-FIXME: これは何?
--ミューテックスのロックカウントを減らす。


**引数 [#z1121482]
-atomic_t *count
--
--[[linux-2.6.33/atomic_t]]
-int (*fail_fn)(atomic_t *)
--


**返り値 [#q807c7f0]
-
--

**参考 [#c0180ed7]
-独自のミューテックスロック関数を定義しているアーキテクチャ
--ARM
--Blackfin
--IA64
--PowerPC
--SH
--x86(32bit)
--x86_64(64bit)

-検索データ
 $ grep -r __mutex_fastpath_lock arch/ | sed -e 's/\(.*\):\(.*\)/\1/g' | sort | uniq
 arch/arm/include/asm/mutex.h
 arch/blackfin/include/asm/mutex.h
 arch/ia64/include/asm/mutex.h
 arch/powerpc/include/asm/mutex.h
 arch/sh/include/asm/mutex-llsc.h
 arch/x86/include/asm/mutex_32.h
 arch/x86/include/asm/mutex_64.h


*実装 [#m7b5b9d2]
**汎用: include/asm-generic/mutex-dec.h [#e1ca13eb]
 /**
  *  __mutex_fastpath_lock_retval - try to take the lock by moving the count
  *                                 from 1 to a 0 value
  *  @count: pointer of type atomic_t
  *  @fail_fn: function to call if the original value was not 1
  *
  * Change the count from 1 to a value lower than 1, and call <fail_fn> if
  * it wasn't 1 originally. This function returns 0 if the fastpath succeeds,
  * or anything the slow path function returns.
  */
 static inline int
 __mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *))
 {
 	if (unlikely(atomic_dec_return(count) < 0))
 		return fail_fn(count);
-
--[[linux-2.6.33/unlikely()]]
-
--[[linux-2.6.33/atomic_dec_return()]]

 	return 0;
 }

**ARM 用     : arch/arm/include/asm/mutex.h [#t3bebe0c]
**Blackfin 用: arch/blackfin/include/asm/mutex.h [#pef2ccdc]
**IA64 用    : arch/ia64/include/asm/mutex.h [#hee1a8f0]
**PowerPC 用 : arch/powerpc/include/asm/mutex.h [#zdd733ad]
**SH 用      : arch/sh/include/asm/mutex-llsc.h [#w5b9c018]
**x86(32bit) 用   : arch/x86/include/asm/mutex_32.h [#i3bc42e8]
**x86_64(64bit) 用: arch/x86/include/asm/mutex_64.h [#m5c5004d]

*コメント [#rdb85916]

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS