]>
Commit | Line | Data |
---|---|---|
14c5326c | 1 | #include <sys/sysmacros.h> |
af828292 | 2 | #include <sys/vmsystm.h> |
3 | #include <sys/vnode.h> | |
70eadc19 | 4 | #include "config.h" |
f1b59d26 | 5 | |
6 | /* | |
7 | * Generic support | |
8 | */ | |
9 | ||
10 | int p0 = 0; | |
11 | EXPORT_SYMBOL(p0); | |
70eadc19 | 12 | |
2f5d55aa | 13 | char hw_serial[11]; |
14 | EXPORT_SYMBOL(hw_serial); | |
15 | ||
af828292 | 16 | vmem_t *zio_alloc_arena = NULL; |
17 | EXPORT_SYMBOL(zio_alloc_arena); | |
18 | ||
77b1fe8f | 19 | int |
20 | highbit(unsigned long i) | |
21 | { | |
22 | register int h = 1; | |
23 | ||
24 | if (i == 0) | |
25 | return (0); | |
26 | #if BITS_PER_LONG == 64 | |
27 | if (i & 0xffffffff00000000ul) { | |
28 | h += 32; i >>= 32; | |
29 | } | |
30 | #endif | |
31 | if (i & 0xffff0000) { | |
32 | h += 16; i >>= 16; | |
33 | } | |
34 | if (i & 0xff00) { | |
35 | h += 8; i >>= 8; | |
36 | } | |
37 | if (i & 0xf0) { | |
38 | h += 4; i >>= 4; | |
39 | } | |
40 | if (i & 0xc) { | |
41 | h += 2; i >>= 2; | |
42 | } | |
43 | if (i & 0x2) { | |
44 | h += 1; | |
45 | } | |
46 | return (h); | |
47 | } | |
48 | EXPORT_SYMBOL(highbit); | |
49 | ||
2f5d55aa | 50 | int |
51 | ddi_strtoul(const char *str, char **nptr, int base, unsigned long *result) | |
52 | { | |
53 | char *end; | |
54 | return (*result = simple_strtoul(str, &end, base)); | |
55 | } | |
56 | EXPORT_SYMBOL(ddi_strtoul); | |
57 | ||
70eadc19 | 58 | static int __init spl_init(void) |
59 | { | |
af828292 | 60 | int rc; |
61 | ||
62 | rc = vn_init(); | |
63 | if (rc) | |
64 | return rc; | |
65 | ||
2f5d55aa | 66 | strcpy(hw_serial, "007f0100"); /* loopback */ |
70eadc19 | 67 | printk(KERN_INFO "spl: Loaded Solaris Porting Layer v%s\n", VERSION); |
af828292 | 68 | |
70eadc19 | 69 | return 0; |
70 | } | |
71 | ||
72 | static void spl_fini(void) | |
73 | { | |
af828292 | 74 | vn_fini(); |
70eadc19 | 75 | return; |
76 | } | |
77 | ||
78 | module_init(spl_init); | |
79 | module_exit(spl_fini); | |
80 | ||
81 | MODULE_AUTHOR("Lawrence Livermore National Labs"); | |
82 | MODULE_DESCRIPTION("Solaris Porting Layer"); | |
83 | MODULE_LICENSE("GPL"); |