Changeset 0c96e6cb in mainline for uspace/lib/c/generic/bitops.c


Ignore:
Timestamp:
2013-10-18T11:00:23Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b5851913
Parents:
39bcc99 (diff), 9f9450bb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge GCC port updates

libposix changes

  • unimplemented methods do not abort, they warn instead
  • add pthread.h, no implementation yet
  • speed-up symbol redefinition (objcopy can work with static libraries as well)
  • add some functions already implemented in libc to libposix

toolchain changes

  • experimental support for HelenOS-specific toolchain
    • toolchain.sh —helenos-target
    • adds *-helenos*- target, e.g. we can have amd64-helenos-gcc
    • added as another choice to HelenOS.config, updated other scripts accordingly
  • added non-root compilation
    • install into PKG/ to be later copied to real root (package-like installation)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/bitops.c

    r39bcc99 r0c96e6cb  
    3333#include <bitops.h>
    3434
    35 extern int __popcountsi2(int a)
     35int __popcountsi2(int a)
    3636{
    37         return __builtin_popcount(a);
     37        int bits = 0;
     38        for (unsigned int i = 0; i < sizeof(a) * 8; i++)         {
     39                if (((a >> i) & 1) != 0) {
     40                        bits++;
     41                }
     42        }
     43        return bits;                                                                   
    3844}
    3945
Note: See TracChangeset for help on using the changeset viewer.