Commit 927c7927 authored by Ken Cox's avatar Ken Cox Committed by Greg Kroah-Hartman

staging: unisys: Give exported symbols unique names

Many exported symbols had very generic names.  This commit changes the names
so that they will be unique.
Signed-off-by: default avatarKen Cox <jkc@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0d776fa4
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
* 1 if the insertion succeeds, 0 if the queue was full. * 1 if the insertion succeeds, 0 if the queue was full.
*/ */
unsigned char unsigned char
SignalInsert(pCHANNEL_HEADER pChannel, U32 Queue, void *pSignal) visor_signal_insert(pCHANNEL_HEADER pChannel, U32 Queue, void *pSignal)
{ {
void *psignal; void *psignal;
unsigned int head, tail; unsigned int head, tail;
...@@ -78,7 +78,7 @@ SignalInsert(pCHANNEL_HEADER pChannel, U32 Queue, void *pSignal) ...@@ -78,7 +78,7 @@ SignalInsert(pCHANNEL_HEADER pChannel, U32 Queue, void *pSignal)
pqhdr->NumSignalsSent++; pqhdr->NumSignalsSent++;
return 1; return 1;
} }
EXPORT_SYMBOL_GPL(SignalInsert); EXPORT_SYMBOL_GPL(visor_signal_insert);
/* /*
* Routine Description: * Routine Description:
...@@ -99,7 +99,7 @@ EXPORT_SYMBOL_GPL(SignalInsert); ...@@ -99,7 +99,7 @@ EXPORT_SYMBOL_GPL(SignalInsert);
* 1 if the removal succeeds, 0 if the queue was empty. * 1 if the removal succeeds, 0 if the queue was empty.
*/ */
unsigned char unsigned char
SignalRemove(pCHANNEL_HEADER pChannel, U32 Queue, void *pSignal) visor_signal_remove(pCHANNEL_HEADER pChannel, U32 Queue, void *pSignal)
{ {
void *psource; void *psource;
unsigned int head, tail; unsigned int head, tail;
...@@ -131,7 +131,7 @@ SignalRemove(pCHANNEL_HEADER pChannel, U32 Queue, void *pSignal) ...@@ -131,7 +131,7 @@ SignalRemove(pCHANNEL_HEADER pChannel, U32 Queue, void *pSignal)
pqhdr->NumSignalsReceived++; pqhdr->NumSignalsReceived++;
return 1; return 1;
} }
EXPORT_SYMBOL_GPL(SignalRemove); EXPORT_SYMBOL_GPL(visor_signal_remove);
/* /*
* Routine Description: * Routine Description:
...@@ -257,14 +257,14 @@ SignalPeek(pCHANNEL_HEADER pChannel, U32 Queue, U32 Position, void *pSignal) ...@@ -257,14 +257,14 @@ SignalPeek(pCHANNEL_HEADER pChannel, U32 Queue, U32 Position, void *pSignal)
* 1 if the signal queue is empty, 0 otherwise. * 1 if the signal queue is empty, 0 otherwise.
*/ */
unsigned char unsigned char
SignalQueueIsEmpty(pCHANNEL_HEADER pChannel, U32 Queue) visor_signalqueue_empty(pCHANNEL_HEADER pChannel, U32 Queue)
{ {
pSIGNAL_QUEUE_HEADER pqhdr = pSIGNAL_QUEUE_HEADER pqhdr =
(pSIGNAL_QUEUE_HEADER) ((char *) pChannel + (pSIGNAL_QUEUE_HEADER) ((char *) pChannel +
pChannel->oChannelSpace) + Queue; pChannel->oChannelSpace) + Queue;
return pqhdr->Head == pqhdr->Tail; return pqhdr->Head == pqhdr->Tail;
} }
EXPORT_SYMBOL_GPL(SignalQueueIsEmpty); EXPORT_SYMBOL_GPL(visor_signalqueue_empty);
/* /*
* Routine Description: * Routine Description:
......
...@@ -45,7 +45,7 @@ SignalInsert_withLock(pCHANNEL_HEADER pChannel, U32 Queue, ...@@ -45,7 +45,7 @@ SignalInsert_withLock(pCHANNEL_HEADER pChannel, U32 Queue,
unsigned char result; unsigned char result;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(lock, flags); spin_lock_irqsave(lock, flags);
result = SignalInsert(pChannel, Queue, pSignal); result = visor_signal_insert(pChannel, Queue, pSignal);
spin_unlock_irqrestore(lock, flags); spin_unlock_irqrestore(lock, flags);
return result; return result;
} }
...@@ -56,7 +56,7 @@ SignalRemove_withLock(pCHANNEL_HEADER pChannel, U32 Queue, ...@@ -56,7 +56,7 @@ SignalRemove_withLock(pCHANNEL_HEADER pChannel, U32 Queue,
{ {
unsigned char result; unsigned char result;
spin_lock(lock); spin_lock(lock);
result = SignalRemove(pChannel, Queue, pSignal); result = visor_signal_remove(pChannel, Queue, pSignal);
spin_unlock(lock); spin_unlock(lock);
return result; return result;
} }
......
...@@ -283,7 +283,7 @@ typedef struct _SIGNAL_QUEUE_HEADER { ...@@ -283,7 +283,7 @@ typedef struct _SIGNAL_QUEUE_HEADER {
U64 NumInterruptsReceived; /* Total # of Interrupts received. This U64 NumInterruptsReceived; /* Total # of Interrupts received. This
* is incremented by the ISR in the * is incremented by the ISR in the
* guest windows driver */ * guest windows driver */
U64 NumEmptyCnt; /* Number of times that SignalRemove U64 NumEmptyCnt; /* Number of times that visor_signal_remove
* is called and returned Empty * is called and returned Empty
* Status. */ * Status. */
U32 ErrorFlags; /* Error bits set during SignalReinit U32 ErrorFlags; /* Error bits set during SignalReinit
...@@ -584,7 +584,8 @@ ULTRA_channel_client_release_os(void *pChannel, U8 *chanId, void *logCtx, ...@@ -584,7 +584,8 @@ ULTRA_channel_client_release_os(void *pChannel, U8 *chanId, void *logCtx,
* full. * full.
*/ */
unsigned char SignalInsert(pCHANNEL_HEADER pChannel, U32 Queue, void *pSignal); unsigned char visor_signal_insert(pCHANNEL_HEADER pChannel, U32 Queue,
void *pSignal);
/* /*
* Routine Description: * Routine Description:
...@@ -605,7 +606,8 @@ unsigned char SignalInsert(pCHANNEL_HEADER pChannel, U32 Queue, void *pSignal); ...@@ -605,7 +606,8 @@ unsigned char SignalInsert(pCHANNEL_HEADER pChannel, U32 Queue, void *pSignal);
* empty. * empty.
*/ */
unsigned char SignalRemove(pCHANNEL_HEADER pChannel, U32 Queue, void *pSignal); unsigned char visor_signal_remove(pCHANNEL_HEADER pChannel, U32 Queue,
void *pSignal);
/* /*
* Routine Description: * Routine Description:
...@@ -640,6 +642,6 @@ unsigned int SignalRemoveAll(pCHANNEL_HEADER pChannel, U32 Queue, ...@@ -640,6 +642,6 @@ unsigned int SignalRemoveAll(pCHANNEL_HEADER pChannel, U32 Queue,
* Return value: * Return value:
* 1 if the signal queue is empty, 0 otherwise. * 1 if the signal queue is empty, 0 otherwise.
*/ */
unsigned char SignalQueueIsEmpty(pCHANNEL_HEADER pChannel, U32 Queue); unsigned char visor_signalqueue_empty(pCHANNEL_HEADER pChannel, U32 Queue);
#endif #endif
...@@ -27,14 +27,14 @@ ...@@ -27,14 +27,14 @@
*/ */
typedef struct PERIODIC_WORK_Tag PERIODIC_WORK; typedef struct PERIODIC_WORK_Tag PERIODIC_WORK;
PERIODIC_WORK *periodic_work_create(ulong jiffy_interval, PERIODIC_WORK *visor_periodic_work_create(ulong jiffy_interval,
struct workqueue_struct *workqueue, struct workqueue_struct *workqueue,
void (*workfunc)(void *), void (*workfunc)(void *),
void *workfuncarg, void *workfuncarg,
const char *devnam); const char *devnam);
void periodic_work_destroy(PERIODIC_WORK *periodic_work); void visor_periodic_work_destroy(PERIODIC_WORK *periodic_work);
BOOL periodic_work_nextperiod(PERIODIC_WORK *periodic_work); BOOL visor_periodic_work_nextperiod(PERIODIC_WORK *periodic_work);
BOOL periodic_work_start(PERIODIC_WORK *periodic_work); BOOL visor_periodic_work_start(PERIODIC_WORK *periodic_work);
BOOL periodic_work_stop(PERIODIC_WORK *periodic_work); BOOL visor_periodic_work_stop(PERIODIC_WORK *periodic_work);
#endif #endif
...@@ -35,14 +35,14 @@ ...@@ -35,14 +35,14 @@
typedef struct MYPROCOBJECT_Tag MYPROCOBJECT; typedef struct MYPROCOBJECT_Tag MYPROCOBJECT;
typedef struct MYPROCTYPE_Tag MYPROCTYPE; typedef struct MYPROCTYPE_Tag MYPROCTYPE;
MYPROCOBJECT *proc_CreateObject(MYPROCTYPE *type, const char *name, MYPROCOBJECT *visor_proc_CreateObject(MYPROCTYPE *type, const char *name,
void *context); void *context);
void proc_DestroyObject(MYPROCOBJECT *obj); void visor_proc_DestroyObject(MYPROCOBJECT *obj);
MYPROCTYPE *proc_CreateType(struct proc_dir_entry *procRootDir, MYPROCTYPE *visor_proc_CreateType(struct proc_dir_entry *procRootDir,
const char **name, const char **name,
const char **propertyNames, const char **propertyNames,
void (*show_property)(struct seq_file *, void (*show_property)(struct seq_file *,
void *, int)); void *, int));
void proc_DestroyType(MYPROCTYPE *type); void visor_proc_DestroyType(MYPROCTYPE *type);
#endif #endif
...@@ -39,7 +39,7 @@ void myprintk(const char *myDrvName, const char *devname, ...@@ -39,7 +39,7 @@ void myprintk(const char *myDrvName, const char *devname,
* (not including the trailing '\0' byte) * (not including the trailing '\0' byte)
* @ingroup internal * @ingroup internal
*/ */
int hexDumpToBuffer(char *dest, int visor_hexDumpToBuffer(char *dest,
int destSize, int destSize,
char *prefix, char *prefix,
char *src, char *src,
...@@ -91,7 +91,7 @@ char *cyclesToIterationSeconds(u64 cycles, u64 cyclesPerSecond, ...@@ -91,7 +91,7 @@ char *cyclesToIterationSeconds(u64 cycles, u64 cyclesPerSecond,
u64 iterations, char *buf, size_t bufsize); u64 iterations, char *buf, size_t bufsize);
char *cyclesToSomethingsPerSecond(u64 cycles, u64 cyclesPerSecond, char *cyclesToSomethingsPerSecond(u64 cycles, u64 cyclesPerSecond,
u64 somethings, char *buf, size_t bufsize); u64 somethings, char *buf, size_t bufsize);
struct seq_file *seq_file_new_buffer(void *buf, size_t buf_size); struct seq_file *visor_seq_file_new_buffer(void *buf, size_t buf_size);
void seq_file_done_buffer(struct seq_file *m); void visor_seq_file_done_buffer(struct seq_file *m);
#endif #endif
...@@ -107,7 +107,7 @@ dbg_iounmap(void *addr, char *file, int line) ...@@ -107,7 +107,7 @@ dbg_iounmap(void *addr, char *file, int line)
#define PROC_READ_BUFFER_SIZE 131072 /* size of the buffer to allocate to #define PROC_READ_BUFFER_SIZE 131072 /* size of the buffer to allocate to
* hold all of /proc/XXX/info */ * hold all of /proc/XXX/info */
int util_add_proc_line_ex(int *total, char **buffer, int *buffer_remaining, int uisutil_add_proc_line_ex(int *total, char **buffer, int *buffer_remaining,
char *format, ...); char *format, ...);
int uisctrl_register_req_handler(int type, void *fptr, int uisctrl_register_req_handler(int type, void *fptr,
...@@ -212,9 +212,11 @@ struct chaninfo { ...@@ -212,9 +212,11 @@ struct chaninfo {
/* CopyFragsInfoFromSkb returns the number of entries added to frags array /* CopyFragsInfoFromSkb returns the number of entries added to frags array
* Returns -1 on failure. * Returns -1 on failure.
*/ */
unsigned int util_copy_fragsinfo_from_skb(unsigned char *calling_ctx, unsigned int uisutil_copy_fragsinfo_from_skb(unsigned char *calling_ctx,
void *skb_in, unsigned int firstfraglen, void *skb_in,
unsigned int frags_max, struct phys_info frags[]); unsigned int firstfraglen,
unsigned int frags_max,
struct phys_info frags[]);
static inline unsigned int static inline unsigned int
Issue_VMCALL_IO_CONTROLVM_ADDR(U64 *ControlAddress, U32 *ControlBytes) Issue_VMCALL_IO_CONTROLVM_ADDR(U64 *ControlAddress, U32 *ControlBytes)
......
...@@ -1624,7 +1624,7 @@ chipset_proc_write(struct file *file, const char __user *buffer, ...@@ -1624,7 +1624,7 @@ chipset_proc_write(struct file *file, const char __user *buffer,
#define PROCLINE(...) \ #define PROCLINE(...) \
do { \ do { \
if (util_add_proc_line_ex(&tot, buff, \ if (uisutil_add_proc_line_ex(&tot, buff, \
buff_len, __VA_ARGS__) < 0) { \ buff_len, __VA_ARGS__) < 0) { \
goto err_done; \ goto err_done; \
} \ } \
......
...@@ -98,8 +98,8 @@ do_locked_client_insert(struct uisqueue_info *queueinfo, ...@@ -98,8 +98,8 @@ do_locked_client_insert(struct uisqueue_info *queueinfo,
acquired = 1; acquired = 1;
queueWasEmpty = SignalQueueIsEmpty(queueinfo->chan, whichqueue); queueWasEmpty = visor_signalqueue_empty(queueinfo->chan, whichqueue);
if (!SignalInsert(queueinfo->chan, whichqueue, pSignal)) if (!visor_signal_insert(queueinfo->chan, whichqueue, pSignal))
RETINT(0); RETINT(0);
ULTRA_CHANNEL_CLIENT_RELEASE_OS(queueinfo->chan, channelId, NULL); ULTRA_CHANNEL_CLIENT_RELEASE_OS(queueinfo->chan, channelId, NULL);
acquired = 0; acquired = 0;
...@@ -138,11 +138,11 @@ uisqueue_put_cmdrsp_with_lock_client(struct uisqueue_info *queueinfo, ...@@ -138,11 +138,11 @@ uisqueue_put_cmdrsp_with_lock_client(struct uisqueue_info *queueinfo,
issueInterruptIfEmpty, issueInterruptIfEmpty,
interruptHandle, channelId)) { interruptHandle, channelId)) {
if (oktowait != OK_TO_WAIT) { if (oktowait != OK_TO_WAIT) {
LOGERR("****FAILED SignalInsert failed; cannot wait; insert aborted\n"); LOGERR("****FAILED visor_signal_insert failed; cannot wait; insert aborted\n");
return 0; /* failed to queue */ return 0; /* failed to queue */
} }
/* try again */ /* try again */
LOGERR("****FAILED SignalInsert failed; waiting to try again\n"); LOGERR("****FAILED visor_signal_insert failed; waiting to try again\n");
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(msecs_to_jiffies(10)); schedule_timeout(msecs_to_jiffies(10));
} }
...@@ -156,7 +156,7 @@ int ...@@ -156,7 +156,7 @@ int
uisqueue_get_cmdrsp(struct uisqueue_info *queueinfo, uisqueue_get_cmdrsp(struct uisqueue_info *queueinfo,
void *cmdrsp, unsigned int whichqueue) void *cmdrsp, unsigned int whichqueue)
{ {
if (!SignalRemove(queueinfo->chan, whichqueue, cmdrsp)) if (!visor_signal_remove(queueinfo->chan, whichqueue, cmdrsp))
return 0; return 0;
queueinfo->packets_received++; queueinfo->packets_received++;
......
...@@ -48,7 +48,7 @@ atomic_t UisUtils_Registered_Services = ATOMIC_INIT(0); ...@@ -48,7 +48,7 @@ atomic_t UisUtils_Registered_Services = ATOMIC_INIT(0);
/*****************************************************/ /*****************************************************/
int int
util_add_proc_line_ex(int *total, char **buffer, int *buffer_remaining, uisutil_add_proc_line_ex(int *total, char **buffer, int *buffer_remaining,
char *format, ...) char *format, ...)
{ {
va_list args; va_list args;
...@@ -69,7 +69,7 @@ util_add_proc_line_ex(int *total, char **buffer, int *buffer_remaining, ...@@ -69,7 +69,7 @@ util_add_proc_line_ex(int *total, char **buffer, int *buffer_remaining,
*total += len; *total += len;
return len; return len;
} }
EXPORT_SYMBOL_GPL(util_add_proc_line_ex); EXPORT_SYMBOL_GPL(uisutil_add_proc_line_ex);
int int
uisctrl_register_req_handler(int type, void *fptr, uisctrl_register_req_handler(int type, void *fptr,
...@@ -185,7 +185,7 @@ uisctrl_unregister_req_handler_ex(GUID switchTypeGuid) ...@@ -185,7 +185,7 @@ uisctrl_unregister_req_handler_ex(GUID switchTypeGuid)
EXPORT_SYMBOL_GPL(uisctrl_unregister_req_handler_ex); EXPORT_SYMBOL_GPL(uisctrl_unregister_req_handler_ex);
/* /*
* unsigned int util_copy_fragsinfo_from_skb(unsigned char *calling_ctx, * unsigned int uisutil_copy_fragsinfo_from_skb(unsigned char *calling_ctx,
* void *skb_in, * void *skb_in,
* unsigned int firstfraglen, * unsigned int firstfraglen,
* unsigned int frags_max, * unsigned int frags_max,
...@@ -203,8 +203,9 @@ EXPORT_SYMBOL_GPL(uisctrl_unregister_req_handler_ex); ...@@ -203,8 +203,9 @@ EXPORT_SYMBOL_GPL(uisctrl_unregister_req_handler_ex);
* entries filled in frags * entries filled in frags
*/ */
unsigned int unsigned int
util_copy_fragsinfo_from_skb(unsigned char *calling_ctx, void *skb_in, uisutil_copy_fragsinfo_from_skb(unsigned char *calling_ctx, void *skb_in,
unsigned int firstfraglen, unsigned int frags_max, unsigned int firstfraglen,
unsigned int frags_max,
struct phys_info frags[]) struct phys_info frags[])
{ {
unsigned int count = 0, ii, size, offset = 0, numfrags; unsigned int count = 0, ii, size, offset = 0, numfrags;
...@@ -259,7 +260,8 @@ util_copy_fragsinfo_from_skb(unsigned char *calling_ctx, void *skb_in, ...@@ -259,7 +260,8 @@ util_copy_fragsinfo_from_skb(unsigned char *calling_ctx, void *skb_in,
for (skbinlist = skb_shinfo(skb)->frag_list; skbinlist; for (skbinlist = skb_shinfo(skb)->frag_list; skbinlist;
skbinlist = skbinlist->next) { skbinlist = skbinlist->next) {
c = util_copy_fragsinfo_from_skb("recursive", skbinlist, c = uisutil_copy_fragsinfo_from_skb("recursive",
skbinlist,
skbinlist->len - skbinlist->len -
skbinlist->data_len, skbinlist->data_len,
frags_max - count, frags_max - count,
...@@ -273,7 +275,7 @@ util_copy_fragsinfo_from_skb(unsigned char *calling_ctx, void *skb_in, ...@@ -273,7 +275,7 @@ util_copy_fragsinfo_from_skb(unsigned char *calling_ctx, void *skb_in,
} }
return count; return count;
} }
EXPORT_SYMBOL_GPL(util_copy_fragsinfo_from_skb); EXPORT_SYMBOL_GPL(uisutil_copy_fragsinfo_from_skb);
static LIST_HEAD(ReqHandlerInfo_list); /* list of ReqHandlerInfo_t */ static LIST_HEAD(ReqHandlerInfo_list); /* list of ReqHandlerInfo_t */
static DEFINE_SPINLOCK(ReqHandlerInfo_list_lock); static DEFINE_SPINLOCK(ReqHandlerInfo_list_lock);
......
...@@ -439,7 +439,7 @@ virthba_ISR(int irq, void *dev_id) ...@@ -439,7 +439,7 @@ virthba_ISR(int irq, void *dev_id)
mask = ~ULTRA_CHANNEL_ENABLE_INTS; mask = ~ULTRA_CHANNEL_ENABLE_INTS;
rc1 = uisqueue_InterlockedAnd(virthbainfo->flags_addr, mask); rc1 = uisqueue_InterlockedAnd(virthbainfo->flags_addr, mask);
} }
if (SignalQueueIsEmpty(pChannelHeader, IOCHAN_FROM_IOPART)) { if (visor_signalqueue_empty(pChannelHeader, IOCHAN_FROM_IOPART)) {
virthbainfo->interrupts_notme++; virthbainfo->interrupts_notme++;
return IRQ_NONE; return IRQ_NONE;
} }
...@@ -1617,7 +1617,8 @@ virthba_serverdown_complete(struct work_struct *work) ...@@ -1617,7 +1617,8 @@ virthba_serverdown_complete(struct work_struct *work)
virthbainfo->serverdown = true; virthbainfo->serverdown = true;
virthbainfo->serverchangingstate = false; virthbainfo->serverchangingstate = false;
/* Return the ServerDown response to Command */ /* Return the ServerDown response to Command */
device_pause_response(virtpcidev->busNo, virtpcidev->deviceNo, 0); visorchipset_device_pause_response(virtpcidev->busNo,
virtpcidev->deviceNo, 0);
} }
/* As per VirtpciFunc returns 1 for success and 0 for failure */ /* As per VirtpciFunc returns 1 for success and 0 for failure */
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#define MYDRVNAME "visorchannel" #define MYDRVNAME "visorchannel"
struct VISORCHANNEL_Tag { struct VISORCHANNEL_Tag {
MEMREGION *memregion; /* from memregion_create() */ MEMREGION *memregion; /* from visor_memregion_create() */
CHANNEL_HEADER chan_hdr; CHANNEL_HEADER chan_hdr;
GUID guid; GUID guid;
ulong size; ulong size;
...@@ -67,24 +67,25 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong channelBytes, ...@@ -67,24 +67,25 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong channelBytes,
/* prepare chan_hdr (abstraction to read/write channel memory) */ /* prepare chan_hdr (abstraction to read/write channel memory) */
if (parent == NULL) if (parent == NULL)
p->memregion = p->memregion =
memregion_create(physaddr, sizeof(CHANNEL_HEADER)); visor_memregion_create(physaddr, sizeof(CHANNEL_HEADER));
else else
p->memregion = p->memregion =
memregion_create_overlapped visor_memregion_create_overlapped(parent->memregion,
(parent->memregion, off, sizeof(CHANNEL_HEADER)); off,
sizeof(CHANNEL_HEADER));
if (p->memregion == NULL) if (p->memregion == NULL)
FAIL("memregion_create failed", 0); FAIL("visor_memregion_create failed", 0);
if (memregion_read(p->memregion, 0, &p->chan_hdr, if (visor_memregion_read(p->memregion, 0, &p->chan_hdr,
sizeof(CHANNEL_HEADER)) < 0) sizeof(CHANNEL_HEADER)) < 0)
FAIL("memregion_read failed", 0); FAIL("visor_memregion_read failed", 0);
if (channelBytes == 0) if (channelBytes == 0)
/* we had better be a CLIENT of this channel */ /* we had better be a CLIENT of this channel */
channelBytes = (ulong) p->chan_hdr.Size; channelBytes = (ulong) p->chan_hdr.Size;
if (STRUCTSEQUAL(guid, Guid0)) if (STRUCTSEQUAL(guid, Guid0))
/* we had better be a CLIENT of this channel */ /* we had better be a CLIENT of this channel */
guid = p->chan_hdr.Type; guid = p->chan_hdr.Type;
if (memregion_resize(p->memregion, channelBytes) < 0) if (visor_memregion_resize(p->memregion, channelBytes) < 0)
FAIL("memregion_resize failed", 0); FAIL("visor_memregion_resize failed", 0);
p->size = channelBytes; p->size = channelBytes;
p->guid = guid; p->guid = guid;
...@@ -143,7 +144,7 @@ visorchannel_destroy(VISORCHANNEL *channel) ...@@ -143,7 +144,7 @@ visorchannel_destroy(VISORCHANNEL *channel)
if (channel == NULL) if (channel == NULL)
return; return;
if (channel->memregion != NULL) { if (channel->memregion != NULL) {
memregion_destroy(channel->memregion); visor_memregion_destroy(channel->memregion);
channel->memregion = NULL; channel->memregion = NULL;
} }
kfree(channel); kfree(channel);
...@@ -153,7 +154,7 @@ EXPORT_SYMBOL_GPL(visorchannel_destroy); ...@@ -153,7 +154,7 @@ EXPORT_SYMBOL_GPL(visorchannel_destroy);
HOSTADDRESS HOSTADDRESS
visorchannel_get_physaddr(VISORCHANNEL *channel) visorchannel_get_physaddr(VISORCHANNEL *channel)
{ {
return memregion_get_physaddr(channel->memregion); return visor_memregion_get_physaddr(channel->memregion);
} }
EXPORT_SYMBOL_GPL(visorchannel_get_physaddr); EXPORT_SYMBOL_GPL(visorchannel_get_physaddr);
...@@ -228,7 +229,8 @@ int ...@@ -228,7 +229,8 @@ int
visorchannel_read(VISORCHANNEL *channel, ulong offset, visorchannel_read(VISORCHANNEL *channel, ulong offset,
void *local, ulong nbytes) void *local, ulong nbytes)
{ {
int rc = memregion_read(channel->memregion, offset, local, nbytes); int rc = visor_memregion_read(channel->memregion, offset,
local, nbytes);
if ((rc >= 0) && (offset == 0) && (nbytes >= sizeof(CHANNEL_HEADER))) if ((rc >= 0) && (offset == 0) && (nbytes >= sizeof(CHANNEL_HEADER)))
memcpy(&channel->chan_hdr, local, sizeof(CHANNEL_HEADER)); memcpy(&channel->chan_hdr, local, sizeof(CHANNEL_HEADER));
return rc; return rc;
...@@ -241,7 +243,7 @@ visorchannel_write(VISORCHANNEL *channel, ulong offset, ...@@ -241,7 +243,7 @@ visorchannel_write(VISORCHANNEL *channel, ulong offset,
{ {
if (offset == 0 && nbytes >= sizeof(CHANNEL_HEADER)) if (offset == 0 && nbytes >= sizeof(CHANNEL_HEADER))
memcpy(&channel->chan_hdr, local, sizeof(CHANNEL_HEADER)); memcpy(&channel->chan_hdr, local, sizeof(CHANNEL_HEADER));
return memregion_write(channel->memregion, offset, local, nbytes); return visor_memregion_write(channel->memregion, offset, local, nbytes);
} }
EXPORT_SYMBOL_GPL(visorchannel_write); EXPORT_SYMBOL_GPL(visorchannel_write);
...@@ -263,7 +265,7 @@ visorchannel_clear(VISORCHANNEL *channel, ulong offset, U8 ch, ulong nbytes) ...@@ -263,7 +265,7 @@ visorchannel_clear(VISORCHANNEL *channel, ulong offset, U8 ch, ulong nbytes)
int x = -1; int x = -1;
if (nbytes < thisbytes) if (nbytes < thisbytes)
thisbytes = nbytes; thisbytes = nbytes;
x = memregion_write(channel->memregion, offset + written, x = visor_memregion_write(channel->memregion, offset + written,
buf, thisbytes); buf, thisbytes);
if (x < 0) if (x < 0)
RETINT(x); RETINT(x);
...@@ -305,8 +307,8 @@ EXPORT_SYMBOL_GPL(visorchannel_get_header); ...@@ -305,8 +307,8 @@ EXPORT_SYMBOL_GPL(visorchannel_get_header);
* into host memory * into host memory
*/ */
#define SIG_WRITE_FIELD(channel, queue, sig_hdr, FIELD) \ #define SIG_WRITE_FIELD(channel, queue, sig_hdr, FIELD) \
(memregion_write(channel->memregion, \ (visor_memregion_write(channel->memregion, \
SIG_QUEUE_OFFSET(&channel->chan_hdr, queue)+\ SIG_QUEUE_OFFSET(&channel->chan_hdr, queue)+ \
offsetof(SIGNAL_QUEUE_HEADER, FIELD), \ offsetof(SIGNAL_QUEUE_HEADER, FIELD), \
&((sig_hdr)->FIELD), \ &((sig_hdr)->FIELD), \
sizeof((sig_hdr)->FIELD)) >= 0) sizeof((sig_hdr)->FIELD)) >= 0)
...@@ -322,12 +324,12 @@ sig_read_header(VISORCHANNEL *channel, U32 queue, ...@@ -322,12 +324,12 @@ sig_read_header(VISORCHANNEL *channel, U32 queue,
/* Read the appropriate SIGNAL_QUEUE_HEADER into local memory. */ /* Read the appropriate SIGNAL_QUEUE_HEADER into local memory. */
if (memregion_read(channel->memregion, if (visor_memregion_read(channel->memregion,
SIG_QUEUE_OFFSET(&channel->chan_hdr, queue), SIG_QUEUE_OFFSET(&channel->chan_hdr, queue),
sig_hdr, sizeof(SIGNAL_QUEUE_HEADER)) < 0) { sig_hdr, sizeof(SIGNAL_QUEUE_HEADER)) < 0) {
ERRDRV("queue=%d SIG_QUEUE_OFFSET=%d", ERRDRV("queue=%d SIG_QUEUE_OFFSET=%d",
queue, (int)SIG_QUEUE_OFFSET(&channel->chan_hdr, queue)); queue, (int)SIG_QUEUE_OFFSET(&channel->chan_hdr, queue));
FAIL("memregion_read of signal queue failed", FALSE); FAIL("visor_memregion_read of signal queue failed", FALSE);
} }
RETBOOL(TRUE); RETBOOL(TRUE);
Away: Away:
...@@ -342,13 +344,16 @@ sig_do_data(VISORCHANNEL *channel, U32 queue, ...@@ -342,13 +344,16 @@ sig_do_data(VISORCHANNEL *channel, U32 queue,
int signal_data_offset = SIG_DATA_OFFSET(&channel->chan_hdr, queue, int signal_data_offset = SIG_DATA_OFFSET(&channel->chan_hdr, queue,
sig_hdr, slot); sig_hdr, slot);
if (is_write) { if (is_write) {
if (memregion_write(channel->memregion, signal_data_offset, if (visor_memregion_write(channel->memregion,
signal_data_offset,
data, sig_hdr->SignalSize) < 0) data, sig_hdr->SignalSize) < 0)
FAIL("memregion_write of signal data failed", FALSE); FAIL("visor_memregion_write of signal data failed",
FALSE);
} else { } else {
if (memregion_read(channel->memregion, signal_data_offset, if (visor_memregion_read(channel->memregion, signal_data_offset,
data, sig_hdr->SignalSize) < 0) data, sig_hdr->SignalSize) < 0)
FAIL("memregion_read of signal data failed", FALSE); FAIL("visor_memregion_read of signal data failed",
FALSE);
} }
RETBOOL(TRUE); RETBOOL(TRUE);
Away: Away:
...@@ -414,9 +419,10 @@ visorchannel_signalremove(VISORCHANNEL *channel, U32 queue, void *msg) ...@@ -414,9 +419,10 @@ visorchannel_signalremove(VISORCHANNEL *channel, U32 queue, void *msg)
*/ */
MEMORYBARRIER; MEMORYBARRIER;
if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, Tail)) if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, Tail))
FAIL("memregion_write of Tail failed", FALSE); FAIL("visor_memregion_write of Tail failed", FALSE);
if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, NumSignalsReceived)) if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, NumSignalsReceived))
FAIL("memregion_write of NumSignalsReceived failed", FALSE); FAIL("visor_memregion_write of NumSignalsReceived failed",
FALSE);
RETBOOL(TRUE); RETBOOL(TRUE);
...@@ -468,9 +474,10 @@ visorchannel_safesignalremove(VISORCHANNEL *channel, U32 queue, void *msg) ...@@ -468,9 +474,10 @@ visorchannel_safesignalremove(VISORCHANNEL *channel, U32 queue, void *msg)
*/ */
MEMORYBARRIER; MEMORYBARRIER;
if (!SIG_WRITE_FIELD(channel, queue, &unsafe_sqh, Tail)) if (!SIG_WRITE_FIELD(channel, queue, &unsafe_sqh, Tail))
FAIL("memregion_write of Tail failed", FALSE); FAIL("visor_memregion_write of Tail failed", FALSE);
if (!SIG_WRITE_FIELD(channel, queue, &unsafe_sqh, NumSignalsReceived)) if (!SIG_WRITE_FIELD(channel, queue, &unsafe_sqh, NumSignalsReceived))
FAIL("memregion_write of NumSignalsReceived failed", FALSE); FAIL("visor_memregion_write of NumSignalsReceived failed",
FALSE);
RETBOOL(TRUE); RETBOOL(TRUE);
...@@ -501,7 +508,8 @@ visorchannel_signalinsert(VISORCHANNEL *channel, U32 queue, void *msg) ...@@ -501,7 +508,8 @@ visorchannel_signalinsert(VISORCHANNEL *channel, U32 queue, void *msg)
#endif #endif
sig_hdr.NumOverflows++; sig_hdr.NumOverflows++;
if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, NumOverflows)) if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, NumOverflows))
FAIL("memregion_write of NumOverflows failed", FALSE); FAIL("visor_memregion_write of NumOverflows failed",
FALSE);
RETBOOL(FALSE); RETBOOL(FALSE);
} }
...@@ -514,9 +522,9 @@ visorchannel_signalinsert(VISORCHANNEL *channel, U32 queue, void *msg) ...@@ -514,9 +522,9 @@ visorchannel_signalinsert(VISORCHANNEL *channel, U32 queue, void *msg)
*/ */
MEMORYBARRIER; MEMORYBARRIER;
if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, Head)) if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, Head))
FAIL("memregion_write of Head failed", FALSE); FAIL("visor_memregion_write of Head failed", FALSE);
if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, NumSignalsSent)) if (!SIG_WRITE_FIELD(channel, queue, &sig_hdr, NumSignalsSent))
FAIL("memregion_write of NumSignalsSent failed", FALSE); FAIL("visor_memregion_write of NumSignalsSent failed", FALSE);
RETBOOL(TRUE); RETBOOL(TRUE);
...@@ -595,7 +603,8 @@ visorchannel_safesignalinsert(VISORCHANNEL *channel, U32 queue, void *msg) ...@@ -595,7 +603,8 @@ visorchannel_safesignalinsert(VISORCHANNEL *channel, U32 queue, void *msg)
#endif #endif
unsafe_sqh.NumOverflows++; unsafe_sqh.NumOverflows++;
if (!SIG_WRITE_FIELD(channel, queue, &unsafe_sqh, NumOverflows)) if (!SIG_WRITE_FIELD(channel, queue, &unsafe_sqh, NumOverflows))
FAIL("memregion_write of NumOverflows failed", FALSE); FAIL("visor_memregion_write of NumOverflows failed",
FALSE);
RETBOOL(FALSE); RETBOOL(FALSE);
} }
...@@ -608,9 +617,9 @@ visorchannel_safesignalinsert(VISORCHANNEL *channel, U32 queue, void *msg) ...@@ -608,9 +617,9 @@ visorchannel_safesignalinsert(VISORCHANNEL *channel, U32 queue, void *msg)
*/ */
MEMORYBARRIER; MEMORYBARRIER;
if (!SIG_WRITE_FIELD(channel, queue, &unsafe_sqh, Head)) if (!SIG_WRITE_FIELD(channel, queue, &unsafe_sqh, Head))
FAIL("memregion_write of Head failed", FALSE); FAIL("visor_memregion_write of Head failed", FALSE);
if (!SIG_WRITE_FIELD(channel, queue, &unsafe_sqh, NumSignalsSent)) if (!SIG_WRITE_FIELD(channel, queue, &unsafe_sqh, NumSignalsSent))
FAIL("memregion_write of NumSignalsSent failed", FALSE); FAIL("visor_memregion_write of NumSignalsSent failed", FALSE);
RETBOOL(TRUE); RETBOOL(TRUE);
...@@ -667,8 +676,8 @@ visorchannel_debug(VISORCHANNEL *channel, int nQueues, ...@@ -667,8 +676,8 @@ visorchannel_debug(VISORCHANNEL *channel, int nQueues,
ERRDRV("%s no memregion", __func__); ERRDRV("%s no memregion", __func__);
return; return;
} }
addr = memregion_get_physaddr(memregion); addr = visor_memregion_get_physaddr(memregion);
nbytes_region = memregion_get_nbytes(memregion); nbytes_region = visor_memregion_get_nbytes(memregion);
errcode = visorchannel_read(channel, off, errcode = visorchannel_read(channel, off,
phdr, sizeof(CHANNEL_HEADER)); phdr, sizeof(CHANNEL_HEADER));
if (errcode < 0) { if (errcode < 0) {
...@@ -748,7 +757,7 @@ visorchannel_dump_section(VISORCHANNEL *chan, char *s, ...@@ -748,7 +757,7 @@ visorchannel_dump_section(VISORCHANNEL *chan, char *s,
goto Away; goto Away;
} }
seq_printf(seq, "channel %s:\n", s); seq_printf(seq, "channel %s:\n", s);
hexDumpToBuffer(fmtbuf, fmtbufsize, " ", buf, len, 16); visor_hexDumpToBuffer(fmtbuf, fmtbufsize, " ", buf, len, 16);
for (i = 0; fmtbuf[i] != '\0'; i++) for (i = 0; fmtbuf[i] != '\0'; i++)
seq_printf(seq, "%c", fmtbuf[i]); seq_printf(seq, "%c", fmtbuf[i]);
......
...@@ -90,10 +90,10 @@ parser_init_guts(U64 addr, U32 bytes, BOOL isLocal, ...@@ -90,10 +90,10 @@ parser_init_guts(U64 addr, U32 bytes, BOOL isLocal,
p = __va((ulong) (addr)); p = __va((ulong) (addr));
memcpy(ctx->data, p, bytes); memcpy(ctx->data, p, bytes);
} else { } else {
rgn = memregion_create(addr, bytes); rgn = visor_memregion_create(addr, bytes);
if (!rgn) if (!rgn)
RETPTR(NULL); RETPTR(NULL);
if (memregion_read(rgn, 0, ctx->data, bytes) < 0) if (visor_memregion_read(rgn, 0, ctx->data, bytes) < 0)
RETPTR(NULL); RETPTR(NULL);
} }
if (!hasStandardPayloadHeader) { if (!hasStandardPayloadHeader) {
...@@ -126,7 +126,7 @@ parser_init_guts(U64 addr, U32 bytes, BOOL isLocal, ...@@ -126,7 +126,7 @@ parser_init_guts(U64 addr, U32 bytes, BOOL isLocal,
Away: Away:
if (rgn) { if (rgn) {
memregion_destroy(rgn); visor_memregion_destroy(rgn);
rgn = NULL; rgn = NULL;
} }
if (rc) if (rc)
......
...@@ -268,7 +268,7 @@ visorchipset_register_busdev_server(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers, ...@@ -268,7 +268,7 @@ visorchipset_register_busdev_server(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
typedef void (*SPARREPORTEVENT_COMPLETE_FUNC) (CONTROLVM_MESSAGE *msg, typedef void (*SPARREPORTEVENT_COMPLETE_FUNC) (CONTROLVM_MESSAGE *msg,
int status); int status);
void device_pause_response(ulong busNo, ulong devNo, int response); void visorchipset_device_pause_response(ulong busNo, ulong devNo, int response);
BOOL visorchipset_get_bus_info(ulong busNo, VISORCHIPSET_BUS_INFO *busInfo); BOOL visorchipset_get_bus_info(ulong busNo, VISORCHIPSET_BUS_INFO *busInfo);
BOOL visorchipset_get_device_info(ulong busNo, ulong devNo, BOOL visorchipset_get_device_info(ulong busNo, ulong devNo,
......
...@@ -354,7 +354,7 @@ static VISORCHIPSET_BUSDEV_RESPONDERS BusDev_Responders = { ...@@ -354,7 +354,7 @@ static VISORCHIPSET_BUSDEV_RESPONDERS BusDev_Responders = {
.bus_destroy = bus_destroy_response, .bus_destroy = bus_destroy_response,
.device_create = device_create_response, .device_create = device_create_response,
.device_destroy = device_destroy_response, .device_destroy = device_destroy_response,
.device_pause = device_pause_response, .device_pause = visorchipset_device_pause_response,
.device_resume = device_resume_response, .device_resume = device_resume_response,
}; };
...@@ -514,7 +514,7 @@ busInfo_clear(void *v) ...@@ -514,7 +514,7 @@ busInfo_clear(void *v)
VISORCHIPSET_BUS_INFO *p = (VISORCHIPSET_BUS_INFO *) (v); VISORCHIPSET_BUS_INFO *p = (VISORCHIPSET_BUS_INFO *) (v);
if (p->procObject) { if (p->procObject) {
proc_DestroyObject(p->procObject); visor_proc_DestroyObject(p->procObject);
p->procObject = NULL; p->procObject = NULL;
} }
kfree(p->name); kfree(p->name);
...@@ -1184,7 +1184,7 @@ bus_configure(CONTROLVM_MESSAGE *inmsg, PARSER_CONTEXT *parser_ctx) ...@@ -1184,7 +1184,7 @@ bus_configure(CONTROLVM_MESSAGE *inmsg, PARSER_CONTEXT *parser_ctx)
visorchannel_GUID_id(&pBusInfo->partitionGuid, s); visorchannel_GUID_id(&pBusInfo->partitionGuid, s);
pBusInfo->procObject = pBusInfo->procObject =
proc_CreateObject(PartitionType, s, (void *) (pBusInfo)); visor_proc_CreateObject(PartitionType, s, (void *) (pBusInfo));
if (pBusInfo->procObject == NULL) { if (pBusInfo->procObject == NULL) {
LOGERR("CONTROLVM_BUS_CONFIGURE Failed: busNo=%lu failed to create /proc entry", LOGERR("CONTROLVM_BUS_CONFIGURE Failed: busNo=%lu failed to create /proc entry",
busNo); busNo);
...@@ -2225,14 +2225,14 @@ device_destroy_response(ulong busNo, ulong devNo, int response) ...@@ -2225,14 +2225,14 @@ device_destroy_response(ulong busNo, ulong devNo, int response)
} }
void void
device_pause_response(ulong busNo, ulong devNo, int response) visorchipset_device_pause_response(ulong busNo, ulong devNo, int response)
{ {
device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE, device_changestate_responder(CONTROLVM_DEVICE_CHANGESTATE,
busNo, devNo, response, busNo, devNo, response,
SegmentStateStandby); SegmentStateStandby);
} }
EXPORT_SYMBOL_GPL(device_pause_response); EXPORT_SYMBOL_GPL(visorchipset_device_pause_response);
static void static void
device_resume_response(ulong busNo, ulong devNo, int response) device_resume_response(ulong busNo, ulong devNo, int response)
...@@ -2705,15 +2705,16 @@ visorchipset_init(void) ...@@ -2705,15 +2705,16 @@ visorchipset_init(void)
InitPartitionProperties(); InitPartitionProperties();
InitControlVmProperties(); InitControlVmProperties();
PartitionType = proc_CreateType(ProcDir, PartitionTypeNames, PartitionType = visor_proc_CreateType(ProcDir, PartitionTypeNames,
(const char **) PartitionPropertyNames, (const char **)
PartitionPropertyNames,
&show_partition_property); &show_partition_property);
ControlVmType = ControlVmType =
proc_CreateType(ProcDir, ControlVmTypeNames, visor_proc_CreateType(ProcDir, ControlVmTypeNames,
(const char **) ControlVmPropertyNames, (const char **) ControlVmPropertyNames,
&show_controlvm_property); &show_controlvm_property);
ControlVmObject = proc_CreateObject(ControlVmType, NULL, NULL); ControlVmObject = visor_proc_CreateObject(ControlVmType, NULL, NULL);
/* Setup Installation fields */ /* Setup Installation fields */
installer_file = proc_create("installer", 0644, ProcDir, installer_file = proc_create("installer", 0644, ProcDir,
...@@ -2813,17 +2814,17 @@ visorchipset_exit(void) ...@@ -2813,17 +2814,17 @@ visorchipset_exit(void)
} }
filexfer_destructor(); filexfer_destructor();
if (ControlVmObject) { if (ControlVmObject) {
proc_DestroyObject(ControlVmObject); visor_proc_DestroyObject(ControlVmObject);
ControlVmObject = NULL; ControlVmObject = NULL;
} }
cleanup_controlvm_structures(); cleanup_controlvm_structures();
if (ControlVmType) { if (ControlVmType) {
proc_DestroyType(ControlVmType); visor_proc_DestroyType(ControlVmType);
ControlVmType = NULL; ControlVmType = NULL;
} }
if (PartitionType) { if (PartitionType) {
proc_DestroyType(PartitionType); visor_proc_DestroyType(PartitionType);
PartitionType = NULL; PartitionType = NULL;
} }
if (diag_proc_dir) { if (diag_proc_dir) {
......
...@@ -37,12 +37,12 @@ struct CHARQUEUE_Tag { ...@@ -37,12 +37,12 @@ struct CHARQUEUE_Tag {
CHARQUEUE *charqueue_create(ulong nslots) CHARQUEUE *visor_charqueue_create(ulong nslots)
{ {
int alloc_size = sizeof(CHARQUEUE) + nslots + 1; int alloc_size = sizeof(CHARQUEUE) + nslots + 1;
CHARQUEUE *cq = kmalloc(alloc_size, GFP_KERNEL|__GFP_NORETRY); CHARQUEUE *cq = kmalloc(alloc_size, GFP_KERNEL|__GFP_NORETRY);
if (cq == NULL) { if (cq == NULL) {
ERRDRV("charqueue_create allocation failed (alloc_size=%d)", ERRDRV("visor_charqueue_create allocation failed (alloc_size=%d)",
alloc_size); alloc_size);
return NULL; return NULL;
} }
...@@ -52,11 +52,11 @@ CHARQUEUE *charqueue_create(ulong nslots) ...@@ -52,11 +52,11 @@ CHARQUEUE *charqueue_create(ulong nslots)
spin_lock_init(&cq->lock); spin_lock_init(&cq->lock);
return cq; return cq;
} }
EXPORT_SYMBOL_GPL(charqueue_create); EXPORT_SYMBOL_GPL(visor_charqueue_create);
void charqueue_enqueue(CHARQUEUE *charqueue, unsigned char c) void visor_charqueue_enqueue(CHARQUEUE *charqueue, unsigned char c)
{ {
int alloc_slots = charqueue->nslots+1; /* 1 slot is always empty */ int alloc_slots = charqueue->nslots+1; /* 1 slot is always empty */
...@@ -68,11 +68,11 @@ void charqueue_enqueue(CHARQUEUE *charqueue, unsigned char c) ...@@ -68,11 +68,11 @@ void charqueue_enqueue(CHARQUEUE *charqueue, unsigned char c)
charqueue->buf[charqueue->head] = c; charqueue->buf[charqueue->head] = c;
spin_unlock(&charqueue->lock); spin_unlock(&charqueue->lock);
} }
EXPORT_SYMBOL_GPL(charqueue_enqueue); EXPORT_SYMBOL_GPL(visor_charqueue_enqueue);
BOOL charqueue_is_empty(CHARQUEUE *charqueue) BOOL visor_charqueue_is_empty(CHARQUEUE *charqueue)
{ {
BOOL b; BOOL b;
spin_lock(&charqueue->lock); spin_lock(&charqueue->lock);
...@@ -80,7 +80,7 @@ BOOL charqueue_is_empty(CHARQUEUE *charqueue) ...@@ -80,7 +80,7 @@ BOOL charqueue_is_empty(CHARQUEUE *charqueue)
spin_unlock(&charqueue->lock); spin_unlock(&charqueue->lock);
return b; return b;
} }
EXPORT_SYMBOL_GPL(charqueue_is_empty); EXPORT_SYMBOL_GPL(visor_charqueue_is_empty);
...@@ -109,7 +109,7 @@ int charqueue_dequeue(CHARQUEUE *charqueue) ...@@ -109,7 +109,7 @@ int charqueue_dequeue(CHARQUEUE *charqueue)
int charqueue_dequeue_n(CHARQUEUE *charqueue, unsigned char *buf, int n) int visor_charqueue_dequeue_n(CHARQUEUE *charqueue, unsigned char *buf, int n)
{ {
int rc = -1, counter = 0, c; int rc = -1, counter = 0, c;
...@@ -131,14 +131,14 @@ int charqueue_dequeue_n(CHARQUEUE *charqueue, unsigned char *buf, int n) ...@@ -131,14 +131,14 @@ int charqueue_dequeue_n(CHARQUEUE *charqueue, unsigned char *buf, int n)
spin_unlock(&charqueue->lock); spin_unlock(&charqueue->lock);
return rc; return rc;
} }
EXPORT_SYMBOL_GPL(charqueue_dequeue_n); EXPORT_SYMBOL_GPL(visor_charqueue_dequeue_n);
void charqueue_destroy(CHARQUEUE *charqueue) void visor_charqueue_destroy(CHARQUEUE *charqueue)
{ {
if (charqueue == NULL) if (charqueue == NULL)
return; return;
kfree(charqueue); kfree(charqueue);
} }
EXPORT_SYMBOL_GPL(charqueue_destroy); EXPORT_SYMBOL_GPL(visor_charqueue_destroy);
...@@ -26,12 +26,12 @@ ...@@ -26,12 +26,12 @@
*/ */
typedef struct CHARQUEUE_Tag CHARQUEUE; typedef struct CHARQUEUE_Tag CHARQUEUE;
CHARQUEUE *charqueue_create(ulong nslots); CHARQUEUE *visor_charqueue_create(ulong nslots);
void charqueue_enqueue(CHARQUEUE *charqueue, unsigned char c); void visor_charqueue_enqueue(CHARQUEUE *charqueue, unsigned char c);
int charqueue_dequeue(CHARQUEUE *charqueue); int charqueue_dequeue(CHARQUEUE *charqueue);
int charqueue_dequeue_n(CHARQUEUE *charqueue, unsigned char *buf, int n); int visor_charqueue_dequeue_n(CHARQUEUE *charqueue, unsigned char *buf, int n);
BOOL charqueue_is_empty(CHARQUEUE *charqueue); BOOL visor_charqueue_is_empty(CHARQUEUE *charqueue);
void charqueue_destroy(CHARQUEUE *charqueue); void visor_charqueue_destroy(CHARQUEUE *charqueue);
#endif #endif
...@@ -20,14 +20,14 @@ ...@@ -20,14 +20,14 @@
* does it know anything about what information to reveal as part of the proc * does it know anything about what information to reveal as part of the proc
* entries. The 2 functions that take care of displaying device and * entries. The 2 functions that take care of displaying device and
* driver specific information are passed as parameters to * driver specific information are passed as parameters to
* easyproc_InitDriver(). * visor_easyproc_InitDriver().
* *
* void show_device_info(struct seq_file *seq, void *p); * void show_device_info(struct seq_file *seq, void *p);
* void show_driver_info(struct seq_file *seq); * void show_driver_info(struct seq_file *seq);
* *
* The second parameter to show_device_info is actually a pointer to the * The second parameter to show_device_info is actually a pointer to the
* device-specific info to show. It is the context that was originally * device-specific info to show. It is the context that was originally
* passed to easyproc_InitDevice(). * passed to visor_easyproc_InitDevice().
* *
****************************************************************************** ******************************************************************************
*/ */
...@@ -105,10 +105,11 @@ static const struct file_operations proc_fops_device_property = { ...@@ -105,10 +105,11 @@ static const struct file_operations proc_fops_device_property = {
void easyproc_InitDriver(struct easyproc_driver_info *pdriver, void visor_easyproc_InitDriver(struct easyproc_driver_info *pdriver,
char *procId, char *procId,
void (*show_driver_info)(struct seq_file *), void (*show_driver_info)(struct seq_file *),
void (*show_device_info)(struct seq_file *, void *)) void (*show_device_info)(struct seq_file *,
void *))
{ {
memset(pdriver, 0, sizeof(struct easyproc_driver_info)); memset(pdriver, 0, sizeof(struct easyproc_driver_info));
pdriver->ProcId = procId; pdriver->ProcId = procId;
...@@ -135,29 +136,33 @@ void easyproc_InitDriver(struct easyproc_driver_info *pdriver, ...@@ -135,29 +136,33 @@ void easyproc_InitDriver(struct easyproc_driver_info *pdriver,
pdriver->ProcId); pdriver->ProcId);
} }
} }
EXPORT_SYMBOL_GPL(easyproc_InitDriver); EXPORT_SYMBOL_GPL(visor_easyproc_InitDriver);
void easyproc_InitDriverEx(struct easyproc_driver_info *pdriver, void visor_easyproc_InitDriverEx(struct easyproc_driver_info *pdriver,
char *procId, char *procId,
void (*show_driver_info)(struct seq_file *), void (*show_driver_info)(struct seq_file *),
void (*show_device_info)(struct seq_file *, void *), void (*show_device_info)(struct seq_file *,
void (*write_driver_info)(char *buf, size_t count, void *),
void (*write_driver_info)(char *buf,
size_t count,
loff_t *ppos), loff_t *ppos),
void (*write_device_info)(char *buf, size_t count, void (*write_device_info)(char *buf,
loff_t *ppos, void *p)) size_t count,
loff_t *ppos,
void *p))
{ {
easyproc_InitDriver(pdriver, procId, visor_easyproc_InitDriver(pdriver, procId,
show_driver_info, show_device_info); show_driver_info, show_device_info);
pdriver->Write_driver_info = write_driver_info; pdriver->Write_driver_info = write_driver_info;
pdriver->Write_device_info = write_device_info; pdriver->Write_device_info = write_device_info;
} }
EXPORT_SYMBOL_GPL(easyproc_InitDriverEx); EXPORT_SYMBOL_GPL(visor_easyproc_InitDriverEx);
void easyproc_DeInitDriver(struct easyproc_driver_info *pdriver) void visor_easyproc_DeInitDriver(struct easyproc_driver_info *pdriver)
{ {
if (pdriver->ProcDriverDiagFile != NULL) { if (pdriver->ProcDriverDiagFile != NULL) {
remove_proc_entry("diag", pdriver->ProcDriverDir); remove_proc_entry("diag", pdriver->ProcDriverDir);
...@@ -181,11 +186,11 @@ void easyproc_DeInitDriver(struct easyproc_driver_info *pdriver) ...@@ -181,11 +186,11 @@ void easyproc_DeInitDriver(struct easyproc_driver_info *pdriver)
pdriver->Write_driver_info = NULL; pdriver->Write_driver_info = NULL;
pdriver->Write_device_info = NULL; pdriver->Write_device_info = NULL;
} }
EXPORT_SYMBOL_GPL(easyproc_DeInitDriver); EXPORT_SYMBOL_GPL(visor_easyproc_DeInitDriver);
void easyproc_InitDevice(struct easyproc_driver_info *pdriver, void visor_easyproc_InitDevice(struct easyproc_driver_info *pdriver,
struct easyproc_device_info *p, int devno, struct easyproc_device_info *p, int devno,
void *devdata) void *devdata)
{ {
...@@ -210,12 +215,13 @@ void easyproc_InitDevice(struct easyproc_driver_info *pdriver, ...@@ -210,12 +215,13 @@ void easyproc_InitDevice(struct easyproc_driver_info *pdriver,
memset(&(p->device_property_info[0]), 0, memset(&(p->device_property_info[0]), 0,
sizeof(p->device_property_info)); sizeof(p->device_property_info));
} }
EXPORT_SYMBOL_GPL(easyproc_InitDevice); EXPORT_SYMBOL_GPL(visor_easyproc_InitDevice);
void easyproc_CreateDeviceProperty(struct easyproc_device_info *p, void visor_easyproc_CreateDeviceProperty(struct easyproc_device_info *p,
void (*show_property_info)(struct seq_file *, void *), void (*show_property_info)
(struct seq_file *, void *),
char *property_name) char *property_name)
{ {
size_t i; size_t i;
...@@ -253,11 +259,11 @@ void easyproc_CreateDeviceProperty(struct easyproc_device_info *p, ...@@ -253,11 +259,11 @@ void easyproc_CreateDeviceProperty(struct easyproc_device_info *p,
} }
px->show_device_property_info = show_property_info; px->show_device_property_info = show_property_info;
} }
EXPORT_SYMBOL_GPL(easyproc_CreateDeviceProperty); EXPORT_SYMBOL_GPL(visor_easyproc_CreateDeviceProperty);
void easyproc_DeInitDevice(struct easyproc_driver_info *pdriver, void visor_easyproc_DeInitDevice(struct easyproc_driver_info *pdriver,
struct easyproc_device_info *p, int devno) struct easyproc_device_info *p, int devno)
{ {
size_t i; size_t i;
...@@ -282,7 +288,7 @@ void easyproc_DeInitDevice(struct easyproc_driver_info *pdriver, ...@@ -282,7 +288,7 @@ void easyproc_DeInitDevice(struct easyproc_driver_info *pdriver,
p->devdata = NULL; p->devdata = NULL;
p->pdriver = NULL; p->pdriver = NULL;
} }
EXPORT_SYMBOL_GPL(easyproc_DeInitDevice); EXPORT_SYMBOL_GPL(visor_easyproc_DeInitDevice);
......
...@@ -61,26 +61,32 @@ struct easyproc_device_info { ...@@ -61,26 +61,32 @@ struct easyproc_device_info {
struct easyproc_device_property_info device_property_info[10]; struct easyproc_device_property_info device_property_info[10];
}; };
void easyproc_InitDevice(struct easyproc_driver_info *pdriver, void visor_easyproc_InitDevice(struct easyproc_driver_info *pdriver,
struct easyproc_device_info *p, int devno, struct easyproc_device_info *p, int devno,
void *devdata); void *devdata);
void easyproc_DeInitDevice(struct easyproc_driver_info *pdriver, void visor_easyproc_DeInitDevice(struct easyproc_driver_info *pdriver,
struct easyproc_device_info *p, int devno); struct easyproc_device_info *p, int devno);
void easyproc_InitDriver(struct easyproc_driver_info *pdriver, void visor_easyproc_InitDriver(struct easyproc_driver_info *pdriver,
char *procId, char *procId,
void (*show_driver_info)(struct seq_file *), void (*show_driver_info)(struct seq_file *),
void (*show_device_info)(struct seq_file *, void *)); void (*show_device_info)(struct seq_file *,
void easyproc_InitDriverEx(struct easyproc_driver_info *pdriver, void *));
void visor_easyproc_InitDriverEx(struct easyproc_driver_info *pdriver,
char *procId, char *procId,
void (*show_driver_info)(struct seq_file *), void (*show_driver_info)(struct seq_file *),
void (*show_device_info)(struct seq_file *, void *), void (*show_device_info)(struct seq_file *,
void (*Write_driver_info)(char *buf, size_t count, void *),
void (*Write_driver_info)(char *buf,
size_t count,
loff_t *ppos), loff_t *ppos),
void (*Write_device_info)(char *buf, size_t count, void (*Write_device_info)(char *buf,
loff_t *ppos, void *p)); size_t count,
void easyproc_DeInitDriver(struct easyproc_driver_info *pdriver); loff_t *ppos,
void easyproc_CreateDeviceProperty(struct easyproc_device_info *p, void *p));
void (*show_property_info)(struct seq_file *, void *), void visor_easyproc_DeInitDriver(struct easyproc_driver_info *pdriver);
void visor_easyproc_CreateDeviceProperty(struct easyproc_device_info *p,
void (*show_property_info)
(struct seq_file *, void *),
char *property_name); char *property_name);
#endif #endif
...@@ -25,19 +25,19 @@ ...@@ -25,19 +25,19 @@
*/ */
typedef struct MEMREGION_Tag MEMREGION; typedef struct MEMREGION_Tag MEMREGION;
MEMREGION *memregion_create(HOSTADDRESS physaddr, ulong nbytes); MEMREGION *visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes);
MEMREGION *memregion_create_overlapped(MEMREGION *parent, MEMREGION *visor_memregion_create_overlapped(MEMREGION *parent,
ulong offset, ulong nbytes); ulong offset, ulong nbytes);
int memregion_resize(MEMREGION *memregion, ulong newsize); int visor_memregion_resize(MEMREGION *memregion, ulong newsize);
int memregion_read(MEMREGION *memregion, int visor_memregion_read(MEMREGION *memregion,
ulong offset, void *dest, ulong nbytes); ulong offset, void *dest, ulong nbytes);
int memregion_write(MEMREGION *memregion, int visor_memregion_write(MEMREGION *memregion,
ulong offset, void *src, ulong nbytes); ulong offset, void *src, ulong nbytes);
void memregion_destroy(MEMREGION *memregion); void visor_memregion_destroy(MEMREGION *memregion);
HOSTADDRESS memregion_get_physaddr(MEMREGION *memregion); HOSTADDRESS visor_memregion_get_physaddr(MEMREGION *memregion);
ulong memregion_get_nbytes(MEMREGION *memregion); ulong visor_memregion_get_nbytes(MEMREGION *memregion);
void memregion_dump(MEMREGION *memregion, char *s, void memregion_dump(MEMREGION *memregion, char *s,
ulong off, ulong len, struct seq_file *seq); ulong off, ulong len, struct seq_file *seq);
void *memregion_get_pointer(MEMREGION *memregion); void *visor_memregion_get_pointer(MEMREGION *memregion);
#endif #endif
...@@ -38,13 +38,13 @@ static BOOL mapit(MEMREGION *memregion); ...@@ -38,13 +38,13 @@ static BOOL mapit(MEMREGION *memregion);
static void unmapit(MEMREGION *memregion); static void unmapit(MEMREGION *memregion);
MEMREGION * MEMREGION *
memregion_create(HOSTADDRESS physaddr, ulong nbytes) visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes)
{ {
MEMREGION *rc = NULL; MEMREGION *rc = NULL;
MEMREGION *memregion = kmalloc(sizeof(MEMREGION), MEMREGION *memregion = kmalloc(sizeof(MEMREGION),
GFP_KERNEL|__GFP_NORETRY); GFP_KERNEL|__GFP_NORETRY);
if (memregion == NULL) { if (memregion == NULL) {
ERRDRV("memregion_create allocation failed"); ERRDRV("visor_memregion_create allocation failed");
return NULL; return NULL;
} }
memset(memregion, 0, sizeof(MEMREGION)); memset(memregion, 0, sizeof(MEMREGION));
...@@ -58,16 +58,16 @@ memregion_create(HOSTADDRESS physaddr, ulong nbytes) ...@@ -58,16 +58,16 @@ memregion_create(HOSTADDRESS physaddr, ulong nbytes)
Away: Away:
if (rc == NULL) { if (rc == NULL) {
if (memregion != NULL) { if (memregion != NULL) {
memregion_destroy(memregion); visor_memregion_destroy(memregion);
memregion = NULL; memregion = NULL;
} }
} }
return rc; return rc;
} }
EXPORT_SYMBOL_GPL(memregion_create); EXPORT_SYMBOL_GPL(visor_memregion_create);
MEMREGION * MEMREGION *
memregion_create_overlapped(MEMREGION *parent, ulong offset, ulong nbytes) visor_memregion_create_overlapped(MEMREGION *parent, ulong offset, ulong nbytes)
{ {
MEMREGION *memregion = NULL; MEMREGION *memregion = NULL;
...@@ -98,7 +98,7 @@ memregion_create_overlapped(MEMREGION *parent, ulong offset, ulong nbytes) ...@@ -98,7 +98,7 @@ memregion_create_overlapped(MEMREGION *parent, ulong offset, ulong nbytes)
memregion->overlapped = TRUE; memregion->overlapped = TRUE;
return memregion; return memregion;
} }
EXPORT_SYMBOL_GPL(memregion_create_overlapped); EXPORT_SYMBOL_GPL(visor_memregion_create_overlapped);
static BOOL static BOOL
...@@ -136,28 +136,28 @@ unmapit(MEMREGION *memregion) ...@@ -136,28 +136,28 @@ unmapit(MEMREGION *memregion)
} }
HOSTADDRESS HOSTADDRESS
memregion_get_physaddr(MEMREGION *memregion) visor_memregion_get_physaddr(MEMREGION *memregion)
{ {
return memregion->physaddr; return memregion->physaddr;
} }
EXPORT_SYMBOL_GPL(memregion_get_physaddr); EXPORT_SYMBOL_GPL(visor_memregion_get_physaddr);
ulong ulong
memregion_get_nbytes(MEMREGION *memregion) visor_memregion_get_nbytes(MEMREGION *memregion)
{ {
return memregion->nbytes; return memregion->nbytes;
} }
EXPORT_SYMBOL_GPL(memregion_get_nbytes); EXPORT_SYMBOL_GPL(visor_memregion_get_nbytes);
void * void *
memregion_get_pointer(MEMREGION *memregion) visor_memregion_get_pointer(MEMREGION *memregion)
{ {
return memregion->mapped; return memregion->mapped;
} }
EXPORT_SYMBOL_GPL(memregion_get_pointer); EXPORT_SYMBOL_GPL(visor_memregion_get_pointer);
int int
memregion_resize(MEMREGION *memregion, ulong newsize) visor_memregion_resize(MEMREGION *memregion, ulong newsize)
{ {
if (newsize == memregion->nbytes) if (newsize == memregion->nbytes)
return 0; return 0;
...@@ -174,7 +174,7 @@ memregion_resize(MEMREGION *memregion, ulong newsize) ...@@ -174,7 +174,7 @@ memregion_resize(MEMREGION *memregion, ulong newsize)
} }
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(memregion_resize); EXPORT_SYMBOL_GPL(visor_memregion_resize);
static int static int
...@@ -195,21 +195,23 @@ memregion_readwrite(BOOL is_write, ...@@ -195,21 +195,23 @@ memregion_readwrite(BOOL is_write,
} }
int int
memregion_read(MEMREGION *memregion, ulong offset, void *dest, ulong nbytes) visor_memregion_read(MEMREGION *memregion, ulong offset, void *dest,
ulong nbytes)
{ {
return memregion_readwrite(FALSE, memregion, offset, dest, nbytes); return memregion_readwrite(FALSE, memregion, offset, dest, nbytes);
} }
EXPORT_SYMBOL_GPL(memregion_read); EXPORT_SYMBOL_GPL(visor_memregion_read);
int int
memregion_write(MEMREGION *memregion, ulong offset, void *src, ulong nbytes) visor_memregion_write(MEMREGION *memregion, ulong offset, void *src,
ulong nbytes)
{ {
return memregion_readwrite(TRUE, memregion, offset, src, nbytes); return memregion_readwrite(TRUE, memregion, offset, src, nbytes);
} }
EXPORT_SYMBOL_GPL(memregion_write); EXPORT_SYMBOL_GPL(visor_memregion_write);
void void
memregion_destroy(MEMREGION *memregion) visor_memregion_destroy(MEMREGION *memregion)
{ {
if (memregion == NULL) if (memregion == NULL)
return; return;
...@@ -217,5 +219,5 @@ memregion_destroy(MEMREGION *memregion) ...@@ -217,5 +219,5 @@ memregion_destroy(MEMREGION *memregion)
unmapit(memregion); unmapit(memregion);
kfree(memregion); kfree(memregion);
} }
EXPORT_SYMBOL_GPL(memregion_destroy); EXPORT_SYMBOL_GPL(visor_memregion_destroy);
...@@ -50,7 +50,7 @@ static void periodic_work_func(struct work_struct *work) ...@@ -50,7 +50,7 @@ static void periodic_work_func(struct work_struct *work)
PERIODIC_WORK *periodic_work_create(ulong jiffy_interval, PERIODIC_WORK *visor_periodic_work_create(ulong jiffy_interval,
struct workqueue_struct *workqueue, struct workqueue_struct *workqueue,
void (*workfunc)(void *), void (*workfunc)(void *),
void *workfuncarg, void *workfuncarg,
...@@ -71,17 +71,17 @@ PERIODIC_WORK *periodic_work_create(ulong jiffy_interval, ...@@ -71,17 +71,17 @@ PERIODIC_WORK *periodic_work_create(ulong jiffy_interval,
periodic_work->devnam = devnam; periodic_work->devnam = devnam;
return periodic_work; return periodic_work;
} }
EXPORT_SYMBOL_GPL(periodic_work_create); EXPORT_SYMBOL_GPL(visor_periodic_work_create);
void periodic_work_destroy(PERIODIC_WORK *periodic_work) void visor_periodic_work_destroy(PERIODIC_WORK *periodic_work)
{ {
if (periodic_work == NULL) if (periodic_work == NULL)
return; return;
kfree(periodic_work); kfree(periodic_work);
} }
EXPORT_SYMBOL_GPL(periodic_work_destroy); EXPORT_SYMBOL_GPL(visor_periodic_work_destroy);
...@@ -90,14 +90,14 @@ EXPORT_SYMBOL_GPL(periodic_work_destroy); ...@@ -90,14 +90,14 @@ EXPORT_SYMBOL_GPL(periodic_work_destroy);
* If this function returns FALSE, there was a failure and the * If this function returns FALSE, there was a failure and the
* periodic work is no longer scheduled * periodic work is no longer scheduled
*/ */
BOOL periodic_work_nextperiod(PERIODIC_WORK *periodic_work) BOOL visor_periodic_work_nextperiod(PERIODIC_WORK *periodic_work)
{ {
BOOL rc = FALSE; BOOL rc = FALSE;
write_lock(&periodic_work->lock); write_lock(&periodic_work->lock);
if (periodic_work->want_to_stop) { if (periodic_work->want_to_stop) {
periodic_work->is_scheduled = FALSE; periodic_work->is_scheduled = FALSE;
periodic_work->want_to_stop = FALSE; periodic_work->want_to_stop = FALSE;
RETBOOL(TRUE); /* yes, TRUE; see periodic_work_stop() */ RETBOOL(TRUE); /* yes, TRUE; see visor_periodic_work_stop() */
} else if (queue_delayed_work(periodic_work->workqueue, } else if (queue_delayed_work(periodic_work->workqueue,
&periodic_work->work, &periodic_work->work,
periodic_work->jiffy_interval) < 0) { periodic_work->jiffy_interval) < 0) {
...@@ -110,7 +110,7 @@ BOOL periodic_work_nextperiod(PERIODIC_WORK *periodic_work) ...@@ -110,7 +110,7 @@ BOOL periodic_work_nextperiod(PERIODIC_WORK *periodic_work)
write_unlock(&periodic_work->lock); write_unlock(&periodic_work->lock);
return rc; return rc;
} }
EXPORT_SYMBOL_GPL(periodic_work_nextperiod); EXPORT_SYMBOL_GPL(visor_periodic_work_nextperiod);
...@@ -118,7 +118,7 @@ EXPORT_SYMBOL_GPL(periodic_work_nextperiod); ...@@ -118,7 +118,7 @@ EXPORT_SYMBOL_GPL(periodic_work_nextperiod);
* If this function returns FALSE, then no work was started * If this function returns FALSE, then no work was started
* (either because it was already started, or because of a failure). * (either because it was already started, or because of a failure).
*/ */
BOOL periodic_work_start(PERIODIC_WORK *periodic_work) BOOL visor_periodic_work_start(PERIODIC_WORK *periodic_work)
{ {
BOOL rc = FALSE; BOOL rc = FALSE;
...@@ -145,7 +145,7 @@ BOOL periodic_work_start(PERIODIC_WORK *periodic_work) ...@@ -145,7 +145,7 @@ BOOL periodic_work_start(PERIODIC_WORK *periodic_work)
return rc; return rc;
} }
EXPORT_SYMBOL_GPL(periodic_work_start); EXPORT_SYMBOL_GPL(visor_periodic_work_start);
...@@ -159,15 +159,15 @@ EXPORT_SYMBOL_GPL(periodic_work_start); ...@@ -159,15 +159,15 @@ EXPORT_SYMBOL_GPL(periodic_work_start);
* *
* Do NOT call this function from some function that is running on the * Do NOT call this function from some function that is running on the
* same workqueue as the work you are trying to stop might be running * same workqueue as the work you are trying to stop might be running
* on! If you violate this rule, periodic_work_stop() MIGHT work, but it * on! If you violate this rule, visor_periodic_work_stop() MIGHT work,
* also MIGHT get hung up in an infinite loop saying * but it also MIGHT get hung up in an infinite loop saying
* "waiting for delayed work...". This will happen if the delayed work * "waiting for delayed work...". This will happen if the delayed work
* you are trying to cancel has been put in the workqueue list, but can't * you are trying to cancel has been put in the workqueue list, but can't
* run yet because we are running that same workqueue thread right now. * run yet because we are running that same workqueue thread right now.
* *
* Bottom line: If you need to call periodic_work_stop() from a workitem, * Bottom line: If you need to call visor_periodic_work_stop() from a
* be sure the workitem is on a DIFFERENT workqueue than the workitem that * workitem, be sure the workitem is on a DIFFERENT workqueue than the
* you are trying to cancel. * workitem that you are trying to cancel.
* *
* If I could figure out some way to check for this "no no" condition in * If I could figure out some way to check for this "no no" condition in
* the code, I would. It would have saved me the trouble of writing this * the code, I would. It would have saved me the trouble of writing this
...@@ -184,7 +184,7 @@ EXPORT_SYMBOL_GPL(periodic_work_start); ...@@ -184,7 +184,7 @@ EXPORT_SYMBOL_GPL(periodic_work_start);
* this deadlock, you will get hung up in an infinite loop saying * this deadlock, you will get hung up in an infinite loop saying
* "waiting for delayed work...". * "waiting for delayed work...".
*/ */
BOOL periodic_work_stop(PERIODIC_WORK *periodic_work) BOOL visor_periodic_work_stop(PERIODIC_WORK *periodic_work)
{ {
BOOL stopped_something = FALSE; BOOL stopped_something = FALSE;
...@@ -215,7 +215,8 @@ BOOL periodic_work_stop(PERIODIC_WORK *periodic_work) ...@@ -215,7 +215,8 @@ BOOL periodic_work_stop(PERIODIC_WORK *periodic_work)
WARNDEV(periodic_work->devnam, WARNDEV(periodic_work->devnam,
"waiting for delayed work..."); "waiting for delayed work...");
/* We rely on the delayed work function running here, /* We rely on the delayed work function running here,
* and eventually calling periodic_work_nextperiod(), * and eventually calling
* visor_periodic_work_nextperiod(),
* which will see that want_to_stop is set, and * which will see that want_to_stop is set, and
* subsequently clear is_scheduled. * subsequently clear is_scheduled.
*/ */
...@@ -227,4 +228,4 @@ BOOL periodic_work_stop(PERIODIC_WORK *periodic_work) ...@@ -227,4 +228,4 @@ BOOL periodic_work_stop(PERIODIC_WORK *periodic_work)
write_unlock(&periodic_work->lock); write_unlock(&periodic_work->lock);
return stopped_something; return stopped_something;
} }
EXPORT_SYMBOL_GPL(periodic_work_stop); EXPORT_SYMBOL_GPL(visor_periodic_work_stop);
...@@ -126,7 +126,7 @@ static const struct file_operations proc_fops = { ...@@ -126,7 +126,7 @@ static const struct file_operations proc_fops = {
MYPROCTYPE *proc_CreateType(struct proc_dir_entry *procDirRoot, MYPROCTYPE *visor_proc_CreateType(struct proc_dir_entry *procDirRoot,
const char **name, const char **name,
const char **propertyNames, const char **propertyNames,
void (*show_property)(struct seq_file *, void (*show_property)(struct seq_file *,
...@@ -174,17 +174,17 @@ MYPROCTYPE *proc_CreateType(struct proc_dir_entry *procDirRoot, ...@@ -174,17 +174,17 @@ MYPROCTYPE *proc_CreateType(struct proc_dir_entry *procDirRoot,
Away: Away:
if (rc == NULL) { if (rc == NULL) {
if (type != NULL) { if (type != NULL) {
proc_DestroyType(type); visor_proc_DestroyType(type);
type = NULL; type = NULL;
} }
} }
return rc; return rc;
} }
EXPORT_SYMBOL_GPL(proc_CreateType); EXPORT_SYMBOL_GPL(visor_proc_CreateType);
void proc_DestroyType(MYPROCTYPE *type) void visor_proc_DestroyType(MYPROCTYPE *type)
{ {
if (type == NULL) if (type == NULL)
return; return;
...@@ -206,11 +206,11 @@ void proc_DestroyType(MYPROCTYPE *type) ...@@ -206,11 +206,11 @@ void proc_DestroyType(MYPROCTYPE *type)
} }
kfree(type); kfree(type);
} }
EXPORT_SYMBOL_GPL(proc_DestroyType); EXPORT_SYMBOL_GPL(visor_proc_DestroyType);
MYPROCOBJECT *proc_CreateObject(MYPROCTYPE *type, MYPROCOBJECT *visor_proc_CreateObject(MYPROCTYPE *type,
const char *name, void *context) const char *name, void *context)
{ {
MYPROCOBJECT *obj = NULL, *rc = NULL; MYPROCOBJECT *obj = NULL, *rc = NULL;
...@@ -272,17 +272,17 @@ MYPROCOBJECT *proc_CreateObject(MYPROCTYPE *type, ...@@ -272,17 +272,17 @@ MYPROCOBJECT *proc_CreateObject(MYPROCTYPE *type,
Away: Away:
if (rc == NULL) { if (rc == NULL) {
if (obj != NULL) { if (obj != NULL) {
proc_DestroyObject(obj); visor_proc_DestroyObject(obj);
obj = NULL; obj = NULL;
} }
} }
return rc; return rc;
} }
EXPORT_SYMBOL_GPL(proc_CreateObject); EXPORT_SYMBOL_GPL(visor_proc_CreateObject);
void proc_DestroyObject(MYPROCOBJECT *obj) void visor_proc_DestroyObject(MYPROCOBJECT *obj)
{ {
MYPROCTYPE *type = NULL; MYPROCTYPE *type = NULL;
if (obj == NULL) if (obj == NULL)
...@@ -317,7 +317,7 @@ void proc_DestroyObject(MYPROCOBJECT *obj) ...@@ -317,7 +317,7 @@ void proc_DestroyObject(MYPROCOBJECT *obj)
} }
kfree(obj); kfree(obj);
} }
EXPORT_SYMBOL_GPL(proc_DestroyObject); EXPORT_SYMBOL_GPL(visor_proc_DestroyObject);
......
...@@ -37,7 +37,7 @@ BOOL Debug_Malloc_Enabled = FALSE; ...@@ -37,7 +37,7 @@ BOOL Debug_Malloc_Enabled = FALSE;
* (not including the trailing '\0' byte) * (not including the trailing '\0' byte)
* @ingroup internal * @ingroup internal
*/ */
int hexDumpToBuffer(char *dest, int destSize, char *prefix, char *src, int visor_hexDumpToBuffer(char *dest, int destSize, char *prefix, char *src,
int srcLen, int bytesToDumpPerLine) int srcLen, int bytesToDumpPerLine)
{ {
int i = 0; int i = 0;
...@@ -104,7 +104,7 @@ int hexDumpToBuffer(char *dest, int destSize, char *prefix, char *src, ...@@ -104,7 +104,7 @@ int hexDumpToBuffer(char *dest, int destSize, char *prefix, char *src,
vfree(line); vfree(line);
return rc; return rc;
} }
EXPORT_SYMBOL_GPL(hexDumpToBuffer); EXPORT_SYMBOL_GPL(visor_hexDumpToBuffer);
/** Callers to interfaces that set __GFP_NORETRY flag below /** Callers to interfaces that set __GFP_NORETRY flag below
...@@ -120,12 +120,12 @@ void *kmalloc_kernel(size_t siz) ...@@ -120,12 +120,12 @@ void *kmalloc_kernel(size_t siz)
/* Use these handy-dandy seq_file_xxx functions if you want to call some /* Use these handy-dandy seq_file_xxx functions if you want to call some
* functions that write stuff into a seq_file, but you actually just want * functions that write stuff into a seq_file, but you actually just want
* to dump that output into a buffer. Use them as follows: * to dump that output into a buffer. Use them as follows:
* - call seq_file_new_buffer to create the seq_file (you supply the buf) * - call visor_seq_file_new_buffer to create the seq_file (you supply the buf)
* - call whatever functions you want that take a seq_file as an argument * - call whatever functions you want that take a seq_file as an argument
* (the buf you supplied will get the output data) * (the buf you supplied will get the output data)
* - call seq_file_done_buffer to dispose of your seq_file * - call visor_seq_file_done_buffer to dispose of your seq_file
*/ */
struct seq_file *seq_file_new_buffer(void *buf, size_t buf_size) struct seq_file *visor_seq_file_new_buffer(void *buf, size_t buf_size)
{ {
struct seq_file *rc = NULL; struct seq_file *rc = NULL;
struct seq_file *m = kmalloc_kernel(sizeof(struct seq_file)); struct seq_file *m = kmalloc_kernel(sizeof(struct seq_file));
...@@ -138,19 +138,19 @@ struct seq_file *seq_file_new_buffer(void *buf, size_t buf_size) ...@@ -138,19 +138,19 @@ struct seq_file *seq_file_new_buffer(void *buf, size_t buf_size)
RETPTR(m); RETPTR(m);
Away: Away:
if (rc == NULL) { if (rc == NULL) {
seq_file_done_buffer(m); visor_seq_file_done_buffer(m);
m = NULL; m = NULL;
} }
return rc; return rc;
} }
EXPORT_SYMBOL_GPL(seq_file_new_buffer); EXPORT_SYMBOL_GPL(visor_seq_file_new_buffer);
void seq_file_done_buffer(struct seq_file *m) void visor_seq_file_done_buffer(struct seq_file *m)
{ {
if (!m) if (!m)
return; return;
kfree(m); kfree(m);
} }
EXPORT_SYMBOL_GPL(seq_file_done_buffer); EXPORT_SYMBOL_GPL(visor_seq_file_done_buffer);
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