*
* @APPLE_LICENSE_HEADER_START@
*
- * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
+ * The contents of this file constitute Original Code as defined in and
+ * are subject to the Apple Public Source License Version 1.1 (the
+ * "License"). You may not use this file except in compliance with the
+ * License. Please obtain a copy of the License at
+ * http://www.apple.com/publicsource and read it before using this file.
*
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * This Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#include <kern/cpu_data.h>
#include <ppc/mappings.h>
#include <ppc/Diagnostics.h>
+#include <ppc/trap.h>
/* TODO: BOGUS TO BE REMOVED */
int real_ncpus = 1;
proc_info->debstack_top_ss = proc_info->debstackptr;
#endif /* MACH_KDP || MACH_KDB */
proc_info->interrupts_enabled = 0;
- proc_info->active_kloaded = (unsigned int)&active_kloaded[cpu];
- proc_info->active_stacks = (unsigned int)&active_stacks[cpu];
proc_info->need_ast = (unsigned int)&need_ast[cpu];
proc_info->FPU_owner = 0;
proc_info->VMX_owner = 0;
}
}
+perfTrap perfCpuSigHook = 0; /* Pointer to CHUD cpu signal hook routine */
+
/*
* Here is where we implement the receiver of the signaling protocol.
* We wait for the signal status area to be passed to us. Then we snarf
timebaseAddr->done = TRUE;
return;
+
+ case CPRQsegload:
+ return;
+
+ case CPRQchud:
+ parmAddr = (unsigned int *)holdParm2; /* Get the destination address */
+ if(perfCpuSigHook) {
+ struct savearea *ssp = current_act()->mact.pcb;
+ if(ssp) {
+ (perfCpuSigHook)(parmAddr[1] /* request */, ssp, 0, 0);
+ }
+ }
+ parmAddr[1] = 0;
+ parmAddr[0] = 0; /* Show we're done */
+ return;
case CPRQscom:
fwSCOM((scomcomm *)holdParm2); /* Do the function */
void)
{
enable_preemption();
- processor_doshutdown(current_processor());
+ processor_offline(current_processor());
}
void
void)
{
struct per_proc_info *proc_info;
- unsigned int cpu;
+ unsigned int cpu, i;
+ unsigned int wait_ncpus_sleep, ncpus_sleep;
facility_context *fowner;
extern vm_offset_t intstack;
extern vm_offset_t debstack;
__asm__ volatile("sync");
__asm__ volatile("isync");
}
+
+ wait_ncpus_sleep = real_ncpus-1;
+ ncpus_sleep = 0;
+ while (wait_ncpus_sleep != ncpus_sleep) {
+ ncpus_sleep = 0;
+ for(i=1; i < real_ncpus ; i++) {
+ if ((*(volatile short *)&per_proc_info[i].cpu_flags) & SleepState)
+ ncpus_sleep++;
+ }
+ }
}
PE_cpu_machine_quiesce(proc_info->cpu_id);