]>
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 | |
2f5d55aa | 11 | char hw_serial[11]; |
12 | EXPORT_SYMBOL(hw_serial); | |
13 | ||
77b1fe8f | 14 | int |
15 | highbit(unsigned long i) | |
16 | { | |
17 | register int h = 1; | |
18 | ||
19 | if (i == 0) | |
20 | return (0); | |
21 | #if BITS_PER_LONG == 64 | |
22 | if (i & 0xffffffff00000000ul) { | |
23 | h += 32; i >>= 32; | |
24 | } | |
25 | #endif | |
26 | if (i & 0xffff0000) { | |
27 | h += 16; i >>= 16; | |
28 | } | |
29 | if (i & 0xff00) { | |
30 | h += 8; i >>= 8; | |
31 | } | |
32 | if (i & 0xf0) { | |
33 | h += 4; i >>= 4; | |
34 | } | |
35 | if (i & 0xc) { | |
36 | h += 2; i >>= 2; | |
37 | } | |
38 | if (i & 0x2) { | |
39 | h += 1; | |
40 | } | |
41 | return (h); | |
42 | } | |
43 | EXPORT_SYMBOL(highbit); | |
44 | ||
2f5d55aa | 45 | int |
46 | ddi_strtoul(const char *str, char **nptr, int base, unsigned long *result) | |
47 | { | |
48 | char *end; | |
49 | return (*result = simple_strtoul(str, &end, base)); | |
50 | } | |
51 | EXPORT_SYMBOL(ddi_strtoul); | |
52 | ||
70eadc19 | 53 | static int __init spl_init(void) |
54 | { | |
2f5d55aa | 55 | strcpy(hw_serial, "007f0100"); /* loopback */ |
70eadc19 | 56 | printk(KERN_INFO "spl: Loaded Solaris Porting Layer v%s\n", VERSION); |
57 | return 0; | |
58 | } | |
59 | ||
60 | static void spl_fini(void) | |
61 | { | |
62 | return; | |
63 | } | |
64 | ||
65 | module_init(spl_init); | |
66 | module_exit(spl_fini); | |
67 | ||
68 | MODULE_AUTHOR("Lawrence Livermore National Labs"); | |
69 | MODULE_DESCRIPTION("Solaris Porting Layer"); | |
70 | MODULE_LICENSE("GPL"); |