]> git.proxmox.com Git - mirror_spl-debian.git/blame - modules/spl/spl-generic.c
Add missing headers
[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
2f5d55aa 11char hw_serial[11];
12EXPORT_SYMBOL(hw_serial);
13
77b1fe8f 14int
15highbit(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}
43EXPORT_SYMBOL(highbit);
44
2f5d55aa 45int
46ddi_strtoul(const char *str, char **nptr, int base, unsigned long *result)
47{
48 char *end;
49 return (*result = simple_strtoul(str, &end, base));
50}
51EXPORT_SYMBOL(ddi_strtoul);
52
70eadc19 53static 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
60static void spl_fini(void)
61{
62 return;
63}
64
65module_init(spl_init);
66module_exit(spl_fini);
67
68MODULE_AUTHOR("Lawrence Livermore National Labs");
69MODULE_DESCRIPTION("Solaris Porting Layer");
70MODULE_LICENSE("GPL");