aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/channels/chanstub.c
blob: b6fd126f16f1e8bf0954abce1c1043cffa4c8160 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* Copyright (C) 2010 - 2013 UNISYS CORPORATION
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or (at
 * your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
 * NON INFRINGEMENT.  See the GNU General Public License for more
 * details.
 */

#define EXPORT_SYMTAB
#include <linux/kernel.h>
#ifdef CONFIG_MODVERSIONS
#include <config/modversions.h>
#endif
#include <linux/module.h>
#include <linux/init.h>		/* for module_init and module_exit */
#include <linux/slab.h>		/* for memcpy */
#include <linux/types.h>

#include "channel.h"
#include "chanstub.h"
#include "timskmod.h"
#include "version.h"

static __init int
channel_mod_init(void)
{
	if (!unisys_spar_platform)
		return -ENODEV;
	return 0;
}

static __exit void
channel_mod_exit(void)
{
}

unsigned char
SignalInsert_withLock(struct channel_header __iomem *pChannel, u32 Queue,
		      void *pSignal, spinlock_t *lock)
{
	unsigned char result;
	unsigned long flags;

	spin_lock_irqsave(lock, flags);
	result = spar_signal_insert(pChannel, Queue, pSignal);
	spin_unlock_irqrestore(lock, flags);
	return result;
}

unsigned char
SignalRemove_withLock(struct channel_header __iomem *pChannel, u32 Queue,
		      void *pSignal, spinlock_t *lock)
{
	unsigned char result;

	spin_lock(lock);
	result = spar_signal_remove(pChannel, Queue, pSignal);
	spin_unlock(lock);
	return result;
}

module_init(channel_mod_init);
module_exit(channel_mod_exit);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Bryan Glaudel");
MODULE_ALIAS("uischan");
	/* this is extracted during depmod and kept in modules.dep */