本文整理汇总了C++中ACPI_VPRINT函数的典型用法代码示例。如果您正苦于以下问题:C++ ACPI_VPRINT函数的具体用法?C++ ACPI_VPRINT怎么用?C++ ACPI_VPRINT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ACPI_VPRINT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: EcRead
static ACPI_STATUS
EcRead(struct acpi_ec_softc *sc, UINT8 Address, UINT8 *Data)
{
ACPI_STATUS Status;
if (!EcIsLocked(sc))
ACPI_VPRINT(sc->ec_dev, acpi_device_get_parent_softc(sc->ec_dev),
"EcRead called without EC lock!\n");
/*EcBurstEnable(EmbeddedController);*/
EC_SET_CSR(sc, EC_COMMAND_READ);
if (ACPI_FAILURE(Status = EcWaitEventIntr(sc, EC_EVENT_INPUT_BUFFER_EMPTY))) {
ACPI_VPRINT(sc->ec_dev, acpi_device_get_parent_softc(sc->ec_dev),
"EcRead: Failed waiting for EC to process read command.\n");
return(Status);
}
EC_SET_DATA(sc, Address);
if (ACPI_FAILURE(Status = EcWaitEventIntr(sc, EC_EVENT_OUTPUT_BUFFER_FULL))) {
ACPI_VPRINT(sc->ec_dev, acpi_device_get_parent_softc(sc->ec_dev),
"EcRead: Failed waiting for EC to send data.\n");
return(Status);
}
(*Data) = EC_GET_DATA(sc);
/*EcBurstDisable(EmbeddedController);*/
return(AE_OK);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:31,代码来源:acpi_ec.c
示例2: acpi_button_notify_pressed_for_sleep
static void
acpi_button_notify_pressed_for_sleep(void *arg)
{
struct acpi_button_softc *sc;
struct acpi_softc *acpi_sc;
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
sc = (struct acpi_button_softc *)arg;
acpi_sc = acpi_device_get_parent_softc(sc->button_dev);
if (acpi_sc == NULL) {
return_VOID;
}
switch (sc->button_type) {
case ACPI_POWER_BUTTON:
ACPI_VPRINT(sc->button_dev, acpi_sc, "power button pressed\n");
acpi_eventhandler_power_button_for_sleep((void *)acpi_sc);
break;
case ACPI_SLEEP_BUTTON:
ACPI_VPRINT(sc->button_dev, acpi_sc, "sleep button pressed\n");
acpi_eventhandler_sleep_button_for_sleep((void *)acpi_sc);
break;
default:
break; /* unknown button type */
}
return_VOID;
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:28,代码来源:acpi_button.c
示例3: acpi_button_notify_wakeup
static void
acpi_button_notify_wakeup(void *arg)
{
struct acpi_button_softc *sc;
struct acpi_softc *acpi_sc;
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
sc = (struct acpi_button_softc *)arg;
acpi_sc = acpi_device_get_parent_softc(sc->button_dev);
if (acpi_sc == NULL)
return_VOID;
acpi_UserNotify("Button", sc->button_handle, sc->button_type);
switch (sc->button_type) {
case ACPI_POWER_BUTTON:
ACPI_VPRINT(sc->button_dev, acpi_sc, "wakeup by power button\n");
acpi_event_power_button_wake(acpi_sc);
break;
case ACPI_SLEEP_BUTTON:
ACPI_VPRINT(sc->button_dev, acpi_sc, "wakeup by sleep button\n");
acpi_event_sleep_button_wake(acpi_sc);
break;
default:
break; /* unknown button type */
}
}
开发者ID:Gwenio,项目名称:DragonFlyBSD,代码行数:28,代码来源:acpi_button.c
示例4: acpi_PkgGas
int
acpi_PkgGas(device_t dev, ACPI_OBJECT *res, int idx, int *rid,
struct resource **dst)
{
ACPI_GENERIC_ADDRESS gas;
ACPI_OBJECT *obj;
obj = &res->Package.Elements[idx];
if (obj == NULL || obj->Type != ACPI_TYPE_BUFFER ||
obj->Buffer.Length < sizeof(ACPI_GENERIC_ADDRESS) + 3) {
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"PkgGas error at %d\n", idx);
return (-1);
}
memcpy(&gas, obj->Buffer.Pointer + 3, sizeof(gas));
*dst = acpi_bus_alloc_gas(dev, rid, &gas);
if (*dst == NULL) {
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"PkgGas error at %d\n", idx);
return (-1);
}
return (0);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:26,代码来源:acpi_package.c
示例5: acpi_cmbat_get_bst
static void
acpi_cmbat_get_bst(void *arg)
{
struct acpi_cmbat_softc *sc;
ACPI_STATUS as;
ACPI_OBJECT *res;
ACPI_HANDLE h;
ACPI_BUFFER bst_buffer;
device_t dev;
ACPI_SERIAL_ASSERT(cmbat);
dev = arg;
sc = device_get_softc(dev);
h = acpi_get_handle(dev);
bst_buffer.Pointer = NULL;
bst_buffer.Length = ACPI_ALLOCATE_BUFFER;
if (!acpi_cmbat_info_expired(&sc->bst_lastupdated))
goto end;
as = AcpiEvaluateObject(h, "_BST", NULL, &bst_buffer);
if (ACPI_FAILURE(as)) {
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"error fetching current battery status -- %s\n",
AcpiFormatException(as));
goto end;
}
res = (ACPI_OBJECT *)bst_buffer.Pointer;
if (!ACPI_PKG_VALID(res, 4)) {
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"battery status corrupted\n");
goto end;
}
if (acpi_PkgInt32(res, 0, &sc->bst.state) != 0)
goto end;
if (acpi_PkgInt32(res, 1, &sc->bst.rate) != 0)
goto end;
if (acpi_PkgInt32(res, 2, &sc->bst.cap) != 0)
goto end;
if (acpi_PkgInt32(res, 3, &sc->bst.volt) != 0)
goto end;
acpi_cmbat_info_updated(&sc->bst_lastupdated);
/* XXX If all batteries are critical, perhaps we should suspend. */
if (sc->bst.state & ACPI_BATT_STAT_CRITICAL) {
if ((sc->flags & ACPI_BATT_STAT_CRITICAL) == 0) {
sc->flags |= ACPI_BATT_STAT_CRITICAL;
device_printf(dev, "critically low charge!\n");
}
} else
sc->flags &= ~ACPI_BATT_STAT_CRITICAL;
end:
if (bst_buffer.Pointer != NULL)
AcpiOsFree(bst_buffer.Pointer);
}
开发者ID:juanfra684,项目名称:DragonFlyBSD,代码行数:59,代码来源:acpi_cmbat.c
示例6: acpi_cmbat_get_bif
static void
acpi_cmbat_get_bif(void *context)
{
device_t dev;
struct acpi_cmbat_softc *sc;
ACPI_STATUS as;
ACPI_OBJECT *res, *tmp;
ACPI_HANDLE h;
ACPI_BUFFER bif_buffer;
dev = context;
sc = device_get_softc(dev);
h = acpi_get_handle(dev);
bif_buffer.Pointer = NULL;
if (!acpi_cmbat_info_expired(&sc->bif_lastupdated)) {
return;
}
if (sc->bif_updating) {
return;
}
sc->bif_updating = 1;
bif_buffer.Length = ACPI_ALLOCATE_BUFFER;
if (ACPI_FAILURE(as = AcpiEvaluateObject(h, "_BIF", NULL, &bif_buffer))) {
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"error fetching current battery info -- %s\n",
AcpiFormatException(as));
goto end;
}
res = (ACPI_OBJECT *)bif_buffer.Pointer;
if ((res == NULL) || (res->Type != ACPI_TYPE_PACKAGE) || (res->Package.Count != 13)) {
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"battery info corrupted\n");
goto end;
}
PKG_GETINT(res, tmp, 0, sc->bif.unit, end);
PKG_GETINT(res, tmp, 1, sc->bif.dcap, end);
PKG_GETINT(res, tmp, 2, sc->bif.lfcap, end);
PKG_GETINT(res, tmp, 3, sc->bif.btech, end);
PKG_GETINT(res, tmp, 4, sc->bif.dvol, end);
PKG_GETINT(res, tmp, 5, sc->bif.wcap, end);
PKG_GETINT(res, tmp, 6, sc->bif.lcap, end);
PKG_GETINT(res, tmp, 7, sc->bif.gra1, end);
PKG_GETINT(res, tmp, 8, sc->bif.gra2, end);
PKG_GETSTR(res, tmp, 9, sc->bif.model, ACPI_CMBAT_MAXSTRLEN, end);
PKG_GETSTR(res, tmp, 10, sc->bif.serial, ACPI_CMBAT_MAXSTRLEN, end);
PKG_GETSTR(res, tmp, 11, sc->bif.type, ACPI_CMBAT_MAXSTRLEN, end);
PKG_GETSTR(res, tmp, 12, sc->bif.oeminfo, ACPI_CMBAT_MAXSTRLEN, end);
acpi_cmbat_info_updated(&sc->bif_lastupdated);
end:
if (bif_buffer.Pointer != NULL)
AcpiOsFree(bif_buffer.Pointer);
sc->bif_updating = 0;
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:59,代码来源:acpi_cmbat.c
示例7: EcTransaction
static ACPI_STATUS
EcTransaction(struct acpi_ec_softc *sc, EC_REQUEST *EcRequest)
{
ACPI_STATUS Status;
/*
* Lock the EC
*/
if (ACPI_FAILURE(Status = EcLock(sc)))
return(Status);
/*
* Perform the transaction.
*/
switch (EcRequest->Command) {
case EC_COMMAND_READ:
Status = EcRead(sc, EcRequest->Address, &(EcRequest->Data));
break;
case EC_COMMAND_WRITE:
Status = EcWrite(sc, EcRequest->Address, &(EcRequest->Data));
break;
default:
Status = AE_SUPPORT;
break;
}
/*
* Unlock the EC
*/
EcUnlock(sc);
/*
* Clear & Re-Enable the EC GPE:
* -----------------------------
* 'Consume' any EC GPE events that we generated while performing
* the transaction (e.g. IBF/OBF). Clearing the GPE here shouldn't
* have an adverse affect on outstanding EC-SCI's, as the source
* (EC-SCI) will still be high and thus should trigger the GPE
* immediately after we re-enabling it.
*/
if (sc->ec_pendquery){
if (ACPI_FAILURE(AcpiOsQueueForExecution(OSD_PRIORITY_HIGH,
EcGpeQueryHandler, sc)))
printf("Pend Query Queuing Failed\n");
sc->ec_pendquery = 0;
}
if (ACPI_FAILURE(AcpiClearEvent(sc->ec_gpebit, ACPI_EVENT_GPE)))
ACPI_VPRINT(sc->ec_dev, acpi_device_get_parent_softc(sc->ec_dev),
"EcRequest: Unable to clear the EC GPE.\n");
if (ACPI_FAILURE(AcpiEnableEvent(sc->ec_gpebit, ACPI_EVENT_GPE, 0)))
ACPI_VPRINT(sc->ec_dev, acpi_device_get_parent_softc(sc->ec_dev),
"EcRequest: Unable to re-enable the EC GPE.\n");
return(Status);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:58,代码来源:acpi_ec.c
示例8: acpi_cmbat_init_battery
static void
acpi_cmbat_init_battery(void *arg)
{
struct acpi_cmbat_softc *sc;
int retry, valid;
device_t dev;
dev = (device_t)arg;
sc = device_get_softc(dev);
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"battery initialization start\n");
/*
* Try repeatedly to get valid data from the battery. Since the
* embedded controller isn't always ready just after boot, we may have
* to wait a while.
*/
for (retry = 0; retry < ACPI_CMBAT_RETRY_MAX; retry++, AcpiOsSleep(10000)) {
/* batteries on DOCK can be ejected w/ DOCK during retrying */
if (!device_is_attached(dev))
return;
if (!acpi_BatteryIsPresent(dev))
continue;
/*
* Only query the battery if this is the first try or the specific
* type of info is still invalid.
*/
ACPI_SERIAL_BEGIN(cmbat);
if (retry == 0 || !acpi_battery_bst_valid(&sc->bst)) {
timespecclear(&sc->bst_lastupdated);
acpi_cmbat_get_bst(dev);
}
if (retry == 0 || !acpi_battery_bif_valid(&sc->bif))
acpi_cmbat_get_bif(dev);
valid = acpi_battery_bst_valid(&sc->bst) &&
acpi_battery_bif_valid(&sc->bif);
ACPI_SERIAL_END(cmbat);
if (valid)
break;
}
if (retry == ACPI_CMBAT_RETRY_MAX) {
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"battery initialization failed, giving up\n");
} else {
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"battery initialization done, tried %d times\n", retry + 1);
}
}
开发者ID:dcui,项目名称:FreeBSD-9.3_kernel,代码行数:53,代码来源:acpi_cmbat.c
示例9: acpi_cmbat_init_battery
static void
acpi_cmbat_init_battery(void *arg)
{
int retry;
device_t dev = (device_t)arg;
struct acpi_cmbat_softc *sc = device_get_softc(dev);
#define ACPI_CMBAT_RETRY_MAX 6
if (sc->initializing) {
return;
}
sc->initializing = 1;
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"battery initialization start\n");
for (retry = 0; retry < ACPI_CMBAT_RETRY_MAX; retry++, AcpiOsSleep(10, 0)) {
sc->present = acpi_BatteryIsPresent(dev);
if (!sc->present) {
continue;
}
timespecclear(&sc->bst_lastupdated);
timespecclear(&sc->bif_lastupdated);
acpi_cmbat_get_bst(dev);
if (!acpi_cmbat_is_bst_valid(&sc->bst)) {
continue;
}
acpi_cmbat_get_bif(dev);
if (!acpi_cmbat_is_bif_valid(&sc->bif)) {
continue;
}
break;
}
if (retry == ACPI_CMBAT_RETRY_MAX)
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"battery initialization failed, giving up\n");
else
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"battery initialization done, tried %d times\n",
retry+1);
sc->initializing = 0;
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:51,代码来源:acpi_cmbat.c
示例10: acpi_cmbat_get_bst
static void
acpi_cmbat_get_bst(void *context)
{
device_t dev;
struct acpi_cmbat_softc *sc;
ACPI_STATUS as;
ACPI_OBJECT *res, *tmp;
ACPI_HANDLE h;
ACPI_BUFFER bst_buffer;
dev = context;
sc = device_get_softc(dev);
h = acpi_get_handle(dev);
bst_buffer.Pointer = NULL;
if (!acpi_cmbat_info_expired(&sc->bst_lastupdated)) {
return;
}
if (sc->bst_updating) {
return;
}
sc->bst_updating = 1;
bst_buffer.Length = ACPI_ALLOCATE_BUFFER;
if (ACPI_FAILURE(as = AcpiEvaluateObject(h, "_BST", NULL, &bst_buffer))) {
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"error fetching current battery status -- %s\n",
AcpiFormatException(as));
goto end;
}
res = (ACPI_OBJECT *)bst_buffer.Pointer;
if ((res == NULL) || (res->Type != ACPI_TYPE_PACKAGE) || (res->Package.Count != 4)) {
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"battery status corrupted\n");
goto end;
}
PKG_GETINT(res, tmp, 0, sc->bst.state, end);
PKG_GETINT(res, tmp, 1, sc->bst.rate, end);
PKG_GETINT(res, tmp, 2, sc->bst.cap, end);
PKG_GETINT(res, tmp, 3, sc->bst.volt, end);
acpi_cmbat_info_updated(&sc->bst_lastupdated);
end:
if (bst_buffer.Pointer != NULL)
AcpiOsFree(bst_buffer.Pointer);
sc->bst_updating = 0;
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:50,代码来源:acpi_cmbat.c
示例11: acpi_lid_notify_status_changed
static void
acpi_lid_notify_status_changed(void *arg)
{
struct acpi_lid_softc *sc;
struct acpi_softc *acpi_sc;
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
sc = (struct acpi_lid_softc *)arg;
/*
* Evaluate _LID and check the return value, update lid status.
* Zero: The lid is closed
* Non-zero: The lid is open
*/
if (ACPI_FAILURE(acpi_EvaluateInteger(sc->lid_handle, "_LID", &sc->lid_status)))
return_VOID;
acpi_sc = acpi_device_get_parent_softc(sc->lid_dev);
if (acpi_sc == NULL) {
return_VOID;
}
ACPI_VPRINT(sc->lid_dev, acpi_sc,
"Lid %s\n", sc->lid_status ? "opened" : "closed");
if (sc->lid_status == 0) {
EVENTHANDLER_INVOKE(acpi_sleep_event, acpi_sc->acpi_lid_switch_sx);
} else {
EVENTHANDLER_INVOKE(acpi_wakeup_event, acpi_sc->acpi_lid_switch_sx);
}
return_VOID;
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:34,代码来源:acpi_lid.c
示例12: acpi_dock_eject_child
static ACPI_STATUS
acpi_dock_eject_child(ACPI_HANDLE handle, UINT32 level, void *context,
void **status)
{
device_t dock_dev, dev;
ACPI_HANDLE dock_handle;
dock_dev = *(device_t *)context;
dock_handle = acpi_get_handle(dock_dev);
if (!acpi_dock_is_ejd_device(dock_handle, handle))
goto out;
ACPI_VPRINT(dock_dev, acpi_device_get_parent_softc(dock_dev),
"ejecting device for %s\n", acpi_name(handle));
dev = acpi_get_device(handle);
if (dev != NULL && device_is_attached(dev)) {
mtx_lock(&Giant);
device_detach(dev);
mtx_unlock(&Giant);
}
acpi_SetInteger(handle, "_EJ0", 0);
out:
return (AE_OK);
}
开发者ID:DangerDexter,项目名称:FreeBSD-8.0-dyntick,代码行数:27,代码来源:acpi_dock.c
示例13: acpi_acad_get_status
static void
acpi_acad_get_status(void *context)
{
struct acpi_acad_softc *sc;
device_t dev;
ACPI_HANDLE h;
int newstatus;
dev = context;
sc = device_get_softc(dev);
h = acpi_get_handle(dev);
newstatus = -1;
acpi_GetInteger(h, "_PSR", &newstatus);
/* If status is valid and has changed, notify the system. */
ACPI_SERIAL_BEGIN(acad);
if (newstatus != -1 && sc->status != newstatus) {
sc->status = newstatus;
power_profile_set_state(newstatus ? POWER_PROFILE_PERFORMANCE :
POWER_PROFILE_ECONOMY);
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"%s Line\n", newstatus ? "On" : "Off");
acpi_UserNotify("ACAD", h, newstatus);
}
ACPI_SERIAL_END(acad);
}
开发者ID:DangerDexter,项目名称:FreeBSD-8.0-dyntick,代码行数:26,代码来源:acpi_acad.c
示例14: acpi_tz_notify_handler
static void
acpi_tz_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context)
{
struct acpi_tz_softc *sc = (struct acpi_tz_softc *)context;
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
switch (notify) {
case TZ_NOTIFY_TEMPERATURE:
/* Temperature change occurred */
acpi_tz_signal(sc, 0);
break;
case TZ_NOTIFY_DEVICES:
case TZ_NOTIFY_LEVELS:
/* Zone devices/setpoints changed */
acpi_tz_signal(sc, TZ_FLAG_GETSETTINGS);
break;
default:
ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev),
"unknown Notify event 0x%x\n", notify);
break;
}
acpi_UserNotify("Thermal", h, notify);
return_VOID;
}
开发者ID:ele7enxxh,项目名称:dtrace-pf,代码行数:27,代码来源:acpi_thermal.c
示例15: acpi_tz_power_profile
/*
* System power profile may have changed; fetch and notify the
* thermal zone accordingly.
*
* Since this can be called from an arbitrary eventhandler, it needs
* to get the ACPI lock itself.
*/
static void
acpi_tz_power_profile(void *arg)
{
ACPI_STATUS status;
struct acpi_tz_softc *sc = (struct acpi_tz_softc *)arg;
int state;
state = power_profile_get_state();
if (state != POWER_PROFILE_PERFORMANCE && state != POWER_PROFILE_ECONOMY)
return;
/* check that we haven't decided there's no _SCP method */
if ((sc->tz_flags & TZ_FLAG_NO_SCP) == 0) {
/* Call _SCP to set the new profile */
status = acpi_SetInteger(sc->tz_handle, "_SCP",
(state == POWER_PROFILE_PERFORMANCE) ? 0 : 1);
if (ACPI_FAILURE(status)) {
if (status != AE_NOT_FOUND)
ACPI_VPRINT(sc->tz_dev,
acpi_device_get_parent_softc(sc->tz_dev),
"can't evaluate %s._SCP - %s\n",
acpi_name(sc->tz_handle),
AcpiFormatException(status));
sc->tz_flags |= TZ_FLAG_NO_SCP;
} else {
/* We have to re-evaluate the entire zone now */
acpi_tz_signal(sc, TZ_FLAG_GETSETTINGS);
}
}
}
开发者ID:ele7enxxh,项目名称:dtrace-pf,代码行数:38,代码来源:acpi_thermal.c
示例16: acpi_tz_get_temperature
/*
* Get the current temperature.
*/
static int
acpi_tz_get_temperature(struct acpi_tz_softc *sc)
{
int temp;
ACPI_STATUS status;
ACPI_FUNCTION_NAME ("acpi_tz_get_temperature");
/* Evaluate the thermal zone's _TMP method. */
status = acpi_GetInteger(sc->tz_handle, acpi_tz_tmp_name, &temp);
if (ACPI_FAILURE(status)) {
ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev),
"error fetching current temperature -- %s\n",
AcpiFormatException(status));
return (FALSE);
}
/* Check it for validity. */
acpi_tz_sanity(sc, &temp, acpi_tz_tmp_name);
if (temp == -1)
return (FALSE);
ACPI_DEBUG_PRINT((ACPI_DB_VALUES, "got %d.%dC\n", TZ_KELVTOC(temp)));
sc->tz_temperature = temp;
return (TRUE);
}
开发者ID:ele7enxxh,项目名称:dtrace-pf,代码行数:29,代码来源:acpi_thermal.c
示例17: acpi_tz_switch_cooler_on
/*
* Given an object, verify that it's a reference to a device of some sort,
* and try to switch it on.
*
* XXX replication of off/on function code is bad.
*/
static void
acpi_tz_switch_cooler_on(ACPI_OBJECT *obj, void *arg)
{
struct acpi_tz_softc *sc = (struct acpi_tz_softc *)arg;
ACPI_HANDLE cooler;
ACPI_STATUS status;
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
cooler = acpi_GetReference(NULL, obj);
if (cooler == NULL) {
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "can't get handle\n"));
return_VOID;
}
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "called to turn %s on\n",
acpi_name(cooler)));
status = acpi_pwr_switch_consumer(cooler, ACPI_STATE_D0);
if (ACPI_FAILURE(status)) {
ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev),
"failed to activate %s - %s\n", acpi_name(cooler),
AcpiFormatException(status));
}
return_VOID;
}
开发者ID:ele7enxxh,项目名称:dtrace-pf,代码行数:32,代码来源:acpi_thermal.c
示例18: acpi_PkgStr
int
acpi_PkgStr(device_t dev, ACPI_OBJECT *res, int idx, void *dst, size_t size)
{
ACPI_OBJECT *obj;
void *ptr;
size_t length;
obj = &res->Package.Elements[idx];
if (obj == NULL) {
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"PkgStr NULL object at %d\n", idx);
return (-1);
}
bzero(dst, sizeof(dst));
switch (obj->Type) {
case ACPI_TYPE_STRING:
ptr = obj->String.Pointer;
length = obj->String.Length;
break;
case ACPI_TYPE_BUFFER:
ptr = obj->Buffer.Pointer;
length = obj->Buffer.Length;
break;
default:
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"PkgStr: invalid object type %d at %d\n", obj->Type, idx);
return (-1);
}
/* Make sure string will fit, including terminating NUL */
if (++length > size) {
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"PkgStr string too long (%zu bytes) at %d\n", length, idx);
return (-1);
}
strlcpy(dst, ptr, length);
return (0);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:40,代码来源:acpi_package.c
示例19: acpi_acad_init_acline
static void
acpi_acad_init_acline(void *arg)
{
struct acpi_acad_softc *sc;
device_t dev;
int retry;
dev = (device_t)arg;
sc = device_get_softc(dev);
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"acline initialization start\n");
for (retry = 0; retry < ACPI_ACAD_RETRY_MAX; retry++) {
acpi_acad_get_status(dev);
if (sc->status != -1)
break;
AcpiOsSleep(10000);
}
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"acline initialization done, tried %d times\n", retry + 1);
}
开发者ID:DangerDexter,项目名称:FreeBSD-8.0-dyntick,代码行数:22,代码来源:acpi_acad.c
示例20: acpi_PkgInt
int
acpi_PkgInt(device_t dev, ACPI_OBJECT *res, int idx, ACPI_INTEGER *dst)
{
ACPI_OBJECT *obj;
obj = &res->Package.Elements[idx];
if (obj == NULL || obj->Type != ACPI_TYPE_INTEGER) {
ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
"PkgInt error, pkg[%d] at %d %p\n",
res->Package.Count, idx, obj);
return (-1);
}
*dst = obj->Integer.Value;
return (0);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:16,代码来源:acpi_package.c
注:本文中的ACPI_VPRINT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论