]> git.proxmox.com Git - mirror_spl-debian.git/blame - modules/spl/spl-generic.c
- Implemented vnode interfaces and 6 test cases to the test suite.
[mirror_spl-debian.git] / modules / spl / spl-generic.c
CommitLineData
14c5326c 1#include <sys/sysmacros.h>
70eadc19 2#include "config.h"
f1b59d26 3
4/*
5 * Generic support
6 */
7
8int p0 = 0;
9EXPORT_SYMBOL(p0);
70eadc19 10
77b1fe8f 11int
12highbit(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}
40EXPORT_SYMBOL(highbit);
41
70eadc19 42static int __init spl_init(void)
43{
44 printk(KERN_INFO "spl: Loaded Solaris Porting Layer v%s\n", VERSION);
45 return 0;
46}
47
48static void spl_fini(void)
49{
50 return;
51}
52
53module_init(spl_init);
54module_exit(spl_fini);
55
56MODULE_AUTHOR("Lawrence Livermore National Labs");
57MODULE_DESCRIPTION("Solaris Porting Layer");
58MODULE_LICENSE("GPL");