Exemplo n.º 1
0
int CreateProcEntries(void)
{
	dir = proc_mkdir(PVRProcDirRoot, NULL);

	if (!dir) {
		PVR_DPF(PVR_DBG_ERROR,
			 "CreateProcEntries: cannot make /proc/%s directory",
			 PVRProcDirRoot);

		return -ENOMEM;
	}

	if (CreateProcReadEntry("queue", QueuePrintQueues) ||
	    CreateProcReadEntry("version", procDumpVersion) ||
	    CreateProcReadEntry("nodes", procDumpSysNodes)) {
		PVR_DPF(PVR_DBG_ERROR,
			 "CreateProcEntries: couldn't make /proc/%s files",
			 PVRProcDirRoot);

		return -ENOMEM;
	}
#ifdef DEBUG
	if (CreateProcEntry
	    ("debug_level", PVRDebugProcGetLevel, PVRDebugProcSetLevel, NULL)) {
		PVR_DPF(PVR_DBG_ERROR,
			"CreateProcEntries: couldn't make /proc/%s/debug_level",
			 PVRProcDirRoot);

		return -ENOMEM;
	}
#endif

	return 0;
}
Exemplo n.º 2
0
enum PVRSRV_ERROR LinuxMMInit(void)
{
#if defined(DEBUG_LINUX_MEM_AREAS) || defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
	mutex_init(&g_sDebugMutex);
#endif

#if defined(DEBUG_LINUX_MEM_AREAS)
	{
		int iStatus;
		iStatus =
		    CreateProcReadEntry("mem_areas", printLinuxMemAreaRecords);
		if (iStatus != 0)
			return PVRSRV_ERROR_OUT_OF_MEMORY;
	}
#endif

#if defined(DEBUG_LINUX_MEMORY_ALLOCATIONS)
	{
		int iStatus;
		iStatus = CreateProcReadEntry("meminfo", printMemoryRecords);
		if (iStatus != 0)
			return PVRSRV_ERROR_OUT_OF_MEMORY;
	}
#endif
	psLinuxMemAreaCache =
	    kmem_cache_create("img-mm", sizeof(struct LinuxMemArea), 0, 0,
				NULL);
	if (!psLinuxMemAreaCache) {
		PVR_DPF(PVR_DBG_ERROR, "%s: failed to allocate kmem_cache",
			 __func__);
		return PVRSRV_ERROR_OUT_OF_MEMORY;
	}

	return PVRSRV_OK;
}
Exemplo n.º 3
0
PVRSRV_ERROR
LinuxBridgeInit(IMG_VOID)
{
#if defined(DEBUG_BRIDGE_KM)
	{
		IMG_INT iStatus;
#ifdef PVR_PROC_USE_SEQ_FILE
		g_ProcBridgeStats = CreateProcReadEntrySeq(
												  "bridge_stats", 
												  NULL,
												  ProcSeqNextBridgeStats,
												  ProcSeqShowBridgeStats,
												  ProcSeqOff2ElementBridgeStats,
												  ProcSeqStartstopBridgeStats
						  						 );
		iStatus = !g_ProcBridgeStats ? -1 : 0;
#else  
		iStatus = CreateProcReadEntry("bridge_stats", printLinuxBridgeStats);
#endif 
		
		if(iStatus!=0)
		{
			return PVRSRV_ERROR_OUT_OF_MEMORY;
		}
	}
#endif
	return CommonBridgeInit();
}