#include "mmap.h"
#include "env_data.h"
#include "proc.h"
-#include "mutex.h"
-#include "lock.h"
#include "event.h"
+#include "pvr_bridge_km.h"
struct PVRSRV_LINUX_EVENT_OBJECT_LIST {
rwlock_t sLock;
if (psLinuxEventObject->ui32TimeStampPrevious != ui32TimeStamp)
break;
- mutex_unlock(&gPVRSRVLock);
+ pvr_unlock();
ui32TimeOutJiffies =
(u32) schedule_timeout((s32) ui32TimeOutJiffies);
- mutex_lock(&gPVRSRVLock);
+ pvr_lock();
#if defined(DEBUG)
psLinuxEventObject->ui32Stats++;
#endif
+++ /dev/null
-/**********************************************************************
- *
- * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * The full GNU General Public License is included in this distribution in
- * the file called "COPYING".
- *
- * Contact Information:
- * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
- *
- ******************************************************************************/
-#ifndef __LOCK_H__
-#define __LOCK_H__
-
-extern struct mutex gPVRSRVLock;
-
-#endif
#include "osfunc.h"
#include "pvr_debug.h"
#include "proc.h"
-#include "mutex.h"
-#include "lock.h"
#if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
enum DEBUG_MEM_ALLOC_TYPE {
#include "pvr_debug.h"
#include "osfunc.h"
#include "proc.h"
-#include "mutex.h"
#include "handle.h"
#include "perproc.h"
#include "env_perproc.h"
#include "mutils.h"
#include "mm.h"
#include "mmap.h"
-#include "mutex.h"
#include "pvr_debug.h"
#include "srvkm.h"
#include "perproc.h"
#include "proc.h"
#include "pvrmodule.h"
#include "private_data.h"
-#include "lock.h"
#define DRVNAME "pvrsrvkm"
module_param(debug, int, 0);
#endif
-struct mutex gPVRSRVLock;
-
static int pvr_open(struct inode unref__ * inode, struct file *filp)
{
struct PVRSRV_FILE_PRIVATE_DATA *priv;
enum PVRSRV_ERROR err;
u32 pid;
- mutex_lock(&gPVRSRVLock);
+ pvr_lock();
pid = OSGetCurrentProcessIDKM();
ret = 0;
err_unlock:
- mutex_unlock(&gPVRSRVLock);
+ pvr_unlock();
+
return ret;
}
{
struct PVRSRV_FILE_PRIVATE_DATA *priv;
- mutex_lock(&gPVRSRVLock);
+ pvr_lock();
priv = filp->private_data;
sizeof(*priv),
priv, priv->hBlockAlloc);
- mutex_unlock(&gPVRSRVLock);
+ pvr_unlock();
+
return 0;
}
PVR_TRACE("pvr_init");
- mutex_init(&gPVRSRVLock);
+ pvr_init_lock();
#ifdef DEBUG
PVRDebugSetLevel(debug);
+++ /dev/null
-/**********************************************************************
- *
- * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful but, except
- * as otherwise stated in writing, without any warranty; without even the
- * implied warranty of merchantability or fitness for a particular purpose.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * The full GNU General Public License is included in this distribution in
- * the file called "COPYING".
- *
- * Contact Information:
- * Imagination Technologies Ltd. <gpl-support@imgtec.com>
- * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
- *
- ******************************************************************************/
-
-#ifndef __INCLUDED_LINUX_MUTEX_H_
-#define __INCLUDED_LINUX_MUTEX_H_
-
-#include <linux/version.h>
-
-#include <linux/mutex.h>
-
-extern struct mutex gPVRSRVLock;
-
-#endif
#include "mmap.h"
#include "env_data.h"
#include "proc.h"
-#include "mutex.h"
#include "event.h"
#define EVENT_OBJECT_TIMEOUT_MS (100)
#include "pvr_bridge.h"
#include "pvr_bridge_km.h"
#include "perproc.h"
-#include "mutex.h"
#include "syscommon.h"
#include "pvr_debug.h"
#include "proc.h"
#include "bridged_pvr_bridge.h"
+/* Global driver lock protecting all HW and SW state tracking objects. */
+struct mutex gPVRSRVLock;
#if defined(DEBUG_BRIDGE_KM)
static off_t printLinuxBridgeStats(char *buffer, size_t size, off_t off);
struct PVRSRV_BRIDGE_DISPATCH_TABLE_ENTRY *psEntry;
off_t Ret;
- mutex_lock(&gPVRSRVLock);
+ pvr_lock();
if (!off) {
if (count < 500) {
psEntry->ui32CopyToUserTotalBytes);
unlock_and_return:
- mutex_unlock(&gPVRSRVLock);
+ pvr_unlock();
+
return Ret;
}
#endif
struct PVRSRV_PER_PROCESS_DATA *psPerProc;
int err = -EFAULT;
- mutex_lock(&gPVRSRVLock);
+ pvr_lock();
if (!OSAccessOK(PVR_VERIFY_WRITE, psBridgePackageUM,
sizeof(struct PVRSRV_BRIDGE_PACKAGE))) {
goto unlock_and_return;
unlock_and_return:
- mutex_unlock(&gPVRSRVLock);
+ pvr_unlock();
+
return err;
}
#include "pvr_bridge.h"
#include "perproc.h"
+extern struct mutex gPVRSRVLock;
+
+static inline void pvr_lock(void)
+{
+ mutex_lock(&gPVRSRVLock);
+}
+
+static inline void pvr_unlock(void)
+{
+ mutex_unlock(&gPVRSRVLock);
+}
+
+static inline void pvr_init_lock(void)
+{
+ mutex_init(&gPVRSRVLock);
+}
+
enum PVRSRV_ERROR LinuxBridgeInit(void);
void LinuxBridgeDeInit(void);
#include "servicesext.h"
#include "pvr_debug.h"
#include "proc.h"
-#include "mutex.h"
#include "syscommon.h"
#include "sgxinfokm.h"
#include "sgxutils.h"