Esempio n. 1
0
void Parser::validate_instruction(unsigned char* iBlock, unsigned int iSize, unsigned int& tLoc) {
    tick();

    // Conditional
    if (mGrammar->isConditional(iBlock[tLoc]))
        validate_conditional(iBlock, iSize, tLoc);

    // Function
    else if (mGrammar->isFunction(iBlock[tLoc]))
        validate_function(iBlock, iSize, tLoc);

    // Data
    else if (mGrammar->isData(iBlock[tLoc]))
        return validate_data(iBlock, iSize, tLoc);

    // Unknown
    else
        throw Exception(SYNTAX, "unknown byte identifier");
}
Esempio n. 2
0
int ocxl_config_read_function(struct pci_dev *dev, struct ocxl_fn_config *fn)
{
	int rc;

	rc = read_pasid(dev, fn);
	if (rc) {
		dev_err(&dev->dev, "Invalid PASID configuration: %d\n", rc);
		return -ENODEV;
	}

	rc = read_dvsec_tl(dev, fn);
	if (rc) {
		dev_err(&dev->dev,
			"Invalid Transaction Layer DVSEC configuration: %d\n",
			rc);
		return -ENODEV;
	}

	rc = read_dvsec_function(dev, fn);
	if (rc) {
		dev_err(&dev->dev,
			"Invalid Function DVSEC configuration: %d\n", rc);
		return -ENODEV;
	}

	rc = read_dvsec_afu_info(dev, fn);
	if (rc) {
		dev_err(&dev->dev, "Invalid AFU configuration: %d\n", rc);
		return -ENODEV;
	}

	rc = read_dvsec_vendor(dev);
	if (rc) {
		dev_err(&dev->dev,
			"Invalid vendor specific DVSEC configuration: %d\n",
			rc);
		return -ENODEV;
	}

	rc = validate_function(dev, fn);
	return rc;
}