Commit 685ef3b5 authored by Ramesh Gupta's avatar Ramesh Gupta Committed by Hari Kanigeri

OMAP4 Syslink use kernel bitops functions

Use kernel bitops functions instead of custom
defined.
Signed-off-by: default avatarRamesh Gupta G <grgupta@ti.com>
parent 4258cba5
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/module.h> #include <linux/module.h>
#include <syslink/_bitops.h>
#include <syslink/notify_driver.h> #include <syslink/notify_driver.h>
#include <syslink/notifydefs.h> #include <syslink/notifydefs.h>
#include <syslink/notify_driverdefs.h> #include <syslink/notify_driverdefs.h>
...@@ -695,9 +694,9 @@ int notify_ducatidrv_register_event( ...@@ -695,9 +694,9 @@ int notify_ducatidrv_register_event(
} }
if (done) { if (done) {
SET_BIT(ctrl_ptr->proc_ctrl[driver_object->self_id]. set_bit(event_no, (unsigned long *)
reg_mask.mask, &ctrl_ptr->proc_ctrl[driver_object->self_id].
event_no); reg_mask.mask);
} else { } else {
/*retval NOTIFY_E_MAXEVENTS Maximum number of /*retval NOTIFY_E_MAXEVENTS Maximum number of
supported events have already been registered. */ supported events have already been registered. */
...@@ -770,8 +769,9 @@ int notify_ducatidrv_unregister_event( ...@@ -770,8 +769,9 @@ int notify_ducatidrv_unregister_event(
if (list_empty((struct list_head *) if (list_empty((struct list_head *)
&event_list[event_no].listeners) == true) { &event_list[event_no].listeners) == true) {
CLEAR_BIT(ctrl_ptr->proc_ctrl[driver_object->self_id].reg_mask. clear_bit(event_no, (unsigned long *)
mask, event_no); &ctrl_ptr->proc_ctrl[driver_object->self_id].reg_mask.
mask);
self_event_chart = ctrl_ptr->proc_ctrl[driver_object->self_id]. self_event_chart = ctrl_ptr->proc_ctrl[driver_object->self_id].
self_event_chart; self_event_chart;
/* Clear any pending unserviced event as there are no /* Clear any pending unserviced event as there are no
...@@ -853,11 +853,12 @@ int notify_ducatidrv_sendevent(struct notify_driver_object *handle, ...@@ -853,11 +853,12 @@ int notify_ducatidrv_sendevent(struct notify_driver_object *handle,
*/ */
} else { } else {
/* Check if other side is ready to receive this event. */ /* Check if other side is ready to receive this event. */
if ((TEST_BIT(ctrl_ptr->proc_ctrl[driver_object->other_id]. if ((test_bit(event_no, (unsigned long *)
reg_mask.mask, event_no) == false) &ctrl_ptr->proc_ctrl[driver_object->other_id].
|| (TEST_BIT(ctrl_ptr-> reg_mask.mask) != 1)
|| (test_bit(event_no, &ctrl_ptr->
proc_ctrl[driver_object->other_id].reg_mask. proc_ctrl[driver_object->other_id].reg_mask.
enable_mask, event_no) == false)) { enable_mask) != 1)) {
status = -ENODEV; status = -ENODEV;
/* This may be used for polling till other-side /* This may be used for polling till other-side
is ready, so do not set failure reason.*/ is ready, so do not set failure reason.*/
...@@ -970,8 +971,9 @@ int notify_ducatidrv_disable_event( ...@@ -970,8 +971,9 @@ int notify_ducatidrv_disable_event(
gate_handle) != 0) gate_handle) != 0)
WARN_ON(1); WARN_ON(1);
CLEAR_BIT(driver_object->ctrl_ptr->proc_ctrl[driver_object->self_id]. clear_bit(event_no,(unsigned long *)
reg_mask.enable_mask, event_no); &driver_object->ctrl_ptr->proc_ctrl[driver_object->self_id].
reg_mask.enable_mask);
/* Leave critical section protection. */ /* Leave critical section protection. */
mutex_unlock(notify_ducatidriver_state.gate_handle); mutex_unlock(notify_ducatidriver_state.gate_handle);
return status; return status;
...@@ -997,8 +999,9 @@ int notify_ducatidrv_enable_event(struct notify_driver_object *handle, ...@@ -997,8 +999,9 @@ int notify_ducatidrv_enable_event(struct notify_driver_object *handle,
gate_handle) != 0) gate_handle) != 0)
WARN_ON(1); WARN_ON(1);
SET_BIT(driver_object->ctrl_ptr->proc_ctrl[driver_object->self_id]. set_bit(event_no, (unsigned long *)
reg_mask.enable_mask, event_no); &driver_object->ctrl_ptr->proc_ctrl[driver_object->self_id].
reg_mask.enable_mask);
mutex_unlock(notify_ducatidriver_state.gate_handle); mutex_unlock(notify_ducatidriver_state.gate_handle);
return status; return status;
...@@ -1049,8 +1052,9 @@ static void notify_ducatidrv_isr(void *ref_data) ...@@ -1049,8 +1052,9 @@ static void notify_ducatidrv_isr(void *ref_data)
/* Determine the current high priority event.*/ /* Determine the current high priority event.*/
/* Check if the event is set and enabled.*/ /* Check if the event is set and enabled.*/
if (self_event_chart[event_no].flag == UP && if (self_event_chart[event_no].flag == UP &&
TEST_BIT(proc_ctrl_ptr->reg_mask.enable_mask, test_bit(event_no,
event_no) && (event_no != (int) -1)) { (unsigned long *) &proc_ctrl_ptr->reg_mask.enable_mask)
&& (event_no != (int) -1)) {
payload = self_event_chart[event_no]. payload = self_event_chart[event_no].
payload; payload;
......
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