Commit f2170625 authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman

staging: unisys: get rid of semaphore macros

Remove all of the semaphore macros from timskmod.h and switch all uses of those
types to the correct function names.
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e5700df5
...@@ -71,34 +71,6 @@ ...@@ -71,34 +71,6 @@
#define HOSTADDRESS unsigned long long #define HOSTADDRESS unsigned long long
#endif #endif
#define LOCKSEM(sem) down_interruptible(sem)
#define LOCKSEM_UNINTERRUPTIBLE(sem) down(sem)
#define UNLOCKSEM(sem) up(sem)
/** lock read/write semaphore for reading.
Note that all read/write semaphores are of the "uninterruptible" variety.
@param sem (rw_semaphore *) points to semaphore to lock
*/
#define LOCKREADSEM(sem) down_read(sem)
/** unlock read/write semaphore for reading.
Note that all read/write semaphores are of the "uninterruptible" variety.
@param sem (rw_semaphore *) points to semaphore to unlock
*/
#define UNLOCKREADSEM(sem) up_read(sem)
/** lock read/write semaphore for writing.
Note that all read/write semaphores are of the "uninterruptible" variety.
@param sem (rw_semaphore *) points to semaphore to lock
*/
#define LOCKWRITESEM(sem) down_write(sem)
/** unlock read/write semaphore for writing.
Note that all read/write semaphores are of the "uninterruptible" variety.
@param sem (rw_semaphore *) points to semaphore to unlock
*/
#define UNLOCKWRITESEM(sem) up_write(sem)
#ifdef ENABLE_RETURN_TRACE #ifdef ENABLE_RETURN_TRACE
#define RETTRACE(x) \ #define RETTRACE(x) \
do { \ do { \
......
...@@ -1362,18 +1362,18 @@ Process_Incoming(void *v) ...@@ -1362,18 +1362,18 @@ Process_Incoming(void *v)
struct device_info *dev = NULL; struct device_info *dev = NULL;
/* poll each channel for input */ /* poll each channel for input */
LOCKSEM_UNINTERRUPTIBLE(&Lock_Polling_Device_Channels); down(&Lock_Polling_Device_Channels);
new_tail = NULL; new_tail = NULL;
list_for_each_safe(lelt, tmp, &List_Polling_Device_Channels) { list_for_each_safe(lelt, tmp, &List_Polling_Device_Channels) {
int rc = 0; int rc = 0;
dev = list_entry(lelt, struct device_info, dev = list_entry(lelt, struct device_info,
list_polling_device_channels); list_polling_device_channels);
LOCKSEM_UNINTERRUPTIBLE(&dev->interrupt_callback_lock); down(&dev->interrupt_callback_lock);
if (dev->interrupt) if (dev->interrupt)
rc = dev->interrupt(dev->interrupt_context); rc = dev->interrupt(dev->interrupt_context);
else else
continue; continue;
UNLOCKSEM(&dev->interrupt_callback_lock); up(&dev->interrupt_callback_lock);
if (rc) { if (rc) {
/* dev->interrupt returned, but there /* dev->interrupt returned, but there
* is still more work to do. * is still more work to do.
...@@ -1400,7 +1400,7 @@ Process_Incoming(void *v) ...@@ -1400,7 +1400,7 @@ Process_Incoming(void *v)
tot_moved_to_tail_cnt++; tot_moved_to_tail_cnt++;
list_move_tail(new_tail, &List_Polling_Device_Channels); list_move_tail(new_tail, &List_Polling_Device_Channels);
} }
UNLOCKSEM(&Lock_Polling_Device_Channels); up(&Lock_Polling_Device_Channels);
cur_cycles = get_cycles(); cur_cycles = get_cycles();
delta_cycles = cur_cycles - old_cycles; delta_cycles = cur_cycles - old_cycles;
old_cycles = cur_cycles; old_cycles = cur_cycles;
...@@ -1470,14 +1470,14 @@ uislib_enable_channel_interrupts(u32 busNo, u32 devNo, ...@@ -1470,14 +1470,14 @@ uislib_enable_channel_interrupts(u32 busNo, u32 devNo,
(int) (devNo)); (int) (devNo));
return; return;
} }
LOCKSEM_UNINTERRUPTIBLE(&Lock_Polling_Device_Channels); down(&Lock_Polling_Device_Channels);
Initialize_incoming_thread(); Initialize_incoming_thread();
dev->interrupt = interrupt; dev->interrupt = interrupt;
dev->interrupt_context = interrupt_context; dev->interrupt_context = interrupt_context;
dev->polling = TRUE; dev->polling = TRUE;
list_add_tail(&(dev->list_polling_device_channels), list_add_tail(&(dev->list_polling_device_channels),
&List_Polling_Device_Channels); &List_Polling_Device_Channels);
UNLOCKSEM(&Lock_Polling_Device_Channels); up(&Lock_Polling_Device_Channels);
} }
EXPORT_SYMBOL_GPL(uislib_enable_channel_interrupts); EXPORT_SYMBOL_GPL(uislib_enable_channel_interrupts);
...@@ -1494,11 +1494,11 @@ uislib_disable_channel_interrupts(u32 busNo, u32 devNo) ...@@ -1494,11 +1494,11 @@ uislib_disable_channel_interrupts(u32 busNo, u32 devNo)
(int) (devNo)); (int) (devNo));
return; return;
} }
LOCKSEM_UNINTERRUPTIBLE(&Lock_Polling_Device_Channels); down(&Lock_Polling_Device_Channels);
list_del(&dev->list_polling_device_channels); list_del(&dev->list_polling_device_channels);
dev->polling = FALSE; dev->polling = FALSE;
dev->interrupt = NULL; dev->interrupt = NULL;
UNLOCKSEM(&Lock_Polling_Device_Channels); up(&Lock_Polling_Device_Channels);
} }
EXPORT_SYMBOL_GPL(uislib_disable_channel_interrupts); EXPORT_SYMBOL_GPL(uislib_disable_channel_interrupts);
......
...@@ -594,7 +594,7 @@ visorchipset_register_busdev_server(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers, ...@@ -594,7 +594,7 @@ visorchipset_register_busdev_server(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
VISORCHIPSET_BUSDEV_RESPONDERS *responders, VISORCHIPSET_BUSDEV_RESPONDERS *responders,
ULTRA_VBUS_DEVICEINFO *driverInfo) ULTRA_VBUS_DEVICEINFO *driverInfo)
{ {
LOCKSEM_UNINTERRUPTIBLE(&NotifierLock); down(&NotifierLock);
if (notifiers == NULL) { if (notifiers == NULL) {
memset(&BusDev_Server_Notifiers, 0, memset(&BusDev_Server_Notifiers, 0,
sizeof(BusDev_Server_Notifiers)); sizeof(BusDev_Server_Notifiers));
...@@ -609,7 +609,7 @@ visorchipset_register_busdev_server(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers, ...@@ -609,7 +609,7 @@ visorchipset_register_busdev_server(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
BusDeviceInfo_Init(driverInfo, "chipset", "visorchipset", BusDeviceInfo_Init(driverInfo, "chipset", "visorchipset",
VERSION, NULL); VERSION, NULL);
UNLOCKSEM(&NotifierLock); up(&NotifierLock);
} }
EXPORT_SYMBOL_GPL(visorchipset_register_busdev_server); EXPORT_SYMBOL_GPL(visorchipset_register_busdev_server);
...@@ -618,7 +618,7 @@ visorchipset_register_busdev_client(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers, ...@@ -618,7 +618,7 @@ visorchipset_register_busdev_client(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
VISORCHIPSET_BUSDEV_RESPONDERS *responders, VISORCHIPSET_BUSDEV_RESPONDERS *responders,
ULTRA_VBUS_DEVICEINFO *driverInfo) ULTRA_VBUS_DEVICEINFO *driverInfo)
{ {
LOCKSEM_UNINTERRUPTIBLE(&NotifierLock); down(&NotifierLock);
if (notifiers == NULL) { if (notifiers == NULL) {
memset(&BusDev_Client_Notifiers, 0, memset(&BusDev_Client_Notifiers, 0,
sizeof(BusDev_Client_Notifiers)); sizeof(BusDev_Client_Notifiers));
...@@ -632,7 +632,7 @@ visorchipset_register_busdev_client(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers, ...@@ -632,7 +632,7 @@ visorchipset_register_busdev_client(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
if (driverInfo) if (driverInfo)
BusDeviceInfo_Init(driverInfo, "chipset(bolts)", "visorchipset", BusDeviceInfo_Init(driverInfo, "chipset(bolts)", "visorchipset",
VERSION, NULL); VERSION, NULL);
UNLOCKSEM(&NotifierLock); up(&NotifierLock);
} }
EXPORT_SYMBOL_GPL(visorchipset_register_busdev_client); EXPORT_SYMBOL_GPL(visorchipset_register_busdev_client);
...@@ -944,7 +944,7 @@ bus_epilog(u32 busNo, ...@@ -944,7 +944,7 @@ bus_epilog(u32 busNo,
} else } else
pBusInfo->pendingMsgHdr.Id = CONTROLVM_INVALID; pBusInfo->pendingMsgHdr.Id = CONTROLVM_INVALID;
LOCKSEM_UNINTERRUPTIBLE(&NotifierLock); down(&NotifierLock);
if (response == CONTROLVM_RESP_SUCCESS) { if (response == CONTROLVM_RESP_SUCCESS) {
switch (cmd) { switch (cmd) {
case CONTROLVM_BUS_CREATE: case CONTROLVM_BUS_CREATE:
...@@ -989,7 +989,7 @@ bus_epilog(u32 busNo, ...@@ -989,7 +989,7 @@ bus_epilog(u32 busNo,
; ;
else else
bus_responder(cmd, busNo, response); bus_responder(cmd, busNo, response);
UNLOCKSEM(&NotifierLock); up(&NotifierLock);
} }
static void static void
...@@ -1021,7 +1021,7 @@ device_epilog(u32 busNo, u32 devNo, ULTRA_SEGMENT_STATE state, u32 cmd, ...@@ -1021,7 +1021,7 @@ device_epilog(u32 busNo, u32 devNo, ULTRA_SEGMENT_STATE state, u32 cmd,
} else } else
pDevInfo->pendingMsgHdr.Id = CONTROLVM_INVALID; pDevInfo->pendingMsgHdr.Id = CONTROLVM_INVALID;
LOCKSEM_UNINTERRUPTIBLE(&NotifierLock); down(&NotifierLock);
if (response >= 0) { if (response >= 0) {
switch (cmd) { switch (cmd) {
case CONTROLVM_DEVICE_CREATE: case CONTROLVM_DEVICE_CREATE:
...@@ -1087,7 +1087,7 @@ device_epilog(u32 busNo, u32 devNo, ULTRA_SEGMENT_STATE state, u32 cmd, ...@@ -1087,7 +1087,7 @@ device_epilog(u32 busNo, u32 devNo, ULTRA_SEGMENT_STATE state, u32 cmd,
; ;
else else
device_responder(cmd, busNo, devNo, response); device_responder(cmd, busNo, devNo, response);
UNLOCKSEM(&NotifierLock); up(&NotifierLock);
} }
static void static void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment