Annotation of XNU/iokit/Drivers/platform/drvApplePlatformExpert/AppleCPU.cpp, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1999 Apple Computer, Inc.  All rights reserved.
        !             3:  *
        !             4:  *  DRI: Josh de Cesare
        !             5:  *
        !             6:  */
        !             7: 
        !             8: #include "AppleCPU.h"
        !             9: 
        !            10: /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
        !            11: 
        !            12: #undef super
        !            13: #define super IOCPU
        !            14: 
        !            15: OSDefineMetaClassAndStructors(AppleCPU, IOCPU);
        !            16: 
        !            17: /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
        !            18: 
        !            19: bool AppleCPU::start(IOService *provider)
        !            20: {
        !            21:   kern_return_t result;
        !            22:   
        !            23:   if (!super::start(provider)) return false;
        !            24:   
        !            25:   cpuIC = new IOCPUInterruptController;
        !            26:   if (cpuIC == 0) return false;
        !            27:   
        !            28:   if (cpuIC->initCPUInterruptController(1) != kIOReturnSuccess) return false;
        !            29:   cpuIC->attach(this);
        !            30:   
        !            31:   cpuIC->registerCPUInterruptController();
        !            32:   
        !            33:   // Register this CPU with mach.
        !            34:   result = ml_processor_register((cpu_id_t)this, 0,
        !            35:                                 &machProcessor, &ipi_handler, true);
        !            36:   if (result == KERN_FAILURE) return false;
        !            37:   
        !            38:   cpuState = kIOCPUStateUninitalized;
        !            39:   
        !            40:   processor_start(machProcessor);
        !            41:   
        !            42:   return true;
        !            43: }
        !            44: 
        !            45: void AppleCPU::initCPU(void)
        !            46: {
        !            47:   cpuIC->enableCPUInterrupt(this);
        !            48:   
        !            49:   cpuState = kIOCPUStateRunning;
        !            50: }
        !            51: 
        !            52: OSSymbol *AppleCPU::getCPUName(void)
        !            53: {
        !            54:   return OSSymbol::withCStringNoCopy("Primary0");
        !            55: }
        !            56: 
        !            57: /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.