Beispiel #1
0
static int
tierfs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
{
	int rc;

	TRACE_ENTRY();
	rc = filemap_write_and_wait(file->f_mapping);
	if (rc)
		return rc;

	TRACE_EXIT();
	return vfs_fsync(tierfs_file_to_lower(file), datasync);
}
/*Creating and Destroying Functions*/
Bool CreateSurface(GALINFOPTR galInfo, PixmapPtr pPixmap, Viv2DPixmapPtr pPix) {
    GenericSurfacePtr surf = gcvNULL;
    VIVGPUPtr gpuctx = (VIVGPUPtr) galInfo->mGpu;
    gctUINT alignedWidth, alignedHeight;
    gctUINT bytesPerPixel;
    alignedWidth = gcmALIGN(pPixmap->drawable.width, WIDTH_ALIGNMENT);
    alignedHeight = gcmALIGN(pPixmap->drawable.height, HEIGHT_ALIGNMENT);
    bytesPerPixel = BITSTOBYTES(pPixmap->drawable.bitsPerPixel);

    /*QUICK FIX*/
    if (bytesPerPixel < 2) {
        bytesPerPixel = 2;
    }

    if (!VIV2DGPUSurfaceAlloc(gpuctx, alignedWidth, alignedHeight, bytesPerPixel, &surf)) {
        TRACE_ERROR("Surface Creation Error\n");
        TRACE_EXIT(FALSE);
    }

    pPix->mVidMemInfo = surf;
    TRACE_EXIT(TRUE);
}
Beispiel #3
0
COM::COM()
{
	TRACE_ENTER();

	HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);

	if(!SUCCEEDED(hr))
	{
		TRACE_PRINT1("CoInitializeEx: error, errCode = 0x%08x.", hr);
	}

	TRACE_EXIT();
}
Beispiel #4
0
int getIntDevID(TCHAR strDevID[]) //DevID is in form like: "ROOT\\NET\\0008"
{
	TRACE_ENTER();

	int iDevID = -1;
	int iMatched = _stscanf_s(strDevID, _T("ROOT\\NET\\%04d"), &iDevID);
	TRACE_PRINT2("_stscanf_s: iMatched = %d, iDevID = %d.", iMatched, iDevID);
	if (iMatched != 1)
		iDevID = -1;

	TRACE_EXIT();
	return iDevID;
}
Beispiel #5
0
struct isert_cmnd *isert_tx_pdu_alloc(struct isert_connection *isert_conn,
				      size_t size)
{
	struct isert_cmnd *pdu = NULL;
	int err;

	TRACE_ENTRY();

	pdu = isert_pdu_alloc();
	if (unlikely(!pdu)) {
		pr_err("Failed to alloc pdu\n");
		goto out;
	}

	err = isert_alloc_for_rdma(pdu, 4, isert_conn);
	if (unlikely(err)) {
		pr_err("Failed to alloc sge and wr for tx pdu\n");
		goto out;
	}

	err = isert_buf_alloc_data_buf(isert_conn->isert_dev->ib_dev,
				       &pdu->buf, size, DMA_TO_DEVICE);
	if (unlikely(err)) {
		pr_err("Failed to alloc tx pdu buf sz:%zd\n", size);
		goto buf_alloc_failed;
	}

	err = isert_pdu_tx_buf_init(pdu, isert_conn);
	if (unlikely(err < 0)) {
		pr_err("Failed to init tx pdu wr:%p size:%zd err:%d\n",
		       &pdu->wr, size, err);
		goto buf_init_failed;
	}

	isert_tx_pdu_init(pdu, isert_conn);

	isert_pdu_set_hdr_plain(pdu);

	list_add_tail(&pdu->pool_node, &isert_conn->tx_free_list);

	goto out;

buf_init_failed:
	isert_buf_release(&pdu->buf);
buf_alloc_failed:
	isert_pdu_kfree(pdu);
	pdu = NULL;
out:
	TRACE_EXIT();
	return pdu;
}
void FileManager_impl::move (const char* sourceFileName, const char* destinationFileName)
    throw (CORBA::SystemException, CF::InvalidFileName, CF::FileException)
{
    TRACE_ENTER(FileManager_impl);

    // Validate absolute file names
    if (sourceFileName[0] != '/' || !ossie::isValidFileName(sourceFileName)) {
        throw CF::InvalidFileName(CF::CF_EINVAL, "Invalid source file name");
    } else if (destinationFileName[0] != '/' || !ossie::isValidFileName(destinationFileName)) {
        throw CF::InvalidFileName(CF::CF_EINVAL, "Invalid destination file name");
    } else if (strcmp(sourceFileName, destinationFileName) == 0) {
        throw CF::InvalidFileName(CF::CF_EINVAL, "Destination file name is identical to source file name");
    }

    LOG_TRACE(FileManager_impl, "Move " << sourceFileName << " to " << destinationFileName);

    // Lock the mount table shared to allow others to access the file system,
    // but prevent changes to the mount table itself.
    boost::shared_lock<boost::shared_mutex> lock(mountsLock);

    MountList::iterator sourceMount = getMountForPath(sourceFileName);
    MountList::iterator destMount = getMountForPath(destinationFileName);

    if (sourceMount == destMount) {
        // Source and destination are on the same file system...
        if (sourceMount == mountedFileSystems.end()) {
            // ...which is also the local file system.
            LOG_TRACE(FileManager_impl, "Moving locally");
            FileSystem_impl::move(sourceFileName, destinationFileName);
        } else {
            // ...which is a remote file system.
            LOG_TRACE(FileManager_impl, "Moving locally on remote file system");
            const std::string srcPath = sourceMount->getRelativePath(sourceFileName);
            const std::string dstPath = destMount->getRelativePath(destinationFileName);
            sourceMount->fs->move(srcPath.c_str(), dstPath.c_str());
        }
        return;
    }

    LOG_TRACE(FileManager_impl, "Moving between filesystems");

    // Perform a copy followed by a remove, which is the only way we can move
    // across file systems. This operation is not atomic, and making it atomic
    // across a distributed file system is difficult. If necessary, we can
    // acquire an exclusive lock which at least prevents anyone going through
    // the domain's FileManager from interfering with this operation.
    this->copy(sourceFileName, destinationFileName);
    this->remove(sourceFileName);

    TRACE_EXIT(FileManager_impl);
}
		void 
		_test_suite::unregister_all_tests(void)
		{
			TRACE_ENTRY();
			SERIALIZE_CALL_RECURSIVE(m_test_suite_lock);

			while(!m_test_map.empty()) {
				unregister_test(m_test_map.begin()->first);
			}

			m_test_map.clear();

			TRACE_EXIT();
		}
