]>
Commit | Line | Data |
---|---|---|
14c5326c | 1 | #include <sys/sysmacros.h> |
70eadc19 | 2 | #include "config.h" |
f1b59d26 | 3 | |
4 | /* | |
5 | * Generic support | |
6 | */ | |
7 | ||
8 | int p0 = 0; | |
9 | EXPORT_SYMBOL(p0); | |
70eadc19 | 10 | |
77b1fe8f | 11 | int |
12 | highbit(unsigned long i) | |
13 | { | |
14 | register int h = 1; | |
15 | ||
16 | if (i == 0) | |
17 | return (0); | |
18 | #if BITS_PER_LONG == 64 | |
19 | if (i & 0xffffffff00000000ul) { | |
20 | h += 32; i >>= 32; | |
21 | } | |
22 | #endif | |
23 | if (i & 0xffff0000) { | |
24 | h += 16; i >>= 16; | |
25 | } | |
26 | if (i & 0xff00) { | |
27 | h += 8; i >>= 8; | |
28 | } | |
29 | if (i & 0xf0) { | |
30 | h += 4; i >>= 4; | |
31 | } | |
32 | if (i & 0xc) { | |
33 | h += 2; i >>= 2; | |
34 | } | |
35 | if (i & 0x2) { | |
36 | h += 1; | |
37 | } | |
38 | return (h); | |
39 | } | |
40 | EXPORT_SYMBOL(highbit); | |
41 | ||
70eadc19 | 42 | static int __init spl_init(void) |
43 | { | |
44 | printk(KERN_INFO "spl: Loaded Solaris Porting Layer v%s\n", VERSION); | |
45 | return 0; | |
46 | } | |
47 | ||
48 | static void spl_fini(void) | |
49 | { | |
50 | return; | |
51 | } | |
52 | ||
53 | module_init(spl_init); | |
54 | module_exit(spl_fini); | |
55 | ||
56 | MODULE_AUTHOR("Lawrence Livermore National Labs"); | |
57 | MODULE_DESCRIPTION("Solaris Porting Layer"); | |
58 | MODULE_LICENSE("GPL"); |