MCPcopy Create free account
hub / github.com/Bananymous/banan-os / BatteryInfoInode

Method BatteryInfoInode

kernel/kernel/ACPI/BatterySystem.cpp:79–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77 if (result.type != AML::Node::Type::Package || result.as.package->num_elements < m_result_index)
78 return BAN::Error::from_errno(EFAULT);
79
80 auto& target_elem = result.as.package->elements[m_result_index];
81 if (!target_elem.resolved || !target_elem.value.node)
82 return BAN::Error::from_errno(EFAULT);
83
84 auto target_conv = AML::convert_node(TRY(target_elem.value.node->copy()), AML::ConvInteger, sizeof(uint64_t));
85 if (target_conv.is_error())
86 return BAN::Error::from_errno(EFAULT);
87
88 m_last_read_ms = SystemTimer::get().ms_since_boot();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected