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/IOUserClient.h>
46 #include <IOKit/IOKitKeysPrivate.h>
47 #include <IOKit/IOCPU.h>
49 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
50 #include <kern/queue.h>
52 typedef kern_return_t (*iocpu_platform_action_t
)(void * refcon0
, void * refcon1
, uint32_t priority
,
53 void * param1
, void * param2
, void * param3
);
55 struct iocpu_platform_action_entry
58 iocpu_platform_action_t action
;
62 struct iocpu_platform_action_entry
* alloc_list
;
64 typedef struct iocpu_platform_action_entry iocpu_platform_action_entry_t
;
67 iocpu_get_platform_quiesce_queue(void);
70 iocpu_get_platform_active_queue(void);
73 iocpu_platform_cpu_action_init(queue_head_t
* quiesce_queue
, queue_head_t
* init_queue
);
76 iocpu_add_platform_action(queue_head_t
* queue
, iocpu_platform_action_entry_t
* entry
);
79 iocpu_remove_platform_action(iocpu_platform_action_entry_t
* entry
);
82 iocpu_run_platform_actions(queue_head_t
* queue
, uint32_t first_priority
, uint32_t last_priority
,
83 void * param1
, void * param2
, void * param3
);
85 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
87 #define kBootCPUNumber 0
89 static iocpu_platform_action_entry_t
* gIOAllActionsQueue
;
90 static queue_head_t gIOSleepActionQueue
;
91 static queue_head_t gIOWakeActionQueue
;
93 static queue_head_t iocpu_quiesce_queue
;
94 static queue_head_t iocpu_active_queue
;
96 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
99 iocpu_platform_cpu_action_init(queue_head_t
* quiesce_queue
, __unused queue_head_t
* init_queue
)
102 enum { kNumQuiesceActions
= 2 };
103 static iocpu_platform_action_entry_t quiesce_actions
[kNumQuiesceActions
] =
105 { { NULL
, NULL
}, (iocpu_platform_action_t
) &clean_mmu_dcache
, 97000, 0, 0, NULL
},
106 { { NULL
, NULL
}, (iocpu_platform_action_t
) &arm_sleep
, 99000, 0, 0, NULL
},
110 for (idx
= 0; idx
< kNumQuiesceActions
; idx
++)
111 iocpu_add_platform_action(quiesce_queue
, &quiesce_actions
[idx
]);
115 queue_head_t
* iocpu_get_platform_quiesce_queue(void)
117 if (!iocpu_quiesce_queue
.next
)
119 queue_init(&iocpu_quiesce_queue
);
120 queue_init(&iocpu_active_queue
);
121 iocpu_platform_cpu_action_init(&iocpu_quiesce_queue
, &iocpu_active_queue
);
123 return (&iocpu_quiesce_queue
);
126 queue_head_t
* iocpu_get_platform_active_queue(void)
128 if (!iocpu_active_queue
.next
)
130 queue_init(&iocpu_quiesce_queue
);
131 queue_init(&iocpu_active_queue
);
132 iocpu_platform_cpu_action_init(&iocpu_quiesce_queue
, &iocpu_active_queue
);
134 return (&iocpu_active_queue
);
137 void iocpu_add_platform_action(queue_head_t
* queue
, iocpu_platform_action_entry_t
* entry
)
139 iocpu_platform_action_entry_t
* next
;
141 queue_iterate(queue
, next
, iocpu_platform_action_entry_t
*, link
)
143 if (next
->priority
> entry
->priority
)
145 queue_insert_before(queue
, entry
, next
, iocpu_platform_action_entry_t
*, link
);
149 queue_enter(queue
, entry
, iocpu_platform_action_entry_t
*, link
); // at tail
152 void iocpu_remove_platform_action(iocpu_platform_action_entry_t
* entry
)
154 remque(&entry
->link
);
158 iocpu_run_platform_actions(queue_head_t
* queue
, uint32_t first_priority
, uint32_t last_priority
,
159 void * param1
, void * param2
, void * param3
)
161 kern_return_t ret
= KERN_SUCCESS
;
162 kern_return_t result
= KERN_SUCCESS
;
163 iocpu_platform_action_entry_t
* next
;
165 queue_iterate(queue
, next
, iocpu_platform_action_entry_t
*, link
)
167 uint32_t pri
= (next
->priority
< 0) ? -next
->priority
: next
->priority
;
168 if ((pri
>= first_priority
) && (pri
<= last_priority
))
170 //kprintf("[%p]", next->action);
171 ret
= (*next
->action
)(next
->refcon0
, next
->refcon1
, pri
, param1
, param2
, param3
);
173 if (KERN_SUCCESS
== result
)
179 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
181 extern "C" kern_return_t
182 IOCPURunPlatformQuiesceActions(void)
184 return (iocpu_run_platform_actions(iocpu_get_platform_quiesce_queue(), 0, 0U-1,
188 extern "C" kern_return_t
189 IOCPURunPlatformActiveActions(void)
191 return (iocpu_run_platform_actions(iocpu_get_platform_active_queue(), 0, 0U-1,
196 IOServicePlatformAction(void * refcon0
, void * refcon1
, uint32_t priority
,
197 void * param1
, void * param2
, void * param3
)
200 IOService
* service
= (IOService
*) refcon0
;
201 const OSSymbol
* function
= (const OSSymbol
*) refcon1
;
203 kprintf("%s -> %s\n", function
->getCStringNoCopy(), service
->getName());
205 ret
= service
->callPlatformFunction(function
, false,
206 (void *) priority
, param1
, param2
, param3
);
212 IOInstallServicePlatformAction(IOService
* service
,
213 const OSSymbol
* key
, queue_head_t
* queue
,
217 iocpu_platform_action_entry_t
* entry
;
220 num
= OSDynamicCast(OSNumber
, service
->getProperty(key
));
224 entry
= IONew(iocpu_platform_action_entry_t
, 1);
225 entry
->action
= &IOServicePlatformAction
;
226 priority
= num
->unsigned32BitValue();
228 entry
->priority
= -priority
;
230 entry
->priority
= priority
;
231 entry
->refcon0
= service
;
232 entry
->refcon1
= (void *) key
;
234 iocpu_add_platform_action(queue
, entry
);
235 entry
->alloc_list
= gIOAllActionsQueue
;
236 gIOAllActionsQueue
= entry
;
239 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
241 kern_return_t
PE_cpu_start(cpu_id_t target
,
242 vm_offset_t start_paddr
, vm_offset_t arg_paddr
)
244 IOCPU
*targetCPU
= OSDynamicCast(IOCPU
, (OSObject
*)target
);
246 if (targetCPU
== 0) return KERN_FAILURE
;
247 return targetCPU
->startCPU(start_paddr
, arg_paddr
);
250 void PE_cpu_halt(cpu_id_t target
)
252 IOCPU
*targetCPU
= OSDynamicCast(IOCPU
, (OSObject
*)target
);
254 if (targetCPU
) targetCPU
->haltCPU();
257 void PE_cpu_signal(cpu_id_t source
, cpu_id_t target
)
259 IOCPU
*sourceCPU
= OSDynamicCast(IOCPU
, (OSObject
*)source
);
260 IOCPU
*targetCPU
= OSDynamicCast(IOCPU
, (OSObject
*)target
);
262 if (sourceCPU
&& targetCPU
) sourceCPU
->signalCPU(targetCPU
);
265 void PE_cpu_machine_init(cpu_id_t target
, boolean_t bootb
)
267 IOCPU
*targetCPU
= OSDynamicCast(IOCPU
, (OSObject
*)target
);
269 if (targetCPU
) targetCPU
->initCPU(bootb
);
272 void PE_cpu_machine_quiesce(cpu_id_t target
)
274 IOCPU
*targetCPU
= OSDynamicCast(IOCPU
, (OSObject
*)target
);
276 if (targetCPU
) targetCPU
->quiesceCPU();
280 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
282 #define super IOService
284 OSDefineMetaClassAndAbstractStructors(IOCPU
, IOService
);
285 OSMetaClassDefineReservedUnused(IOCPU
, 0);
286 OSMetaClassDefineReservedUnused(IOCPU
, 1);
287 OSMetaClassDefineReservedUnused(IOCPU
, 2);
288 OSMetaClassDefineReservedUnused(IOCPU
, 3);
289 OSMetaClassDefineReservedUnused(IOCPU
, 4);
290 OSMetaClassDefineReservedUnused(IOCPU
, 5);
291 OSMetaClassDefineReservedUnused(IOCPU
, 6);
292 OSMetaClassDefineReservedUnused(IOCPU
, 7);
294 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
296 static OSArray
*gIOCPUs
;
297 static const OSSymbol
*gIOCPUStateKey
;
298 static OSString
*gIOCPUStateNames
[kIOCPUStateCount
];
300 void IOCPUSleepKernel(void)
304 IOCPU
*bootCPU
= NULL
;
305 IOPMrootDomain
*rootDomain
= IOService::getPMRootDomain();
307 kprintf("IOCPUSleepKernel\n");
312 rootDomain
->tracePoint( kIOPMTracePointSleepPlatformActions
);
314 queue_init(&gIOSleepActionQueue
);
315 queue_init(&gIOWakeActionQueue
);
317 iter
= IORegistryIterator::iterateOver( gIOServicePlane
,
318 kIORegistryIterateRecursively
);
324 while((service
= (IOService
*) iter
->getNextObject()))
326 IOInstallServicePlatformAction(service
, gIOPlatformSleepActionKey
, &gIOSleepActionQueue
, false);
327 IOInstallServicePlatformAction(service
, gIOPlatformWakeActionKey
, &gIOWakeActionQueue
, true);
328 IOInstallServicePlatformAction(service
, gIOPlatformQuiesceActionKey
, iocpu_get_platform_quiesce_queue(), false);
329 IOInstallServicePlatformAction(service
, gIOPlatformActiveActionKey
, iocpu_get_platform_active_queue(), true);
332 while( !service
&& !iter
->isValid());
336 iocpu_run_platform_actions(&gIOSleepActionQueue
, 0, 0U-1,
339 rootDomain
->tracePoint( kIOPMTracePointSleepCPUs
);
341 numCPUs
= gIOCPUs
->getCount();
346 target
= OSDynamicCast(IOCPU
, gIOCPUs
->getObject(cnt
));
348 // We make certain that the bootCPU is the last to sleep
349 // We'll skip it for now, and halt it after finishing the
351 if (target
->getCPUNumber() == kBootCPUNumber
)
354 } else if (target
->getCPUState() == kIOCPUStateRunning
)
360 rootDomain
->tracePoint( kIOPMTracePointSleepPlatformDriver
);
362 // Now sleep the boot CPU.
366 rootDomain
->tracePoint( kIOPMTracePointWakePlatformActions
);
368 iocpu_run_platform_actions(&gIOWakeActionQueue
, 0, 0U-1,
371 iocpu_platform_action_entry_t
* entry
;
372 while ((entry
= gIOAllActionsQueue
))
374 gIOAllActionsQueue
= entry
->alloc_list
;
375 iocpu_remove_platform_action(entry
);
376 IODelete(entry
, iocpu_platform_action_entry_t
, 1);
379 if (!queue_empty(&gIOSleepActionQueue
))
380 panic("gIOSleepActionQueue");
381 if (!queue_empty(&gIOWakeActionQueue
))
382 panic("gIOWakeActionQueue");
384 rootDomain
->tracePoint( kIOPMTracePointWakeCPUs
);
386 // Wake the other CPUs.
387 for (cnt
= 0; cnt
< numCPUs
; cnt
++)
389 target
= OSDynamicCast(IOCPU
, gIOCPUs
->getObject(cnt
));
391 // Skip the already-woken boot CPU.
392 if ((target
->getCPUNumber() != kBootCPUNumber
)
393 && (target
->getCPUState() == kIOCPUStateStopped
))
395 processor_start(target
->getMachProcessor());
400 void IOCPU::initCPUs(void)
403 gIOCPUs
= OSArray::withCapacity(1);
405 gIOCPUStateKey
= OSSymbol::withCStringNoCopy("IOCPUState");
407 gIOCPUStateNames
[kIOCPUStateUnregistered
] =
408 OSString::withCStringNoCopy("Unregistered");
409 gIOCPUStateNames
[kIOCPUStateUninitalized
] =
410 OSString::withCStringNoCopy("Uninitalized");
411 gIOCPUStateNames
[kIOCPUStateStopped
] =
412 OSString::withCStringNoCopy("Stopped");
413 gIOCPUStateNames
[kIOCPUStateRunning
] =
414 OSString::withCStringNoCopy("Running");
418 bool IOCPU::start(IOService
*provider
)
420 OSData
*busFrequency
, *cpuFrequency
, *timebaseFrequency
;
422 if (!super::start(provider
)) return false;
429 gIOCPUs
->setObject(this);
431 // Correct the bus, cpu and timebase frequencies in the device tree.
432 if (gPEClockFrequencyInfo
.bus_frequency_hz
< 0x100000000ULL
) {
433 busFrequency
= OSData::withBytesNoCopy((void *)&gPEClockFrequencyInfo
.bus_clock_rate_hz
, 4);
435 busFrequency
= OSData::withBytesNoCopy((void *)&gPEClockFrequencyInfo
.bus_frequency_hz
, 8);
437 provider
->setProperty("bus-frequency", busFrequency
);
438 busFrequency
->release();
440 if (gPEClockFrequencyInfo
.cpu_frequency_hz
< 0x100000000ULL
) {
441 cpuFrequency
= OSData::withBytesNoCopy((void *)&gPEClockFrequencyInfo
.cpu_clock_rate_hz
, 4);
443 cpuFrequency
= OSData::withBytesNoCopy((void *)&gPEClockFrequencyInfo
.cpu_frequency_hz
, 8);
445 provider
->setProperty("clock-frequency", cpuFrequency
);
446 cpuFrequency
->release();
448 timebaseFrequency
= OSData::withBytesNoCopy((void *)&gPEClockFrequencyInfo
.timebase_frequency_hz
, 4);
449 provider
->setProperty("timebase-frequency", timebaseFrequency
);
450 timebaseFrequency
->release();
452 super::setProperty("IOCPUID", (uintptr_t)this, sizeof(uintptr_t)*8);
455 setCPUState(kIOCPUStateUnregistered
);
460 OSObject
*IOCPU::getProperty(const OSSymbol
*aKey
) const
462 if (aKey
== gIOCPUStateKey
) return gIOCPUStateNames
[_cpuState
];
464 return super::getProperty(aKey
);
467 bool IOCPU::setProperty(const OSSymbol
*aKey
, OSObject
*anObject
)
471 if (aKey
== gIOCPUStateKey
) {
472 stateStr
= OSDynamicCast(OSString
, anObject
);
473 if (stateStr
== 0) return false;
475 if (_cpuNumber
== 0) return false;
477 if (stateStr
->isEqualTo("running")) {
478 if (_cpuState
== kIOCPUStateStopped
) {
479 processor_start(machProcessor
);
480 } else if (_cpuState
!= kIOCPUStateRunning
) {
483 } else if (stateStr
->isEqualTo("stopped")) {
484 if (_cpuState
== kIOCPUStateRunning
) {
486 } else if (_cpuState
!= kIOCPUStateStopped
) {
494 return super::setProperty(aKey
, anObject
);
497 bool IOCPU::serializeProperties(OSSerialize
*serialize
) const
500 OSDictionary
*dict
= dictionaryWithProperties();
501 dict
->setObject(gIOCPUStateKey
, gIOCPUStateNames
[_cpuState
]);
502 result
= dict
->serialize(serialize
);
507 IOReturn
IOCPU::setProperties(OSObject
*properties
)
509 OSDictionary
*dict
= OSDynamicCast(OSDictionary
, properties
);
513 if (dict
== 0) return kIOReturnUnsupported
;
515 stateStr
= OSDynamicCast(OSString
, dict
->getObject(gIOCPUStateKey
));
517 result
= IOUserClient::clientHasPrivilege(current_task(), kIOClientPrivilegeAdministrator
);
518 if (result
!= kIOReturnSuccess
) return result
;
520 if (setProperty(gIOCPUStateKey
, stateStr
)) return kIOReturnSuccess
;
522 return kIOReturnUnsupported
;
525 return kIOReturnUnsupported
;
528 void IOCPU::signalCPU(IOCPU */
*target*/
)
532 void IOCPU::enableCPUTimeBase(bool /*enable*/)
536 UInt32
IOCPU::getCPUNumber(void)
541 void IOCPU::setCPUNumber(UInt32 cpuNumber
)
543 _cpuNumber
= cpuNumber
;
544 super::setProperty("IOCPUNumber", _cpuNumber
, 32);
547 UInt32
IOCPU::getCPUState(void)
552 void IOCPU::setCPUState(UInt32 cpuState
)
554 if (cpuState
< kIOCPUStateCount
) {
555 _cpuState
= cpuState
;
559 OSArray
*IOCPU::getCPUGroup(void)
564 UInt32
IOCPU::getCPUGroupSize(void)
566 return _cpuGroup
->getCount();
569 processor_t
IOCPU::getMachProcessor(void)
571 return machProcessor
;
575 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
578 #define super IOInterruptController
580 OSDefineMetaClassAndStructors(IOCPUInterruptController
, IOInterruptController
);
582 OSMetaClassDefineReservedUnused(IOCPUInterruptController
, 0);
583 OSMetaClassDefineReservedUnused(IOCPUInterruptController
, 1);
584 OSMetaClassDefineReservedUnused(IOCPUInterruptController
, 2);
585 OSMetaClassDefineReservedUnused(IOCPUInterruptController
, 3);
586 OSMetaClassDefineReservedUnused(IOCPUInterruptController
, 4);
587 OSMetaClassDefineReservedUnused(IOCPUInterruptController
, 5);
591 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
594 IOReturn
IOCPUInterruptController::initCPUInterruptController(int sources
)
598 if (!super::init()) return kIOReturnInvalid
;
602 cpus
= (IOCPU
**)IOMalloc(numCPUs
* sizeof(IOCPU
*));
603 if (cpus
== 0) return kIOReturnNoMemory
;
604 bzero(cpus
, numCPUs
* sizeof(IOCPU
*));
606 vectors
= (IOInterruptVector
*)IOMalloc(numCPUs
* sizeof(IOInterruptVector
));
607 if (vectors
== 0) return kIOReturnNoMemory
;
608 bzero(vectors
, numCPUs
* sizeof(IOInterruptVector
));
610 // Allocate locks for the
611 for (cnt
= 0; cnt
< numCPUs
; cnt
++) {
612 vectors
[cnt
].interruptLock
= IOLockAlloc();
613 if (vectors
[cnt
].interruptLock
== NULL
) {
614 for (cnt
= 0; cnt
< numCPUs
; cnt
++) {
615 if (vectors
[cnt
].interruptLock
!= NULL
)
616 IOLockFree(vectors
[cnt
].interruptLock
);
618 return kIOReturnNoResources
;
622 ml_init_max_cpus(numCPUs
);
624 return kIOReturnSuccess
;
627 void IOCPUInterruptController::registerCPUInterruptController(void)
631 getPlatform()->registerInterruptController(gPlatformInterruptControllerName
,
635 void IOCPUInterruptController::setCPUInterruptProperties(IOService
*service
)
643 if ((service
->getProperty(gIOInterruptControllersKey
) != 0) &&
644 (service
->getProperty(gIOInterruptSpecifiersKey
) != 0))
647 // Create the interrupt specifer array.
648 specifier
= OSArray::withCapacity(numCPUs
);
649 for (cnt
= 0; cnt
< numCPUs
; cnt
++) {
651 tmpData
= OSData::withBytes(&tmpLong
, sizeof(tmpLong
));
652 specifier
->setObject(tmpData
);
656 // Create the interrupt controller array.
657 controller
= OSArray::withCapacity(numCPUs
);
658 for (cnt
= 0; cnt
< numCPUs
; cnt
++) {
659 controller
->setObject(gPlatformInterruptControllerName
);
662 // Put the two arrays into the property table.
663 service
->setProperty(gIOInterruptControllersKey
, controller
);
664 service
->setProperty(gIOInterruptSpecifiersKey
, specifier
);
665 controller
->release();
666 specifier
->release();
669 void IOCPUInterruptController::enableCPUInterrupt(IOCPU
*cpu
)
671 IOInterruptHandler handler
= OSMemberFunctionCast(
672 IOInterruptHandler
, this, &IOCPUInterruptController::handleInterrupt
);
674 ml_install_interrupt_handler(cpu
, cpu
->getCPUNumber(), this, handler
, 0);
678 if (enabledCPUs
== numCPUs
) thread_wakeup(this);
681 IOReturn
IOCPUInterruptController::registerInterrupt(IOService
*nub
,
684 IOInterruptHandler handler
,
687 IOInterruptVector
*vector
;
689 if (source
>= numCPUs
) return kIOReturnNoResources
;
691 vector
= &vectors
[source
];
693 // Get the lock for this vector.
694 IOTakeLock(vector
->interruptLock
);
696 // Make sure the vector is not in use.
697 if (vector
->interruptRegistered
) {
698 IOUnlock(vector
->interruptLock
);
699 return kIOReturnNoResources
;
702 // Fill in vector with the client's info.
703 vector
->handler
= handler
;
705 vector
->source
= source
;
706 vector
->target
= target
;
707 vector
->refCon
= refCon
;
709 // Get the vector ready. It starts hard disabled.
710 vector
->interruptDisabledHard
= 1;
711 vector
->interruptDisabledSoft
= 1;
712 vector
->interruptRegistered
= 1;
714 IOUnlock(vector
->interruptLock
);
716 if (enabledCPUs
!= numCPUs
) {
717 assert_wait(this, THREAD_UNINT
);
718 thread_block(THREAD_CONTINUE_NULL
);
721 return kIOReturnSuccess
;
724 IOReturn
IOCPUInterruptController::getInterruptType(IOService */
*nub*/
,
728 if (interruptType
== 0) return kIOReturnBadArgument
;
730 *interruptType
= kIOInterruptTypeLevel
;
732 return kIOReturnSuccess
;
735 IOReturn
IOCPUInterruptController::enableInterrupt(IOService */
*nub*/
,
738 // ml_set_interrupts_enabled(true);
739 return kIOReturnSuccess
;
742 IOReturn
IOCPUInterruptController::disableInterrupt(IOService */
*nub*/
,
745 // ml_set_interrupts_enabled(false);
746 return kIOReturnSuccess
;
749 IOReturn
IOCPUInterruptController::causeInterrupt(IOService */
*nub*/
,
752 ml_cause_interrupt();
753 return kIOReturnSuccess
;
756 IOReturn
IOCPUInterruptController::handleInterrupt(void */
*refCon*/
,
760 IOInterruptVector
*vector
;
762 vector
= &vectors
[source
];
764 if (!vector
->interruptRegistered
) return kIOReturnInvalid
;
766 vector
->handler(vector
->target
, vector
->refCon
,
767 vector
->nub
, vector
->source
);
769 return kIOReturnSuccess
;
772 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */