Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/modules/klibc/__clzsi2.c

Source at commit 1406 created 12 years 10 months ago.
By meklort, Revert drivers.c so that kexts are only loaded when OSBundleRequired is set and that value is not safe mode. Added some comments about it too.
1/*
2 * libgcc/__clzsi2.c
3 *
4 * Returns the leading number of 0 bits in the argument
5 */
6
7#include <stdint.h>
8#include <stddef.h>
9
10uint32_t __clzsi2(uint32_t v)
11{
12int p = 31;
13
14if (v & 0xffff0000) {
15p -= 16;
16v >>= 16;
17}
18if (v & 0xff00) {
19p -= 8;
20v >>= 8;
21}
22if (v & 0xf0) {
23p -= 4;
24v >>= 4;
25}
26if (v & 0xc) {
27p -= 2;
28v >>= 2;
29}
30if (v & 0x2) {
31p -= 1;
32v >>= 1;
33}
34
35return p;
36}
37

Archive Download this file

Revision: 1406