Beispiel #8
0
BOOL EraseLoopbackRecord()
{
	TRACE_ENTER();
	BOOL rv = TRUE;
#ifndef NPF_NPCAP_RUN_IN_WINPCAP_MODE
	HKEY hKey;
	DWORD type;
	char buffer[BUFSIZE];
	DWORD size = sizeof(buffer);
	DWORD dwWinPcapMode = 0;

	if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, NPCAP_SERVICE_REG_KEY_NAME _T("\\Parameters"), 0, KEY_READ, &hKey) == ERROR_SUCCESS)
	{
		if (RegQueryValueExA(hKey, "WinPcapCompatible", 0, &type,  (LPBYTE)buffer, &size) == ERROR_SUCCESS && type == REG_DWORD)
		{
			dwWinPcapMode = *((DWORD *) buffer);
		}
		else
		{
			TRACE_PRINT1("RegQueryValueExA(WinPcapCompatible) failed or not REG_DWORD: %#x\n", GetLastError());
			dwWinPcapMode = 0;
		}

		RegCloseKey(hKey);
	}
	else
	{
		TRACE_PRINT2("%s\\Parameters) failed: %#x\n", NPCAP_SERVICE_REG_KEY_NAME, GetLastError());
		dwWinPcapMode = 0;
	}

	if (dwWinPcapMode != 0 && !DeleteValueFromRegistry(_T("SYSTEM\\CurrentControlSet\\Services\\npf\\Parameters"), NPCAP_REG_LOOPBACK_VALUE_NAME))
	{
		rv = FALSE;
	}
#endif /* ifndef NPF_NPCAP_RUN_IN_WINPCAP_MODE */

	if (!DeleteValueFromRegistry(NPCAP_REG_KEY_NAME, NPCAP_REG_LOOPBACK_VALUE_NAME))
	{
		rv = FALSE;
	}

	if (!DeleteValueFromRegistry(NPCAP_SERVICE_REG_KEY_NAME _T("\\Parameters"), NPCAP_REG_LOOPBACK_VALUE_NAME))
	{
		rv = FALSE;
	}

	TRACE_EXIT();
	return rv;
}
		_lexer_base::_lexer_base(
			__in const _lexer_base &other
			) :
				m_character_column(other.m_character_column),
				m_character_column_length(other.m_character_column_length),
				m_character_position(other.m_character_position),
				m_character_row(other.m_character_row),
				m_character_type(other.m_character_type),
				m_raw_input(other.m_raw_input),
				m_source_path(other.m_source_path)
		{
			TRACE_ENTRY();
			TRACE_EXIT();
		}
		void 
		_lexer_base::reset(void)
		{
			TRACE_ENTRY();
			SERIALIZE_CALL_RECURSIVE(m_lexer_base_lock);

			m_character_column = 0;
			m_character_column_length.clear();
			m_character_position = 0;
			m_character_row = 0;
			m_character_type = lexer_base::determine_character_type(get_character());

			TRACE_EXIT();
		}
Beispiel #11
0
static long
tierfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
	struct file *lower_file = NULL;
	long rc = -ENOIOCTLCMD;

	TRACE_ENTRY();
	if (tierfs_file_to_private(file))
		lower_file = tierfs_file_to_lower(file);
	if (lower_file && lower_file->f_op && lower_file->f_op->compat_ioctl)
		rc = lower_file->f_op->compat_ioctl(lower_file, cmd, arg);
	TRACE_EXIT();
	return rc;
}
Beispiel #12
0
		void 
		_interpreter::run(void)
		{
			TRACE_ENTRY();
			SERIALIZE_CALL_RECUR(m_lock);

			parser::clear();

			while(parser::has_next_statement()) {
				step();
			}

			TRACE_EXIT("Return Value: 0x%x", NULL);
		}
/* 8x8 Mono Pattern Fills */
static void 
Permedia3SetupForMono8x8PatternFill(ScrnInfoPtr pScrn, 
			   int patternx, int patterny, 
			   int fg, int bg, int rop,
			   unsigned int planemask)
{
    GLINTPtr pGlint = GLINTPTR(pScrn);
    TRACE_ENTER("Permedia3SetupForMono8x8PatternFill");
    REPLICATE(fg);
    pGlint->PM3_Render2D =
	PM3Render2D_AreaStippleEnable |
	PM3Render2D_SpanOperation |
	PM3Render2D_XPositive |
	PM3Render2D_YPositive |
	PM3Render2D_Operation_Normal;
    pGlint->PM3_Config2D =
	PM3Config2D_UseConstantSource |
	PM3Config2D_ForegroundROPEnable |
	PM3Config2D_ForegroundROP(rop) |
	PM3Config2D_FBWriteEnable;
    if ((rop!=GXclear)&&(rop!=GXset)&&(rop!=GXcopy)&&(rop!=GXcopyInverted))
	pGlint->PM3_Config2D |= PM3Config2D_FBDestReadEnable;
    pGlint->PM3_AreaStippleMode = 1;
/* Mirror stipple pattern horizontally */
#if X_BYTE_ORDER == X_BIG_ENDIAN
    pGlint->PM3_AreaStippleMode |= (1<<18);
#endif
    pGlint->PM3_AreaStippleMode |= (2<<1);
    pGlint->PM3_AreaStippleMode |= (2<<4);
    if (bg != -1) {
	REPLICATE(bg);
	pGlint->PM3_Config2D |= PM3Config2D_OpaqueSpan;
	pGlint->PM3_AreaStippleMode |= 1<<20;
	GLINT_WAIT(12);
    	GLINT_WRITE_REG(bg, BackgroundColor);
    }
    else GLINT_WAIT(11);
    GLINT_WRITE_REG((patternx & 0xFF), AreaStipplePattern0);
    GLINT_WRITE_REG((patternx & 0xFF00) >> 8, AreaStipplePattern1);
    GLINT_WRITE_REG((patternx & 0xFF0000) >> 16, AreaStipplePattern2);
    GLINT_WRITE_REG((patternx & 0xFF000000) >> 24, AreaStipplePattern3);
    GLINT_WRITE_REG((patterny & 0xFF), AreaStipplePattern4);
    GLINT_WRITE_REG((patterny & 0xFF00) >> 8, AreaStipplePattern5);
    GLINT_WRITE_REG((patterny & 0xFF0000) >> 16, AreaStipplePattern6);
    GLINT_WRITE_REG((patterny & 0xFF000000) >> 24, AreaStipplePattern7);
    GLINT_WRITE_REG(fg, PM3ForegroundColor);
    PM3_PLANEMASK(planemask);
    GLINT_WRITE_REG(pGlint->PM3_Config2D, PM3Config2D);
    TRACE_EXIT("Permedia3SetupForMono8x8PatternFill");
}
Beispiel #14
0
CDeskBand::~CDeskBand()
{
  TRACE_ENTER("CDeskBand::~CDeskBand");
  //this should have been freed in a call to SetSite(NULL), but just to be safe
  if (m_pSite)
    {
      m_pSite->Release();
      m_pSite = NULL;
    }

  g_DllRefCount--;
  TRACE_MSG(g_DllRefCount);
  TRACE_EXIT();
}
Beispiel #15
0
		_json_token::_json_token(
			__in const _json_token &other
			) :
				json_uuid_class(other),
				m_line(other.m_line),
				m_source(other.m_source),
				m_subtype(other.m_subtype),
				m_text(other.m_text),
				m_type(other.m_type),
				m_value(other.m_value)
		{
			TRACE_ENTRY();
			TRACE_EXIT("Return Value: 0x%x", 0);
		}
Beispiel #16
0
static void __exit exit_scst_modisk_driver(void)
{
	TRACE_ENTRY();

#ifdef CONFIG_SCST_PROC
	scst_dev_handler_destroy_std_proc(&modisk_devtype_perf);
	scst_dev_handler_destroy_std_proc(&modisk_devtype);
#endif
	scst_unregister_dev_driver(&modisk_devtype_perf);
	scst_unregister_dev_driver(&modisk_devtype);

	TRACE_EXIT();
	return;
}
Beispiel #17
0
		void 
		_json_token::set_metadata(
			__in const std::string &source,
			__in_opt size_t line
			)
		{
			TRACE_ENTRY();
			SERIALIZE_CALL_RECUR(m_lock);

			m_source = source;
			m_line = line;

			TRACE_EXIT("Return Value: 0x%x", 0);
		}
Beispiel #18
0
		void 
		_json_token::set_type(
			__in type_t type,
			__in_opt type_t subtype
			)
		{
			TRACE_ENTRY();
			SERIALIZE_CALL_RECUR(m_lock);

			m_type = type;
			m_subtype = subtype;

			TRACE_EXIT("Return Value: 0x%x", 0);
		}
Beispiel #19
0
		uuid 
		_interpreter::push_scope(void)
		{
			uuid result;

			TRACE_ENTRY();
			SERIALIZE_CALL_RECUR(m_lock);

			result = get_scope_factory()->generate().get_id();
			m_scope_stack.push(result);

			TRACE_EXIT("Return Value: 0x%x", NULL);
			return result;
		}
Beispiel #20
0
		void 
		_interpreter::set(
			__in const std::string &input,
			__in_opt bool is_file
			)
		{
			TRACE_ENTRY();
			SERIALIZE_CALL_RECUR(m_lock);

			parser::set(input, is_file);
			interpreter::clear();

			TRACE_EXIT("Return Value: 0x%x", NULL);
		}
Beispiel #21
0
		void 
		_json_token_factory::clear(void)
		{
			TRACE_ENTRY();
			SERIALIZE_CALL_RECUR(m_lock);

			if(!m_initialized) {
				THROW_JSON_TOKEN_EXCEPTION(JSON_TOKEN_EXCEPTION_UNINITIALIZED);
			}

			m_token_map.clear();

			TRACE_EXIT("Return Value: 0x%x", 0);
		}
CosEventChannelAdmin::EventChannel_ptr createEventChannel (const std::string& name)
{
    TRACE_ENTER(EventChannelSupport);

    CosLifeCycle::GenericFactory_var factory = getEventChannelFactory();
    if (CORBA::is_nil(factory)) {
        LOG_WARN(EventChannelSupport, "Event channel " << name << " not created");
        TRACE_EXIT(EventChannelSupport);
        return CosEventChannelAdmin::EventChannel::_nil();
    }

    CosLifeCycle::Key key;
    key.length(1);
    key[0].id = "EventChannel";
    key[0].kind = "object interface";

    std::string insName = name;
    CosLifeCycle::Criteria criteria;
    criteria.length(1);
    criteria[0].name = "InsName";
    criteria[0].value <<= insName.c_str();

    CosEventChannelAdmin::EventChannel_var eventChannel;

    LOG_TRACE(EventChannelSupport, "Creating event channel " << name);
    try {
        CORBA::Object_var obj = factory->create_object(key, criteria);
        eventChannel = CosEventChannelAdmin::EventChannel::_narrow(obj);
    } catch (const CosLifeCycle::InvalidCriteria&) {
        LOG_WARN(EventChannelSupport, "Invalid Criteria for creating event channel " << name);
    } catch (const CORBA::Exception& ex) {
        LOG_WARN(EventChannelSupport, "CORBA " << ex._name() << " exception creating event channel " << name);
    }

    TRACE_EXIT(EventChannelSupport);
    return eventChannel._retn();
}
Beispiel #23
0
vector<tstring> getWlanAdapterGuids()
{
	TRACE_ENTER();

	HANDLE hClient = NULL;
	WLAN_INTERFACE_INFO sInfo[64];
	RPC_TSTR strGuid = NULL;
	vector<tstring> nstrWlanAdapterGuids;

	if (!initWlanFunctions())
	{
		TRACE_PRINT("initWlanFunctions: error.");
		TRACE_EXIT();
		return nstrWlanAdapterGuids;
	}

	if (OpenHandleAndCheckVersion(&hClient) != ERROR_SUCCESS)
	{
		TRACE_PRINT("OpenHandleAndCheckVersion: error.");
		TRACE_EXIT();
		return nstrWlanAdapterGuids;
	}

	UINT nCount = EnumInterface(hClient, sInfo);
	for (UINT i = 0; i < nCount; ++i)
	{
		if (UuidToString(&sInfo[i].InterfaceGuid, &strGuid) == RPC_S_OK)
		{
			TRACE_PRINT1("EnumInterface: executing, strGuid = %s.", (TCHAR*) strGuid);
			nstrWlanAdapterGuids.push_back((TCHAR*) strGuid);
			RpcStringFree(&strGuid);
		}
	}

	TRACE_EXIT();
	return nstrWlanAdapterGuids;
}
Beispiel #24
0
static void
dldwd_cs_detach(dev_link_t * link)
{
	dev_link_t **linkp;
	dldwd_priv_t *priv = link->priv;

	TRACE_ENTER("dldwd");

	/* Locate device structure */
	for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
		if (*linkp == link)
			break;
	if (*linkp == NULL)
		goto out;

	/*
	   If the device is currently configured and active, we won't
	   actually delete it yet.  Instead, it is marked so that when
	   the release() function is called, that will trigger a proper
	   detach().
	 */
	if (link->state & DEV_CONFIG) {
#ifdef PCMCIA_DEBUG
		printk(KERN_DEBUG "orinoco_cs: detach postponed, '%s' "
		       "still locked\n", link->dev->dev_name);
#endif
		link->state |= DEV_STALE_LINK;
		goto out;
	}

	/* Break the link with Card Services */
	if (link->handle)
		CardServices(DeregisterClient, link->handle);

	/* Unlink device structure, and free it */
	*linkp = link->next;
	DEBUG(0, "orinoco_cs: detach: link=%p link->dev=%p\n", link, link->dev);
	if (link->dev) {
		DEBUG(0, "orinoco_cs: About to unregister net device %p\n",
		      &priv->ndev);
		unregister_netdev(&priv->ndev);
	}
	kfree(priv->card);

	num_instances--; /* FIXME: Racy? */

 out:
	TRACE_EXIT("dldwd");
}				/* dldwd_cs_detach */
Beispiel #25
0
LRESULT
CDeskBand::OnTimer(WPARAM wParam, LPARAM lParam)
{
  TRACE_ENTER_MSG("CDeskBand::OnTimer", wParam << " " << lParam);
  if (m_TimerBox != NULL)
    {
      if (m_LastCopyData == 0 || difftime(time(NULL), m_LastCopyData) > 2)
        {
          m_TimerBox->set_enabled(false);
          m_TimerBox->update(false);
        }
    }
  TRACE_EXIT();
  return 0;
}
Beispiel #26
0
		json_token &
		_json_token_factory::at(
			__in const json_uuid &id
			)
		{
			TRACE_ENTRY();
			SERIALIZE_CALL_RECUR(m_lock);

			if(!m_initialized) {
				THROW_JSON_TOKEN_EXCEPTION(JSON_TOKEN_EXCEPTION_UNINITIALIZED);
			}

			TRACE_EXIT("Return Value: 0x%x", 0);
			return find(id)->second;
		}
Beispiel #27
0
		_json_token_factory::_json_token_factory(
			__in_opt json_sgl_cb dest
			) :
				m_initialized(false)
		{
			TRACE_ENTRY();

			if(dest) {
				std::atexit(dest);
			} else {
				std::atexit(json_token_factory_destroy);
			}

			TRACE_EXIT("Return Value: 0x%x", 0);
		}
Beispiel #28
0
static void isert_conn_timer_fn(unsigned long arg)
{
	struct isert_conn_dev *conn_dev = (struct isert_conn_dev *)arg;
	struct iscsi_conn *conn = conn_dev->conn;

	TRACE_ENTRY();

	conn_dev->timer_active = 0;

	PRINT_ERROR("Timeout on connection %p\n", conn_dev->conn);

	schedule_work(&conn->close_work);

	TRACE_EXIT();
}
Beispiel #29
0
DWORD InstallDriver(BOOL bWifiOrNormal)
{
	DWORD nResult;
	TRACE_ENTER("InstallDriver");

	// Get Path to Service INF File
	// ----------------------------
	// The INF file is assumed to be in the same folder as this application...
	TCHAR szFileFullPath[_MAX_PATH];

	nResult = GetServiceInfFilePath(szFileFullPath, MAX_PATH, bWifiOrNormal);

	if (nResult == 0)
	{
		TRACE_PRINT("Unable to get INF file path");
		return 0;
	}

	//_tprintf( _T("INF Path: %s\n"), szFileFullPath );

	HRESULT hr = S_OK;

	//_tprintf( _T("PnpID: %s\n"), NDISPROT_SERVICE_PNP_DEVICE_ID );

	hr = InstallSpecifiedComponent(szFileFullPath, NDISLWF_SERVICE_PNP_DEVICE_ID, &GUID_DEVCLASS_NETSERVICE);

	if (hr != S_OK)
	{
		ErrMsg(hr, L"InstallSpecifiedComponent\n");
		TRACE_EXIT("InstallDriver");
		return 0;
	}

	TRACE_EXIT("InstallDriver");
	return 1;
}
Bool VIV2DGPUCtxDeInit(GALINFOPTR galInfo) {
    TRACE_ENTER();
    gctBOOL ret = gcvTRUE;
    VIVGPUPtr gpuctx = gcvNULL;
    if (galInfo->mGpu == NULL) {
        TRACE_ERROR("GPU CTX IS NULL\n");
        TRACE_EXIT(TRUE);
    }

    VDestroySurf();

    gpuctx = (VIVGPUPtr) (galInfo->mGpu);
    ret = DestroyDevice(gpuctx->mDevice);
    if (ret != gcvTRUE) {
        TRACE_ERROR("ERROR WHILE DESTROYING DEVICE \n");
        TRACE_EXIT(FALSE);
    }
    ret = DestroyDriver(gpuctx->mDriver);
    if (ret != gcvTRUE) {
        TRACE_ERROR("ERROR WHILE DESTROYING DRIVER\n");
        TRACE_EXIT(FALSE);
    }
    TRACE_EXIT(TRUE);
}