本文整理汇总了C++中AcpiWriteBitRegister函数的典型用法代码示例。如果您正苦于以下问题:C++ AcpiWriteBitRegister函数的具体用法?C++ AcpiWriteBitRegister怎么用?C++ AcpiWriteBitRegister使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AcpiWriteBitRegister函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AeHardwareInterfaces
static void
AeHardwareInterfaces (
void)
{
ACPI_STATUS Status;
UINT32 Value;
Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, 1);
AE_CHECK_OK (AcpiWriteBitRegister, Status);
Status = AcpiWriteBitRegister (ACPI_BITREG_GLOBAL_LOCK_ENABLE, 1);
AE_CHECK_OK (AcpiWriteBitRegister, Status);
Status = AcpiWriteBitRegister (ACPI_BITREG_SLEEP_ENABLE, 1);
AE_CHECK_OK (AcpiWriteBitRegister, Status);
Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 1);
AE_CHECK_OK (AcpiWriteBitRegister, Status);
Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &Value);
AE_CHECK_OK (AcpiReadBitRegister, Status);
Status = AcpiReadBitRegister (ACPI_BITREG_GLOBAL_LOCK_ENABLE, &Value);
AE_CHECK_OK (AcpiReadBitRegister, Status);
Status = AcpiReadBitRegister (ACPI_BITREG_SLEEP_ENABLE, &Value);
AE_CHECK_OK (AcpiReadBitRegister, Status);
Status = AcpiReadBitRegister (ACPI_BITREG_ARB_DISABLE, &Value);
AE_CHECK_OK (AcpiReadBitRegister, Status);
}
示例2: AcpiEvFixedEventInitialize
static ACPI_STATUS
AcpiEvFixedEventInitialize (
void)
{
UINT32 i;
ACPI_STATUS Status;
/*
* Initialize the structure that keeps track of fixed event handlers and
* enable the fixed events.
*/
for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
{
AcpiGbl_FixedEventHandlers[i].Handler = NULL;
AcpiGbl_FixedEventHandlers[i].Context = NULL;
/* Disable the fixed event */
if (AcpiGbl_FixedEventInfo[i].EnableRegisterId != 0xFF)
{
Status = AcpiWriteBitRegister (
AcpiGbl_FixedEventInfo[i].EnableRegisterId,
ACPI_DISABLE_EVENT);
if (ACPI_FAILURE (Status))
{
return (Status);
}
}
}
return (AE_OK);
}
示例3: AcpiClearEvent
ACPI_STATUS
AcpiClearEvent (
UINT32 Event)
{
ACPI_STATUS Status = AE_OK;
ACPI_FUNCTION_TRACE (AcpiClearEvent);
/* Decode the Fixed Event */
if (Event > ACPI_EVENT_MAX)
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/*
* Clear the requested fixed event (By writing a one to the status
* register bit)
*/
Status = AcpiWriteBitRegister (
AcpiGbl_FixedEventInfo[Event].StatusRegisterId,
ACPI_CLEAR_STATUS);
return_ACPI_STATUS (Status);
}
示例4: acpi_cst_c3_bm_rld_handler
static void
acpi_cst_c3_bm_rld_handler(struct cpuhelper_msg *msg)
{
AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_RLD, 1);
cpuhelper_replymsg(msg, 0);
}
示例5: AcpiEnterSleepStateS4bios
ACPI_STATUS
AcpiEnterSleepStateS4bios (
void)
{
UINT32 InValue;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (AcpiEnterSleepStateS4bios);
/* Clear the wake status bit (PM1) */
Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
Status = AcpiHwClearAcpiStatus ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/*
* 1) Disable/Clear all GPEs
* 2) Enable all wakeup GPEs
*/
Status = AcpiHwDisableAllGpes ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
AcpiGbl_SystemAwakeAndRunning = FALSE;
Status = AcpiHwEnableAllWakeupGpes ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
ACPI_FLUSH_CPU_CACHE ();
Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand,
(UINT32) AcpiGbl_FADT.S4BiosRequest, 8);
do {
AcpiOsStall (ACPI_USEC_PER_MSEC);
Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &InValue);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
} while (!InValue);
return_ACPI_STATUS (AE_OK);
}
示例6: acpi_cst_c3_bm_rld_handler
static void
acpi_cst_c3_bm_rld_handler(netmsg_t msg)
{
struct netmsg_acpi_cst *rmsg = (struct netmsg_acpi_cst *)msg;
AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_RLD, 1);
lwkt_replymsg(&rmsg->base.lmsg, 0);
}
示例7: AeHardwareInterfaces
static void
AeHardwareInterfaces (
void)
{
#if (!ACPI_REDUCED_HARDWARE)
ACPI_STATUS Status;
UINT32 Value;
/* If Hardware Reduced flag is set, we are all done */
if (AcpiGbl_ReducedHardware)
{
return;
}
Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, 1);
ACPI_CHECK_OK (AcpiWriteBitRegister, Status);
Status = AcpiWriteBitRegister (ACPI_BITREG_GLOBAL_LOCK_ENABLE, 1);
ACPI_CHECK_OK (AcpiWriteBitRegister, Status);
Status = AcpiWriteBitRegister (ACPI_BITREG_SLEEP_ENABLE, 1);
ACPI_CHECK_OK (AcpiWriteBitRegister, Status);
Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 1);
ACPI_CHECK_OK (AcpiWriteBitRegister, Status);
Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &Value);
ACPI_CHECK_OK (AcpiReadBitRegister, Status);
Status = AcpiReadBitRegister (ACPI_BITREG_GLOBAL_LOCK_ENABLE, &Value);
ACPI_CHECK_OK (AcpiReadBitRegister, Status);
Status = AcpiReadBitRegister (ACPI_BITREG_SLEEP_ENABLE, &Value);
ACPI_CHECK_OK (AcpiReadBitRegister, Status);
Status = AcpiReadBitRegister (ACPI_BITREG_ARB_DISABLE, &Value);
ACPI_CHECK_OK (AcpiReadBitRegister, Status);
#endif /* !ACPI_REDUCED_HARDWARE */
}
示例8: AcpiEnableEvent
ACPI_STATUS
AcpiEnableEvent (
UINT32 Event,
UINT32 Flags)
{
ACPI_STATUS Status = AE_OK;
UINT32 Value;
ACPI_FUNCTION_TRACE (AcpiEnableEvent);
/* If Hardware Reduced flag is set, there are no fixed events */
if (AcpiGbl_ReducedHardware)
{
return_ACPI_STATUS (AE_OK);
}
/* Decode the Fixed Event */
if (Event > ACPI_EVENT_MAX)
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/*
* Enable the requested fixed event (by writing a one to the enable
* register bit)
*/
Status = AcpiWriteBitRegister (
AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
ACPI_ENABLE_EVENT);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* Make sure that the hardware responded */
Status = AcpiReadBitRegister (
AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &Value);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
if (Value != 1)
{
ACPI_ERROR ((AE_INFO,
"Could not enable %s event", AcpiUtGetEventName (Event)));
return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE);
}
return_ACPI_STATUS (Status);
}
示例9: acpicpu_cstate_bm_check
static bool
acpicpu_cstate_bm_check(void)
{
uint32_t val = 0;
ACPI_STATUS rv;
rv = AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, &val);
if (ACPI_FAILURE(rv) || val == 0)
return false;
(void)AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, 1);
return true;
}
示例10: AcpiEvFixedEventDispatch
static UINT32
AcpiEvFixedEventDispatch (
UINT32 Event)
{
ACPI_FUNCTION_ENTRY ();
/* Clear the status bit */
(void) AcpiWriteBitRegister (
AcpiGbl_FixedEventInfo[Event].StatusRegisterId,
ACPI_CLEAR_STATUS);
/*
* Make sure that a handler exists. If not, report an error
* and disable the event to prevent further interrupts.
*/
if (!AcpiGbl_FixedEventHandlers[Event].Handler)
{
(void) AcpiWriteBitRegister (
AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
ACPI_DISABLE_EVENT);
ACPI_ERROR ((AE_INFO,
"No installed handler for fixed event - %s (%u), disabling",
AcpiUtGetEventName (Event), Event));
return (ACPI_INTERRUPT_NOT_HANDLED);
}
/* Invoke the Fixed Event handler */
return ((AcpiGbl_FixedEventHandlers[Event].Handler)(
AcpiGbl_FixedEventHandlers[Event].Context));
}
示例11: AcpiEvFixedEventDispatch
static UINT32
AcpiEvFixedEventDispatch (
UINT32 Event)
{
ACPI_FUNCTION_ENTRY ();
/* Clear the status bit */
(void) AcpiWriteBitRegister (
AcpiGbl_FixedEventInfo[Event].StatusRegisterId,
ACPI_CLEAR_STATUS);
/*
* Make sure we've got a handler. If not, report an error. The event is
* disabled to prevent further interrupts.
*/
if (NULL == AcpiGbl_FixedEventHandlers[Event].Handler)
{
(void) AcpiWriteBitRegister (
AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
ACPI_DISABLE_EVENT);
ACPI_ERROR ((AE_INFO,
"No installed handler for fixed event [0x%08X]",
Event));
return (ACPI_INTERRUPT_NOT_HANDLED);
}
/* Invoke the Fixed Event handler */
return ((AcpiGbl_FixedEventHandlers[Event].Handler)(
AcpiGbl_FixedEventHandlers[Event].Context));
}
示例12: AcpiDisableEvent
ACPI_STATUS
AcpiDisableEvent (
UINT32 Event,
UINT32 Flags)
{
ACPI_STATUS Status = AE_OK;
UINT32 Value;
ACPI_FUNCTION_TRACE (AcpiDisableEvent);
/* Decode the Fixed Event */
if (Event > ACPI_EVENT_MAX)
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/*
* Disable the requested fixed event (by writing a zero to the enable
* register bit)
*/
Status = AcpiWriteBitRegister (
AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
ACPI_DISABLE_EVENT);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
Status = AcpiReadBitRegister (
AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &Value);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
if (Value != 0)
{
ACPI_ERROR ((AE_INFO,
"Could not disable %s events", AcpiUtGetEventName (Event)));
return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE);
}
return_ACPI_STATUS (Status);
}
示例13: AcpiEvReleaseGlobalLock
ACPI_STATUS
AcpiEvReleaseGlobalLock (
void)
{
BOOLEAN Pending = FALSE;
ACPI_STATUS Status = AE_OK;
ACPI_FUNCTION_TRACE (EvReleaseGlobalLock);
/* Lock must be already acquired */
if (!AcpiGbl_GlobalLockAcquired)
{
ACPI_WARNING ((AE_INFO,
"Cannot release the ACPI Global Lock, it has not been acquired"));
return_ACPI_STATUS (AE_NOT_ACQUIRED);
}
if (AcpiGbl_GlobalLockPresent)
{
/* Allow any thread to release the lock */
ACPI_RELEASE_GLOBAL_LOCK (AcpiGbl_FACS, Pending);
/*
* If the pending bit was set, we must write GBL_RLS to the control
* register
*/
if (Pending)
{
Status = AcpiWriteBitRegister (
ACPI_BITREG_GLOBAL_LOCK_RELEASE, ACPI_ENABLE_EVENT);
}
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Released hardware Global Lock\n"));
}
AcpiGbl_GlobalLockAcquired = FALSE;
/* Release the local GL mutex */
AcpiOsReleaseMutex (AcpiGbl_GlobalLockMutex->Mutex.OsMutex);
return_ACPI_STATUS (Status);
}
示例14: acpi_cst_cx_probe_cst
//.........这里部分代码省略.........
if (cx_ptr->gas.SpaceId != ACPI_ADR_SPACE_FIXED_HARDWARE)
sc->cst_flags &= ~ACPI_CST_FLAG_MATCH_HT;
cx_ptr->rid = sc->cst_parent->cpu_next_rid;
acpi_bus_alloc_gas(sc->cst_dev, &cx_ptr->res_type, &cx_ptr->rid,
&cx_ptr->gas, &cx_ptr->res, RF_SHAREABLE);
if (cx_ptr->res != NULL) {
sc->cst_parent->cpu_next_rid++;
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"cpu_cst%d: Got C%d - %d latency\n",
device_get_unit(sc->cst_dev), cx_ptr->type,
cx_ptr->trans_lat));
cx_ptr->enter = acpi_cst_cx_io_enter;
cx_ptr->btag = rman_get_bustag(cx_ptr->res);
cx_ptr->bhand = rman_get_bushandle(cx_ptr->res);
error = acpi_cst_cx_setup(cx_ptr);
if (error)
panic("C%d CST I/O setup failed: %d", cx_ptr->type, error);
cx_ptr++;
sc->cst_cx_count++;
} else {
error = acpi_cst_cx_setup(cx_ptr);
if (!error) {
KASSERT(cx_ptr->enter != NULL,
("C%d enter is not set", cx_ptr->type));
cx_ptr++;
sc->cst_cx_count++;
}
}
}
AcpiOsFree(buf.Pointer);
if (sc->cst_flags & ACPI_CST_FLAG_MATCH_HT) {
cpumask_t mask;
mask = get_cpumask_from_level(sc->cst_cpuid, CORE_LEVEL);
if (CPUMASK_TESTNZERO(mask)) {
int cpu;
for (cpu = 0; cpu < ncpus; ++cpu) {
struct acpi_cst_softc *sc1 = acpi_cst_softc[cpu];
if (sc1 == NULL || sc1 == sc ||
(sc1->cst_flags & ACPI_CST_FLAG_ATTACHED) == 0 ||
(sc1->cst_flags & ACPI_CST_FLAG_MATCH_HT) == 0)
continue;
if (!CPUMASK_TESTBIT(mask, sc1->cst_cpuid))
continue;
if (sc1->cst_cx_count != sc->cst_cx_count) {
struct acpi_cst_softc *src_sc, *dst_sc;
if (bootverbose) {
device_printf(sc->cst_dev,
"inconstent C-state count: %d, %s has %d\n",
sc->cst_cx_count,
device_get_nameunit(sc1->cst_dev),
sc1->cst_cx_count);
}
if (sc1->cst_cx_count > sc->cst_cx_count) {
src_sc = sc1;
dst_sc = sc;
} else {
src_sc = sc;
dst_sc = sc1;
}
acpi_cst_copy(dst_sc, src_sc);
}
}
}
}
if (reprobe) {
/* If there are C3(+) states, always enable bus master wakeup */
if ((acpi_cst_quirks & ACPI_CST_QUIRK_NO_BM) == 0) {
for (i = 0; i < sc->cst_cx_count; ++i) {
struct acpi_cst_cx *cx = &sc->cst_cx_states[i];
if (cx->type >= ACPI_STATE_C3) {
AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_RLD, 1);
break;
}
}
}
/* Fix up the lowest Cx being used */
acpi_cst_set_lowest_oncpu(sc, sc->cst_cx_lowest_req);
}
/*
* Cache the lowest non-C3 state.
* NOTE: must after cst_cx_lowest is set.
*/
acpi_cst_non_c3(sc);
cpu_sfence();
sc->cst_flags &= ~ACPI_CST_FLAG_PROBING;
return (0);
}
示例15: acpi_cst_idle
/*
* Idle the CPU in the lowest state possible. This function is called with
* interrupts disabled. Note that once it re-enables interrupts, a task
* switch can occur so do not access shared data (i.e. the softc) after
* interrupts are re-enabled.
*/
static void
acpi_cst_idle(void)
{
struct acpi_cst_softc *sc;
struct acpi_cst_cx *cx_next;
union microtime_pcpu start, end;
int cx_next_idx, i, tdiff, bm_arb_disabled = 0;
/* If disabled, return immediately. */
if (acpi_cst_disable_idle) {
ACPI_ENABLE_IRQS();
return;
}
/*
* Look up our CPU id to get our softc. If it's NULL, we'll use C1
* since there is no Cx state for this processor.
*/
sc = acpi_cst_softc[mdcpu->mi.gd_cpuid];
if (sc == NULL) {
acpi_cst_c1_halt();
return;
}
/* Still probing; use C1 */
if (sc->cst_flags & ACPI_CST_FLAG_PROBING) {
acpi_cst_c1_halt();
return;
}
/* Find the lowest state that has small enough latency. */
cx_next_idx = 0;
for (i = sc->cst_cx_lowest; i >= 0; i--) {
if (sc->cst_cx_states[i].trans_lat * 3 <= sc->cst_prev_sleep) {
cx_next_idx = i;
break;
}
}
/*
* Check for bus master activity if needed for the selected state.
* If there was activity, clear the bit and use the lowest non-C3 state.
*/
cx_next = &sc->cst_cx_states[cx_next_idx];
if (cx_next->flags & ACPI_CST_CX_FLAG_BM_STS) {
int bm_active;
AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, &bm_active);
if (bm_active != 0) {
AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_STATUS, 1);
cx_next_idx = sc->cst_non_c3;
}
}
/* Select the next state and update statistics. */
cx_next = &sc->cst_cx_states[cx_next_idx];
sc->cst_cx_stats[cx_next_idx]++;
KASSERT(cx_next->type != ACPI_STATE_C0, ("C0 sleep"));
/*
* Execute HLT (or equivalent) and wait for an interrupt. We can't
* calculate the time spent in C1 since the place we wake up is an
* ISR. Assume we slept half of quantum and return.
*/
if (cx_next->type == ACPI_STATE_C1) {
sc->cst_prev_sleep = (sc->cst_prev_sleep * 3 + 500000 / hz) / 4;
cx_next->enter(cx_next);
return;
}
/* Execute the proper preamble before enter the selected state. */
if (cx_next->preamble == ACPI_CST_CX_PREAMBLE_BM_ARB) {
AcpiWriteBitRegister(ACPI_BITREG_ARB_DISABLE, 1);
bm_arb_disabled = 1;
} else if (cx_next->preamble == ACPI_CST_CX_PREAMBLE_WBINVD) {
ACPI_FLUSH_CPU_CACHE();
}
/*
* Enter the selected state and check time spent asleep.
*/
microtime_pcpu_get(&start);
cpu_mfence();
cx_next->enter(cx_next);
cpu_mfence();
microtime_pcpu_get(&end);
/* Enable bus master arbitration, if it was disabled. */
if (bm_arb_disabled)
AcpiWriteBitRegister(ACPI_BITREG_ARB_DISABLE, 0);
ACPI_ENABLE_IRQS();
//.........这里部分代码省略.........