Skip to content

Commit 3df3e11

Browse files
committed
Do not override CPU proximity SMC key in SMCDellSensors, clear activity counter in timer
1 parent 6da45d0 commit 3df3e11

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed

Changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
VirtualSMC Changelog
22
====================
3+
#### v1.2.8
4+
- Do not override CPU proximity SMC key in SMCDellSensors + minor fixes in logic
5+
36
#### v1.2.7
47
- Fixed build settings for 32-bit
58
- Improved EC fan monitoring instructions, thx all the contributors

Sensors/SMCDellSensors/KeyImplementations.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,6 @@ SMC_RESULT FS__::update(const SMC_DATA *src) {
7676
return SmcSuccess;
7777
}
7878

79-
SMC_RESULT TC0P::readAccess() {
80-
auto val = SMIMonitor::getShared()->state.tempInfo[index].temp;
81-
*reinterpret_cast<uint16_t *>(data) = VirtualSMCAPI::encodeIntSp(SmcKeyTypeSp78, val);
82-
return SmcSuccess;
83-
}
84-
8579
SMC_RESULT TG0P::readAccess() {
8680
auto val = SMIMonitor::getShared()->state.tempInfo[index].temp;
8781
*reinterpret_cast<uint16_t *>(data) = VirtualSMCAPI::encodeIntSp(SmcKeyTypeSp78, val);

Sensors/SMCDellSensors/SMCDellSensors.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ IOService *SMCDellSensors::probe(IOService *provider, SInt32 *score) {
9595
switch (type)
9696
{
9797
case TempInfo::CPU:
98-
VirtualSMCAPI::addKey(KeyTC0P(0), vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp78, new TC0P(i),
99-
SMC_KEY_ATTRIBUTE_WRITE|SMC_KEY_ATTRIBUTE_READ));
98+
DBGLOG("sdell", "CPU Proximity sensor is handled by SMCProcessor plugin");
10099
break;
101100
case TempInfo::GPU:
102101
VirtualSMCAPI::addKey(KeyTG0P(0), vsmcPlugin.data, VirtualSMCAPI::valueWithSp(0, SmcKeyTypeSp78, new TG0P(i),

Sensors/SMCDellSensors/SMCDellSensors.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class EXPORT SMCDellSensors : public IOService {
4545
// the following constant defines smc key 'FS! '
4646
static constexpr SMC_KEY KeyFS__ = SMC_MAKE_IDENTIFIER('F','S','!',' ');
4747

48-
static constexpr SMC_KEY KeyTC0P(size_t i) { return SMC_MAKE_IDENTIFIER('T','C',KeyIndexes[i],'P'); }
4948
static constexpr SMC_KEY KeyTG0P(size_t i) { return SMC_MAKE_IDENTIFIER('T','G',KeyIndexes[i],'P'); }
5049
static constexpr SMC_KEY KeyTm0P(size_t i) { return SMC_MAKE_IDENTIFIER('T','m',KeyIndexes[i],'P'); }
5150
static constexpr SMC_KEY KeyTN0P(size_t i) { return SMC_MAKE_IDENTIFIER('T','N',KeyIndexes[i],'P'); }

Sensors/SMCDellSensors/kern_hooks.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ void KERNELHOOKS::deinit()
4747

4848
void KERNELHOOKS::activateTimer(UInt32 delay)
4949
{
50+
callbackKERNELHOOKS->eventTimer->cancelTimeout();
5051
callbackKERNELHOOKS->eventTimer->setTimeoutMS(delay);
5152
}
5253

@@ -184,7 +185,7 @@ void KERNELHOOKS::processKext(KernelPatcher &patcher, size_t index, mach_vm_addr
184185
if (workLoop) {
185186
eventTimer = IOTimerEventSource::timerEventSource(workLoop,
186187
[](OSObject *owner, IOTimerEventSource *) {
187-
if (atomic_load_explicit(&KERNELHOOKS::active_output, memory_order_acquire))
188+
while (atomic_load_explicit(&KERNELHOOKS::active_output, memory_order_acquire))
188189
atomic_fetch_sub_explicit(&active_output, 1, memory_order_release);
189190
});
190191

0 commit comments

Comments
 (0)