[haiku-gsoc] Re: [HCD]: Bfs bug #1

2008/6/18 Ingo Weinhold <ingo_weinhold@xxxxxx>:
> On 2008-06-18 at 13:34:23 [+0200], Salvatore Benedetto <emitrax@xxxxxxxxx>
> wrote:
>>
>> in src/add-ons/kernel/partitioning_systems/intel/intel.cpp
>> // TODO: This doesn't belong here!
>> // no atomic_add() in the boot loader
>> #ifdef _BOOT_MODE
>>
>> inline int32
>> atomic_add(int32 *a, int32 num)
>> {
>>     int32 oldA = *a;
>>     *a += num;
>>     return oldA;
>> }
>>
>> #endif
>
> As the comment says it is only for the boot loader. Since it is
> single-threaded, there's little need for atomicity. The atomic_*() functions
> used in the kernel and userland live in
> src/system/libroot/os/arch/*/atomic.S. For more info:
>        http://www.haiku-os.org/legacy-docs/bebook/TheSupportKit_Functions.html
>
> CU, Ingo
>
>

OH!

FUNCTION(atomic_add):
    movl        4(%esp),%edx
    movl        8(%esp),%eax
    lock
    xaddl       %eax,(%edx)
    ret

That explains my _stupid_ question Axel! :-D
I was looking at the wrong function. That's because I didn't indexed
assembly file
but only .c, .cpp, .h and Jamfile with cscope and ctags, and thus when
looking for the
definition I jumped to the wrong function. Gotta fix that.

Thanks a lot Ingo!

Regards,
-- 
Salvatore Benedetto (a.k.a. emitrax)
Student of Computer Engineer
University of Pisa
www.haiku-os.it

Other related posts: