当前位置: 首页>>代码示例>>C++>>正文


C++ return_VALUE函数代码示例

本文整理汇总了C++中return_VALUE函数的典型用法代码示例。如果您正苦于以下问题:C++ return_VALUE函数的具体用法?C++ return_VALUE怎么用?C++ return_VALUE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了return_VALUE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: acpi_system_init

static int __init acpi_system_init(void)
{
	struct proc_dir_entry *entry;
	int error = 0;
	char *name;

	ACPI_FUNCTION_TRACE("acpi_system_init");

	if (acpi_disabled)
		return_VALUE(0);

	/* 'info' [R] */
	name = ACPI_SYSTEM_FILE_INFO;
	entry = create_proc_entry(name, S_IRUGO, acpi_root_dir);
	if (!entry)
		goto Error;
	else {
		entry->proc_fops = &acpi_system_info_ops;
	}

	/* 'dsdt' [R] */
	name = ACPI_SYSTEM_FILE_DSDT;
	entry = create_proc_entry(name, S_IRUSR, acpi_root_dir);
	if (entry)
		entry->proc_fops = &acpi_system_dsdt_ops;
	else
		goto Error;

	/* 'fadt' [R] */
	name = ACPI_SYSTEM_FILE_FADT;
	entry = create_proc_entry(name, S_IRUSR, acpi_root_dir);
	if (entry)
		entry->proc_fops = &acpi_system_fadt_ops;
	else
		goto Error;

      Done:
	return_VALUE(error);

      Error:
	ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
			  "Unable to create '%s' proc fs entry\n", name));

	remove_proc_entry(ACPI_SYSTEM_FILE_FADT, acpi_root_dir);
	remove_proc_entry(ACPI_SYSTEM_FILE_DSDT, acpi_root_dir);
	remove_proc_entry(ACPI_SYSTEM_FILE_INFO, acpi_root_dir);

	error = -EFAULT;
	goto Done;
}
开发者ID:mahyarmd,项目名称:unifi-gpl,代码行数:50,代码来源:system.c

示例2: acpi_hw_get_mode

u32
acpi_hw_get_mode (void)
{

	FUNCTION_TRACE ("Hw_get_mode");


	if (acpi_hw_register_bit_access (ACPI_READ, ACPI_MTX_LOCK, SCI_EN)) {
		return_VALUE (SYS_MODE_ACPI);
	}
	else {
		return_VALUE (SYS_MODE_LEGACY);
	}
}
开发者ID:TitaniumBoy,项目名称:lin,代码行数:14,代码来源:hwacpi.c

示例3: acpi_ns_get_type

acpi_object_type
acpi_ns_get_type (
	struct acpi_namespace_node      *node)
{
	ACPI_FUNCTION_TRACE ("ns_get_type");


	if (!node) {
		ACPI_REPORT_WARNING (("ns_get_type: Null Node input pointer\n"));
		return_VALUE (ACPI_TYPE_ANY);
	}

	return_VALUE ((acpi_object_type) node->type);
}
开发者ID:Antonio-Zhou,项目名称:Linux-2.6.11,代码行数:14,代码来源:nsutils.c

示例4: acpi_ec_write

static int
acpi_ec_write (
	struct acpi_ec		*ec,
	u8			address,
	u8			data)
{
	int			result = 0;
	acpi_status		status = AE_OK;
	unsigned long		flags = 0;
	u32			glk = 0;

	ACPI_FUNCTION_TRACE("acpi_ec_write");

	if (!ec)
		return_VALUE(-EINVAL);

	if (ec->global_lock) {
		status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
		if (ACPI_FAILURE(status))
			return_VALUE(-ENODEV);
	}

	spin_lock_irqsave(&ec->lock, flags);

	acpi_hw_low_level_write(8, ACPI_EC_COMMAND_WRITE, &ec->command_addr);
	result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
	if (result)
		goto end;

	acpi_hw_low_level_write(8, address, &ec->data_addr);
	result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
	if (result)
		goto end;

	acpi_hw_low_level_write(8, data, &ec->data_addr);
	result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBE);
	if (result)
		goto end;

	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Wrote [%02x] to address [%02x]\n",
		data, address));

end:
	spin_unlock_irqrestore(&ec->lock, flags);

	if (ec->global_lock)
		acpi_release_global_lock(glk);

	return_VALUE(result);
}
开发者ID:Antonio-Zhou,项目名称:Linux-2.6.11,代码行数:50,代码来源:ec.c

示例5: acpi_thermal_init

int
acpi_thermal_init (void)
{
	int			result = 0;

	ACPI_FUNCTION_TRACE("acpi_thermal_init");

	result = acpi_bus_register_driver(&acpi_thermal_driver);
	if (result < 0) {
		return_VALUE(-ENODEV);
	}

	return_VALUE(0);
}
开发者ID:PyroOS,项目名称:Pyro,代码行数:14,代码来源:thermal.c

示例6: AcpiUtExplicitStrtoul64

UINT64
AcpiUtExplicitStrtoul64 (
    char                    *String)
{
    UINT64                  ConvertedInteger = 0;
    UINT32                  Base = 10;          /* Default is decimal */


    ACPI_FUNCTION_TRACE_STR (UtExplicitStrtoul64, String);


    if (!AcpiUtRemoveWhitespace (&String))
    {
        return_VALUE (0);
    }

    /*
     * Only Hex and Decimal are supported, as per the ACPI specification.
     * A "0x" prefix indicates hex; otherwise decimal is assumed.
     */
    if (AcpiUtDetectHexPrefix (&String))
    {
        Base = 16;
    }

    if (!AcpiUtRemoveLeadingZeros (&String))
    {
        return_VALUE (0);
    }

    /*
     * Ignore overflow as per the ACPI specification. This is implemented by
     * ignoring the return status from the conversion functions called below.
     * On overflow, the input string is simply truncated.
     */
    switch (Base)
    {
    case 10:
    default:
        AcpiUtConvertDecimalString (String, &ConvertedInteger);
        break;

    case 16:
        AcpiUtConvertHexString (String, &ConvertedInteger);
        break;
    }

    return_VALUE (ConvertedInteger);
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:49,代码来源:utstrtoul64.c

示例7: is_processor_present

static int is_processor_present(acpi_handle handle)
{
	acpi_status status;
	unsigned long sta = 0;

	ACPI_FUNCTION_TRACE("is_processor_present");

	status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
	if (ACPI_FAILURE(status) || !(sta & ACPI_STA_PRESENT)) {
		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
				  "Processor Device is not present\n"));
		return_VALUE(0);
	}
	return_VALUE(1);
}
开发者ID:gnensis,项目名称:linux-2.6.15,代码行数:15,代码来源:processor_core.c

示例8: AcpiNsGetType

ACPI_OBJECT_TYPE
AcpiNsGetType (
    ACPI_NAMESPACE_NODE     *Node)
{
    ACPI_FUNCTION_TRACE (NsGetType);


    if (!Node)
    {
        ACPI_WARNING ((AE_INFO, "Null Node parameter"));
        return_VALUE (ACPI_TYPE_ANY);
    }

    return_VALUE (Node->Type);
}
开发者ID:Jyang772,项目名称:XEOS,代码行数:15,代码来源:nsutils.c

示例9: acpi_button_read_info

static int
acpi_button_read_info (
	char			*page,
	char			**start,
	off_t			off,
	int 			count,
	int 			*eof,
	void			*data)
{
	struct acpi_button	*button = (struct acpi_button *) data;
	char			*p = page;
	int			len = 0;

	ACPI_FUNCTION_TRACE("acpi_button_read_info");

	if (!button || !button->device || (off != 0))
		goto end;

	p += sprintf(p, "type:                    %s\n", 
		acpi_device_name(button->device));

end:
	len = (p - page);
	if (len <= off+count) *eof = 1;
	*start = page + off;
	len -= off;
	if (len>count) len = count;
	if (len<0) len = 0;

	return_VALUE(len);
}
开发者ID:iPodLinux,项目名称:linux-2.4.24-ipod,代码行数:31,代码来源:button.c

示例10: acpi_system_read_info

static int acpi_system_read_info(struct seq_file *seq, void *offset)
{
	ACPI_FUNCTION_TRACE("acpi_system_read_info");

	seq_printf(seq, "version:                 %x\n", ACPI_CA_VERSION);
	return_VALUE(0);
}
开发者ID:mahyarmd,项目名称:unifi-gpl,代码行数:7,代码来源:system.c

示例11: AcpiEvSciXruptHandler

static UINT32 ACPI_SYSTEM_XFACE
AcpiEvSciXruptHandler (
    void                    *Context)
{
    ACPI_GPE_XRUPT_INFO     *GpeXruptList = Context;
    UINT32                  InterruptHandled = ACPI_INTERRUPT_NOT_HANDLED;


    ACPI_FUNCTION_TRACE (EvSciXruptHandler);


    /*
     * We are guaranteed by the ACPI CA initialization/shutdown code that
     * if this interrupt handler is installed, ACPI is enabled.
     */

    /*
     * Fixed Events:
     * Check for and dispatch any Fixed Events that have occurred
     */
    InterruptHandled |= AcpiEvFixedEventDetect ();

    /*
     * General Purpose Events:
     * Check for and dispatch any GPEs that have occurred
     */
    InterruptHandled |= AcpiEvGpeDetect (GpeXruptList);

    AcpiSciCount++;
    return_VALUE (InterruptHandled);
}
开发者ID:Jyang772,项目名称:XEOS,代码行数:31,代码来源:evsci.c

示例12: acpi_battery_read_alarm

static int
acpi_battery_read_alarm (struct seq_file *seq, void *offset)
{
	struct acpi_battery	*battery = (struct acpi_battery *) seq->private;
	char			*units = "?";

	ACPI_FUNCTION_TRACE("acpi_battery_read_alarm");

	if (!battery)
		goto end;

	if (!battery->flags.present) {
		seq_printf(seq, "present:                 no\n");
		goto end;
	}

	/* Battery Units */
	
	units = battery->flags.power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS;

	/* Battery Alarm */

	seq_printf(seq, "alarm:                   ");
	if (!battery->alarm)
		seq_printf(seq, "unsupported\n");
	else
		seq_printf(seq, "%d %sh\n", (u32) battery->alarm, units);

end:
	return_VALUE(0);
}
开发者ID:Dronevery,项目名称:JetsonTK1-kernel,代码行数:31,代码来源:battery.c

示例13: acpi_ev_sci_xrupt_handler

static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context)
{
	struct acpi_gpe_xrupt_info *gpe_xrupt_list = context;
	u32 interrupt_handled = ACPI_INTERRUPT_NOT_HANDLED;

	ACPI_FUNCTION_TRACE("ev_sci_xrupt_handler");

	/*
	 * We are guaranteed by the ACPI CA initialization/shutdown code that
	 * if this interrupt handler is installed, ACPI is enabled.
	 */

	/*
	 * Fixed Events:
	 * Check for and dispatch any Fixed Events that have occurred
	 */
	interrupt_handled |= acpi_ev_fixed_event_detect();

	/*
	 * General Purpose Events:
	 * Check for and dispatch any GPEs that have occurred
	 */
	interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);

	return_VALUE(interrupt_handled);
}
开发者ID:BackupTheBerlios,项目名称:tew632-brp-svn,代码行数:26,代码来源:evsci.c

示例14: acpi_init

static int __init acpi_init (void)
{
	int			result = 0;

	ACPI_FUNCTION_TRACE("acpi_init");

	printk(KERN_INFO PREFIX "Subsystem revision %08x\n",
		ACPI_CA_VERSION);

	if (acpi_disabled) {
		printk(KERN_INFO PREFIX "Interpreter disabled.\n");
		return -ENODEV;
	}

	firmware_register(&acpi_subsys);

	result = acpi_bus_init();

	if (!result) {
#ifdef CONFIG_PM
		if (!PM_IS_ACTIVE())
			pm_active = 1;
		else {
			printk(KERN_INFO PREFIX "APM is already active, exiting\n");
			disable_acpi();
			result = -ENODEV;
		}
#endif
	} else
		disable_acpi();

	return_VALUE(result);
}
开发者ID:BackupTheBerlios,项目名称:tuxap,代码行数:33,代码来源:bus.c

示例15: acpi_fan_read_state

static int
acpi_fan_read_state (
	char			*page,
	char			**start,
	off_t			off,
	int 			count,
	int 			*eof,
	void			*data)
{
	struct acpi_fan		*fan = (struct acpi_fan *) data;
	char			*p = page;
	int			len = 0;
	int			state = 0;

	ACPI_FUNCTION_TRACE("acpi_fan_read_state");

	if (!fan || (off != 0))
		goto end;

	if (acpi_bus_get_power(fan->handle, &state))
		goto end;

	p += sprintf(p, "status:                  %s\n",
		!state?"on":"off");

end:
	len = (p - page);
	if (len <= off+count) *eof = 1;
	*start = page + off;
	len -= off;
	if (len>count) len = count;
	if (len<0) len = 0;

	return_VALUE(len);
}
开发者ID:sarnobat,项目名称:knoppix,代码行数:35,代码来源:fan.c


注:本文中的return_VALUE函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。