• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (C) 2010 - 2013 UNISYS CORPORATION
2  * All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or (at
7  * your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
12  * NON INFRINGEMENT.  See the GNU General Public License for more
13  * details.
14  */
15 
16 #define EXPORT_SYMTAB
17 #include <linux/kernel.h>
18 #ifdef CONFIG_MODVERSIONS
19 #include <config/modversions.h>
20 #endif
21 #include <linux/module.h>
22 #include <linux/init.h>		/* for module_init and module_exit */
23 #include <linux/slab.h>		/* for memcpy */
24 #include <linux/types.h>
25 
26 #include "channel.h"
27 #include "chanstub.h"
28 #include "timskmod.h"
29 #include "version.h"
30 
31 static __init int
channel_mod_init(void)32 channel_mod_init(void)
33 {
34 	if (!unisys_spar_platform)
35 		return -ENODEV;
36 	return 0;
37 }
38 
39 static __exit void
channel_mod_exit(void)40 channel_mod_exit(void)
41 {
42 }
43 
44 unsigned char
SignalInsert_withLock(CHANNEL_HEADER __iomem * pChannel,u32 Queue,void * pSignal,spinlock_t * lock)45 SignalInsert_withLock(CHANNEL_HEADER __iomem *pChannel, u32 Queue,
46 		      void *pSignal, spinlock_t *lock)
47 {
48 	unsigned char result;
49 	unsigned long flags;
50 
51 	spin_lock_irqsave(lock, flags);
52 	result = visor_signal_insert(pChannel, Queue, pSignal);
53 	spin_unlock_irqrestore(lock, flags);
54 	return result;
55 }
56 
57 unsigned char
SignalRemove_withLock(CHANNEL_HEADER __iomem * pChannel,u32 Queue,void * pSignal,spinlock_t * lock)58 SignalRemove_withLock(CHANNEL_HEADER __iomem *pChannel, u32 Queue,
59 		      void *pSignal, spinlock_t *lock)
60 {
61 	unsigned char result;
62 
63 	spin_lock(lock);
64 	result = visor_signal_remove(pChannel, Queue, pSignal);
65 	spin_unlock(lock);
66 	return result;
67 }
68 
69 module_init(channel_mod_init);
70 module_exit(channel_mod_exit);
71 
72 MODULE_LICENSE("GPL");
73 MODULE_AUTHOR("Bryan Glaudel");
74 MODULE_ALIAS("uischan");
75 	/* this is extracted during depmod and kept in modules.dep */
76