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

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-gsoc@xxxxxxxxxxxxx
  • Date: Wed, 18 Jun 2008 14:52:26 +0200

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

Other related posts: