2 * Copyright (c) 1999-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
29 * Copyright (c) 1999-2000 Apple Computer, Inc. All rights reserved.
36 #include <machine/machine_routines.h>
37 #include <pexpert/pexpert.h>
40 #include <machine/machine_routines.h>
42 #include <IOKit/IOLib.h>
43 #include <IOKit/IOPlatformExpert.h>
44 #include <IOKit/pwr_mgt/RootDomain.h>
45 #include <IOKit/pwr_mgt/IOPMPrivate.h>
46 #include <IOKit/IOUserClient.h>
47 #include <IOKit/IOKitKeysPrivate.h>
48 #include <IOKit/IOCPU.h>
50 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
51 #include <kern/queue.h>
53 typedef kern_return_t (*iocpu_platform_action_t
)(void * refcon0
, void * refcon1
, uint32_t priority
,
54 void * param1
, void * param2
, void * param3
,
57 struct iocpu_platform_action_entry
60 iocpu_platform_action_t action
;
65 struct iocpu_platform_action_entry
* alloc_list
;
67 typedef struct iocpu_platform_action_entry iocpu_platform_action_entry_t
;
70 iocpu_get_platform_quiesce_queue(void);
73 iocpu_get_platform_active_queue(void);
76 iocpu_platform_cpu_action_init(queue_head_t
* quiesce_queue
, queue_head_t
* init_queue
);
79 iocpu_add_platform_action(queue_head_t
* queue
, iocpu_platform_action_entry_t
* entry
);
82 iocpu_remove_platform_action(iocpu_platform_action_entry_t
* entry
);
85 iocpu_run_platform_actions(queue_head_t
* queue
, uint32_t first_priority
, uint32_t last_priority
,
86 void * param1
, void * param2
, void * param3
);
88 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
90 #define kBootCPUNumber 0
92 static iocpu_platform_action_entry_t
* gIOAllActionsQueue
;
93 static queue_head_t gIOSleepActionQueue
;
94 static queue_head_t gIOWakeActionQueue
;
96 static queue_head_t iocpu_quiesce_queue
;
97 static queue_head_t iocpu_active_queue
;
99 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
102 iocpu_platform_cpu_action_init(queue_head_t
* quiesce_queue
, __unused queue_head_t
* init_queue
)
105 enum { kNumQuiesceActions
= 2 };
106 static iocpu_platform_action_entry_t quiesce_actions
[kNumQuiesceActions
] =
108 { { NULL
, NULL
}, (iocpu_platform_action_t
) &clean_mmu_dcache
, 97000, 0, 0, NULL
},
109 { { NULL
, NULL
}, (iocpu_platform_action_t
) &arm_sleep
, 99000, 0, 0, NULL
},
113 for (idx
= 0; idx
< kNumQuiesceActions
; idx
++)
114 iocpu_add_platform_action(quiesce_queue
, &quiesce_actions
[idx
]);
118 queue_head_t
* iocpu_get_platform_quiesce_queue(void)
120 if (!iocpu_quiesce_queue
.next
)
122 queue_init(&iocpu_quiesce_queue
);
123 queue_init(&iocpu_active_queue
);
124 iocpu_platform_cpu_action_init(&iocpu_quiesce_queue
, &iocpu_active_queue
);
126 return (&iocpu_quiesce_queue
);
129 queue_head_t
* iocpu_get_platform_active_queue(void)
131 if (!iocpu_active_queue
.next
)
133 queue_init(&iocpu_quiesce_queue
);
134 queue_init(&iocpu_active_queue
);
135 iocpu_platform_cpu_action_init(&iocpu_quiesce_queue
, &iocpu_active_queue
);
137 return (&iocpu_active_queue
);
140 void iocpu_add_platform_action(queue_head_t
* queue
, iocpu_platform_action_entry_t
* entry
)
142 iocpu_platform_action_entry_t
* next
;
144 queue_iterate(queue
, next
, iocpu_platform_action_entry_t
*, link
)
146 if (next
->priority
> entry
->priority
)
148 queue_insert_before(queue
, entry
, next
, iocpu_platform_action_entry_t
*, link
);
152 queue_enter(queue
, entry
, iocpu_platform_action_entry_t
*, link
); // at tail
155 void iocpu_remove_platform_action(iocpu_platform_action_entry_t
* entry
)
157 remque(&entry
->link
);
161 iocpu_run_platform_actions(queue_head_t
* queue
, uint32_t first_priority
, uint32_t last_priority
,
162 void * param1
, void * param2
, void * param3
)
164 kern_return_t ret
= KERN_SUCCESS
;
165 kern_return_t result
= KERN_SUCCESS
;
166 iocpu_platform_action_entry_t
* next
;
168 queue_iterate(queue
, next
, iocpu_platform_action_entry_t
*, link
)
170 uint32_t pri
= (next
->priority
< 0) ? -next
->priority
: next
->priority
;
171 if ((pri
>= first_priority
) && (pri
<= last_priority
))
173 //kprintf("[%p]", next->action);
174 ret
= (*next
->action
)(next
->refcon0
, next
->refcon1
, pri
, param1
, param2
, param3
, next
->name
);
176 if (KERN_SUCCESS
== result
)
182 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
184 extern "C" kern_return_t
185 IOCPURunPlatformQuiesceActions(void)
187 return (iocpu_run_platform_actions(iocpu_get_platform_quiesce_queue(), 0, 0U-1,
191 extern "C" kern_return_t
192 IOCPURunPlatformActiveActions(void)
194 return (iocpu_run_platform_actions(iocpu_get_platform_active_queue(), 0, 0U-1,
199 IOServicePlatformAction(void * refcon0
, void * refcon1
, uint32_t priority
,
200 void * param1
, void * param2
, void * param3
,
201 const char * service_name
)
204 IOService
* service
= (IOService
*) refcon0
;
205 const OSSymbol
* function
= (const OSSymbol
*) refcon1
;
207 kprintf("%s -> %s\n", function
->getCStringNoCopy(), service_name
);
209 ret
= service
->callPlatformFunction(function
, false,
210 (void *) priority
, param1
, param2
, param3
);
216 IOInstallServicePlatformAction(IOService
* service
,
217 const OSSymbol
* key
, queue_head_t
* queue
,
221 iocpu_platform_action_entry_t
* entry
;
224 num
= OSDynamicCast(OSNumber
, service
->getProperty(key
));
228 entry
= IONew(iocpu_platform_action_entry_t
, 1);
229 entry
->action
= &IOServicePlatformAction
;
230 entry
->name
= service
->getName();
231 priority
= num
->unsigned32BitValue();
233 entry
->priority
= -priority
;
235 entry
->priority
= priority
;
236 entry
->refcon0
= service
;
237 entry
->refcon1
= (void *) key
;
239 iocpu_add_platform_action(queue
, entry
);
240 entry
->alloc_list
= gIOAllActionsQueue
;
241 gIOAllActionsQueue
= entry
;
244 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
246 kern_return_t
PE_cpu_start(cpu_id_t target
,
247 vm_offset_t start_paddr
, vm_offset_t arg_paddr
)
249 IOCPU
*targetCPU
= OSDynamicCast(IOCPU
, (OSObject
*)target
);
251 if (targetCPU
== 0) return KERN_FAILURE
;
252 return targetCPU
->startCPU(start_paddr
, arg_paddr
);
255 void PE_cpu_halt(cpu_id_t target
)
257 IOCPU
*targetCPU
= OSDynamicCast(IOCPU
, (OSObject
*)target
);
259 if (targetCPU
) targetCPU
->haltCPU();
262 void PE_cpu_signal(cpu_id_t source
, cpu_id_t target
)
264 IOCPU
*sourceCPU
= OSDynamicCast(IOCPU
, (OSObject
*)source
);
265 IOCPU
*targetCPU
= OSDynamicCast(IOCPU
, (OSObject
*)target
);
267 if (sourceCPU
&& targetCPU
) sourceCPU
->signalCPU(targetCPU
);
270 void PE_cpu_machine_init(cpu_id_t target
, boolean_t bootb
)
272 IOCPU
*targetCPU
= OSDynamicCast(IOCPU
, (OSObject
*)target
);
274 if (targetCPU
) targetCPU
->initCPU(bootb
);
277 void PE_cpu_machine_quiesce(cpu_id_t target
)
279 IOCPU
*targetCPU
= OSDynamicCast(IOCPU
, (OSObject
*)target
);
281 if (targetCPU
) targetCPU
->quiesceCPU();
285 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
287 #define super IOService
289 OSDefineMetaClassAndAbstractStructors(IOCPU
, IOService
);
290 OSMetaClassDefineReservedUnused(IOCPU
, 0);
291 OSMetaClassDefineReservedUnused(IOCPU
, 1);
292 OSMetaClassDefineReservedUnused(IOCPU
, 2);
293 OSMetaClassDefineReservedUnused(IOCPU
, 3);
294 OSMetaClassDefineReservedUnused(IOCPU
, 4);
295 OSMetaClassDefineReservedUnused(IOCPU
, 5);
296 OSMetaClassDefineReservedUnused(IOCPU
, 6);
297 OSMetaClassDefineReservedUnused(IOCPU
, 7);
299 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
301 static OSArray
*gIOCPUs
;
302 static const OSSymbol
*gIOCPUStateKey
;
303 static OSString
*gIOCPUStateNames
[kIOCPUStateCount
];
305 void IOCPUSleepKernel(void)
309 IOCPU
*bootCPU
= NULL
;
310 IOPMrootDomain
*rootDomain
= IOService::getPMRootDomain();
312 kprintf("IOCPUSleepKernel\n");
314 IORegistryIterator
* iter
;
318 rootDomain
->tracePoint( kIOPMTracePointSleepPlatformActions
);
320 queue_init(&gIOSleepActionQueue
);
321 queue_init(&gIOWakeActionQueue
);
323 iter
= IORegistryIterator::iterateOver( gIOServicePlane
,
324 kIORegistryIterateRecursively
);
332 all
= iter
->iterateAll();
334 while (!iter
->isValid());
339 while((service
= (IOService
*) all
->getFirstObject()))
341 IOInstallServicePlatformAction(service
, gIOPlatformSleepActionKey
, &gIOSleepActionQueue
, false);
342 IOInstallServicePlatformAction(service
, gIOPlatformWakeActionKey
, &gIOWakeActionQueue
, true);
343 IOInstallServicePlatformAction(service
, gIOPlatformQuiesceActionKey
, iocpu_get_platform_quiesce_queue(), false);
344 IOInstallServicePlatformAction(service
, gIOPlatformActiveActionKey
, iocpu_get_platform_active_queue(), true);
345 all
->removeObject(service
);
351 iocpu_run_platform_actions(&gIOSleepActionQueue
, 0, 0U-1,
354 rootDomain
->tracePoint( kIOPMTracePointSleepCPUs
);
356 numCPUs
= gIOCPUs
->getCount();
361 target
= OSDynamicCast(IOCPU
, gIOCPUs
->getObject(cnt
));
363 // We make certain that the bootCPU is the last to sleep
364 // We'll skip it for now, and halt it after finishing the
366 if (target
->getCPUNumber() == kBootCPUNumber
)
369 } else if (target
->getCPUState() == kIOCPUStateRunning
)
375 rootDomain
->tracePoint( kIOPMTracePointSleepPlatformDriver
);
377 // Now sleep the boot CPU.
381 rootDomain
->tracePoint( kIOPMTracePointWakePlatformActions
);
383 iocpu_run_platform_actions(&gIOWakeActionQueue
, 0, 0U-1,
386 iocpu_platform_action_entry_t
* entry
;
387 while ((entry
= gIOAllActionsQueue
))
389 gIOAllActionsQueue
= entry
->alloc_list
;
390 iocpu_remove_platform_action(entry
);
391 IODelete(entry
, iocpu_platform_action_entry_t
, 1);
394 if (!queue_empty(&gIOSleepActionQueue
))
395 panic("gIOSleepActionQueue");
396 if (!queue_empty(&gIOWakeActionQueue
))
397 panic("gIOWakeActionQueue");
399 rootDomain
->tracePoint( kIOPMTracePointWakeCPUs
);
401 // Wake the other CPUs.
402 for (cnt
= 0; cnt
< numCPUs
; cnt
++)
404 target
= OSDynamicCast(IOCPU
, gIOCPUs
->getObject(cnt
));
406 // Skip the already-woken boot CPU.
407 if ((target
->getCPUNumber() != kBootCPUNumber
)
408 && (target
->getCPUState() == kIOCPUStateStopped
))
410 processor_start(target
->getMachProcessor());
415 void IOCPU::initCPUs(void)
418 gIOCPUs
= OSArray::withCapacity(1);
420 gIOCPUStateKey
= OSSymbol::withCStringNoCopy("IOCPUState");
422 gIOCPUStateNames
[kIOCPUStateUnregistered
] =
423 OSString::withCStringNoCopy("Unregistered");
424 gIOCPUStateNames
[kIOCPUStateUninitalized
] =
425 OSString::withCStringNoCopy("Uninitalized");
426 gIOCPUStateNames
[kIOCPUStateStopped
] =
427 OSString::withCStringNoCopy("Stopped");
428 gIOCPUStateNames
[kIOCPUStateRunning
] =
429 OSString::withCStringNoCopy("Running");
433 bool IOCPU::start(IOService
*provider
)
435 OSData
*busFrequency
, *cpuFrequency
, *timebaseFrequency
;
437 if (!super::start(provider
)) return false;
444 gIOCPUs
->setObject(this);
446 // Correct the bus, cpu and timebase frequencies in the device tree.
447 if (gPEClockFrequencyInfo
.bus_frequency_hz
< 0x100000000ULL
) {
448 busFrequency
= OSData::withBytesNoCopy((void *)&gPEClockFrequencyInfo
.bus_clock_rate_hz
, 4);
450 busFrequency
= OSData::withBytesNoCopy((void *)&gPEClockFrequencyInfo
.bus_frequency_hz
, 8);
452 provider
->setProperty("bus-frequency", busFrequency
);
453 busFrequency
->release();
455 if (gPEClockFrequencyInfo
.cpu_frequency_hz
< 0x100000000ULL
) {
456 cpuFrequency
= OSData::withBytesNoCopy((void *)&gPEClockFrequencyInfo
.cpu_clock_rate_hz
, 4);
458 cpuFrequency
= OSData::withBytesNoCopy((void *)&gPEClockFrequencyInfo
.cpu_frequency_hz
, 8);
460 provider
->setProperty("clock-frequency", cpuFrequency
);
461 cpuFrequency
->release();
463 timebaseFrequency
= OSData::withBytesNoCopy((void *)&gPEClockFrequencyInfo
.timebase_frequency_hz
, 4);
464 provider
->setProperty("timebase-frequency", timebaseFrequency
);
465 timebaseFrequency
->release();
467 super::setProperty("IOCPUID", (uintptr_t)this, sizeof(uintptr_t)*8);
470 setCPUState(kIOCPUStateUnregistered
);
475 OSObject
*IOCPU::getProperty(const OSSymbol
*aKey
) const
477 if (aKey
== gIOCPUStateKey
) return gIOCPUStateNames
[_cpuState
];
479 return super::getProperty(aKey
);
482 bool IOCPU::setProperty(const OSSymbol
*aKey
, OSObject
*anObject
)
486 if (aKey
== gIOCPUStateKey
) {
487 stateStr
= OSDynamicCast(OSString
, anObject
);
488 if (stateStr
== 0) return false;
490 if (_cpuNumber
== 0) return false;
492 if (stateStr
->isEqualTo("running")) {
493 if (_cpuState
== kIOCPUStateStopped
) {
494 processor_start(machProcessor
);
495 } else if (_cpuState
!= kIOCPUStateRunning
) {
498 } else if (stateStr
->isEqualTo("stopped")) {
499 if (_cpuState
== kIOCPUStateRunning
) {
501 } else if (_cpuState
!= kIOCPUStateStopped
) {
509 return super::setProperty(aKey
, anObject
);
512 bool IOCPU::serializeProperties(OSSerialize
*serialize
) const
515 OSDictionary
*dict
= dictionaryWithProperties();
516 dict
->setObject(gIOCPUStateKey
, gIOCPUStateNames
[_cpuState
]);
517 result
= dict
->serialize(serialize
);
522 IOReturn
IOCPU::setProperties(OSObject
*properties
)
524 OSDictionary
*dict
= OSDynamicCast(OSDictionary
, properties
);
528 if (dict
== 0) return kIOReturnUnsupported
;
530 stateStr
= OSDynamicCast(OSString
, dict
->getObject(gIOCPUStateKey
));
532 result
= IOUserClient::clientHasPrivilege(current_task(), kIOClientPrivilegeAdministrator
);
533 if (result
!= kIOReturnSuccess
) return result
;
535 if (setProperty(gIOCPUStateKey
, stateStr
)) return kIOReturnSuccess
;
537 return kIOReturnUnsupported
;
540 return kIOReturnUnsupported
;
543 void IOCPU::signalCPU(IOCPU */
*target*/
)
547 void IOCPU::enableCPUTimeBase(bool /*enable*/)
551 UInt32
IOCPU::getCPUNumber(void)
556 void IOCPU::setCPUNumber(UInt32 cpuNumber
)
558 _cpuNumber
= cpuNumber
;
559 super::setProperty("IOCPUNumber", _cpuNumber
, 32);
562 UInt32
IOCPU::getCPUState(void)
567 void IOCPU::setCPUState(UInt32 cpuState
)
569 if (cpuState
< kIOCPUStateCount
) {
570 _cpuState
= cpuState
;
574 OSArray
*IOCPU::getCPUGroup(void)
579 UInt32
IOCPU::getCPUGroupSize(void)
581 return _cpuGroup
->getCount();
584 processor_t
IOCPU::getMachProcessor(void)
586 return machProcessor
;
590 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
593 #define super IOInterruptController
595 OSDefineMetaClassAndStructors(IOCPUInterruptController
, IOInterruptController
);
597 OSMetaClassDefineReservedUnused(IOCPUInterruptController
, 0);
598 OSMetaClassDefineReservedUnused(IOCPUInterruptController
, 1);
599 OSMetaClassDefineReservedUnused(IOCPUInterruptController
, 2);
600 OSMetaClassDefineReservedUnused(IOCPUInterruptController
, 3);
601 OSMetaClassDefineReservedUnused(IOCPUInterruptController
, 4);
602 OSMetaClassDefineReservedUnused(IOCPUInterruptController
, 5);
606 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
609 IOReturn
IOCPUInterruptController::initCPUInterruptController(int sources
)
613 if (!super::init()) return kIOReturnInvalid
;
617 cpus
= (IOCPU
**)IOMalloc(numCPUs
* sizeof(IOCPU
*));
618 if (cpus
== 0) return kIOReturnNoMemory
;
619 bzero(cpus
, numCPUs
* sizeof(IOCPU
*));
621 vectors
= (IOInterruptVector
*)IOMalloc(numCPUs
* sizeof(IOInterruptVector
));
622 if (vectors
== 0) return kIOReturnNoMemory
;
623 bzero(vectors
, numCPUs
* sizeof(IOInterruptVector
));
625 // Allocate locks for the
626 for (cnt
= 0; cnt
< numCPUs
; cnt
++) {
627 vectors
[cnt
].interruptLock
= IOLockAlloc();
628 if (vectors
[cnt
].interruptLock
== NULL
) {
629 for (cnt
= 0; cnt
< numCPUs
; cnt
++) {
630 if (vectors
[cnt
].interruptLock
!= NULL
)
631 IOLockFree(vectors
[cnt
].interruptLock
);
633 return kIOReturnNoResources
;
637 ml_init_max_cpus(numCPUs
);
639 return kIOReturnSuccess
;
642 void IOCPUInterruptController::registerCPUInterruptController(void)
646 getPlatform()->registerInterruptController(gPlatformInterruptControllerName
,
650 void IOCPUInterruptController::setCPUInterruptProperties(IOService
*service
)
658 if ((service
->getProperty(gIOInterruptControllersKey
) != 0) &&
659 (service
->getProperty(gIOInterruptSpecifiersKey
) != 0))
662 // Create the interrupt specifer array.
663 specifier
= OSArray::withCapacity(numCPUs
);
664 for (cnt
= 0; cnt
< numCPUs
; cnt
++) {
666 tmpData
= OSData::withBytes(&tmpLong
, sizeof(tmpLong
));
667 specifier
->setObject(tmpData
);
671 // Create the interrupt controller array.
672 controller
= OSArray::withCapacity(numCPUs
);
673 for (cnt
= 0; cnt
< numCPUs
; cnt
++) {
674 controller
->setObject(gPlatformInterruptControllerName
);
677 // Put the two arrays into the property table.
678 service
->setProperty(gIOInterruptControllersKey
, controller
);
679 service
->setProperty(gIOInterruptSpecifiersKey
, specifier
);
680 controller
->release();
681 specifier
->release();
684 void IOCPUInterruptController::enableCPUInterrupt(IOCPU
*cpu
)
686 IOInterruptHandler handler
= OSMemberFunctionCast(
687 IOInterruptHandler
, this, &IOCPUInterruptController::handleInterrupt
);
689 ml_install_interrupt_handler(cpu
, cpu
->getCPUNumber(), this, handler
, 0);
693 if (enabledCPUs
== numCPUs
) thread_wakeup(this);
696 IOReturn
IOCPUInterruptController::registerInterrupt(IOService
*nub
,
699 IOInterruptHandler handler
,
702 IOInterruptVector
*vector
;
704 if (source
>= numCPUs
) return kIOReturnNoResources
;
706 vector
= &vectors
[source
];
708 // Get the lock for this vector.
709 IOTakeLock(vector
->interruptLock
);
711 // Make sure the vector is not in use.
712 if (vector
->interruptRegistered
) {
713 IOUnlock(vector
->interruptLock
);
714 return kIOReturnNoResources
;
717 // Fill in vector with the client's info.
718 vector
->handler
= handler
;
720 vector
->source
= source
;
721 vector
->target
= target
;
722 vector
->refCon
= refCon
;
724 // Get the vector ready. It starts hard disabled.
725 vector
->interruptDisabledHard
= 1;
726 vector
->interruptDisabledSoft
= 1;
727 vector
->interruptRegistered
= 1;
729 IOUnlock(vector
->interruptLock
);
731 if (enabledCPUs
!= numCPUs
) {
732 assert_wait(this, THREAD_UNINT
);
733 thread_block(THREAD_CONTINUE_NULL
);
736 return kIOReturnSuccess
;
739 IOReturn
IOCPUInterruptController::getInterruptType(IOService */
*nub*/
,
743 if (interruptType
== 0) return kIOReturnBadArgument
;
745 *interruptType
= kIOInterruptTypeLevel
;
747 return kIOReturnSuccess
;
750 IOReturn
IOCPUInterruptController::enableInterrupt(IOService */
*nub*/
,
753 // ml_set_interrupts_enabled(true);
754 return kIOReturnSuccess
;
757 IOReturn
IOCPUInterruptController::disableInterrupt(IOService */
*nub*/
,
760 // ml_set_interrupts_enabled(false);
761 return kIOReturnSuccess
;
764 IOReturn
IOCPUInterruptController::causeInterrupt(IOService */
*nub*/
,
767 ml_cause_interrupt();
768 return kIOReturnSuccess
;
771 IOReturn
IOCPUInterruptController::handleInterrupt(void */
*refCon*/
,
775 IOInterruptVector
*vector
;
777 vector
= &vectors
[source
];
779 if (!vector
->interruptRegistered
) return kIOReturnInvalid
;
781 vector
->handler(vector
->target
, vector
->refCon
,
782 vector
->nub
, vector
->source
);
784 return kIOReturnSuccess
;
787 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */