tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ci_mtx_count issue on NetBSD/Milkymist



On 02/24/2014 06:38 PM, Mindaugas Rasiukevicius wrote:
Yann Sionneau <yann.sionneau%gmail.com@localhost> wrote:
I've tried to understand how ci_mtx_count is supposed to be managed my
MD code, so far I failed to understand.
It seems some arch use spin_mutex and inc/dec ci_mtx_count upon
spin_mutex_enter/exit.
Some other archs do it in softint handling.

Could someone give my some clue (or documentation) about the intended
behaviour of curcpu()->ci_mtx_count please?
It is a reference count on the IPL raised by spin-mutexes.  The IPL should
be lowered (straight to IPL_NONE) on a last reference.  Notice that this is
a negative counter - mutex_spin_enter() decrements, while mutex_spin_exit()
incremenets.  Not the other way round.

Hi Mindaugas,

if I have __HAVE_SIMPLE_MUTEXES set to 1, and __HAVE_MUTEX_STUBS is undefined, then I should not care about ci_mtx_count in MD code at all, right?

Thanks :)

Regards,

--
Yann Sionneau


Home | Main Index | Thread Index | Old Index