1 #include <linux/kernel.h>
2 #include <linux/types.h>
3 #include <linux/slab.h>
4 #include <linux/module.h>
6 #include <sys/domain.h>
8 #include <xseg/domain.h>
10 int (*xseg_snprintf)(char *str, size_t size, const char *format, ...) = snprintf;
11 EXPORT_SYMBOL(xseg_snprintf);
13 char __xseg_errbuf[4096];
14 EXPORT_SYMBOL(__xseg_errbuf);
16 static spinlock_t __lock;
18 void __lock_domain(void)
20 spin_lock_irq(&__lock);
23 void __unlock_domain(void)
25 spin_unlock_irq(&__lock);
28 void __load_plugin(const char *name)
33 uint64_t __get_id(void)
38 int __xseg_preinit(void)
43 void __xseg_log(const char *msg)
45 (void)printk(KERN_INFO "%s\n", msg);
47 EXPORT_SYMBOL(__xseg_log);
49 void *xq_malloc(unsigned long size)
51 return kmalloc(size, GFP_KERNEL);
54 void xq_mfree(void *ptr)
59 static int __init xsegmod_init(void)
61 printk(KERN_INFO "xseg loaded");
65 static void __exit xsegmod_exit(void)
67 printk(KERN_INFO "xseg unloaded");
71 module_init(xsegmod_init);
72 module_exit(xsegmod_exit);
74 MODULE_DESCRIPTION("xseg");
75 MODULE_AUTHOR("XSEG");
76 MODULE_LICENSE("GPL");