Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bad argument when invoking callback #8

Merged
merged 1 commit into from
May 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions VoodooGPIO/VoodooGPIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ void VoodooGPIO::intel_gpio_community_irq_handler(struct intel_community *commun
if (owner) {
IOInterruptAction handler = community->pinInterruptAction[pin];
void *refcon = community->pinInterruptRefcons[pin];
handler(owner, refcon, this, pin);
handler(owner, refcon, this, pin - padgrp->base + padgrp->gpio_base);
if (*firstdelay) {
*firstdelay = false;
IODelay(25 * nInactiveCommunities); // Reduce CPU load. 25~30us per inactive community was reasonable.
Expand Down Expand Up @@ -859,7 +859,7 @@ void VoodooGPIO::intel_gpio_pin_irq_handler(unsigned hw_pin) {
if (owner) {
IOInterruptAction handler = community->pinInterruptAction[community_i];
void *refcon = community->pinInterruptRefcons[community_i];
handler(owner, refcon, this, community_i);
handler(owner, refcon, this, pad_group_i + pad_group->gpio_base);
}

if (community->interruptTypes[community_i] & IRQ_TYPE_LEVEL_MASK) {
Expand Down Expand Up @@ -999,7 +999,7 @@ IOReturn VoodooGPIO::setInterruptTypeForPin(int pin, int type) {
return kIOReturnSuccess;
}

void VoodooGPIO::InterruptOccurred(OSObject *owner, IOInterruptEventSource *src, int intCount) {
void VoodooGPIO::InterruptOccurred(void *refCon, IOService *nub, int source) {
for (int i = 0; i < registered_pin_list->getCount(); i++) {
if (OSNumber* registered_pin = OSDynamicCast(OSNumber, registered_pin_list->getObject(i))) {
intel_gpio_pin_irq_handler(registered_pin->unsigned32BitValue());
Expand Down
2 changes: 1 addition & 1 deletion VoodooGPIO/VoodooGPIO.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ class VoodooGPIO : public IOService {
void intel_gpio_community_irq_handler(struct intel_community *community, bool *firstdelay);
void intel_gpio_pin_irq_handler(unsigned hw_pin);

void InterruptOccurred(OSObject *owner, IOInterruptEventSource *src, int intCount);
void InterruptOccurred(void *refCon, IOService *nub, int source);
IOReturn interruptOccurredGated();

public:
Expand Down