PERFORCE change 38921 for review
John Baldwin
jhb at FreeBSD.org
Tue Sep 30 14:57:11 PDT 2003
On 30-Sep-2003 Peter Wemm wrote:
> http://perforce.freebsd.org/chv.cgi?CH=38921
>
> Change 38921 by peter at peter_hammer on 2003/09/30 14:39:43
>
> tidy some stuff up. There is no need for the startup glue code
> to be in asm when it can be in init_secondary().
>
> Affected files ...
>
> .. //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#10 edit
> .. //depot/projects/hammer/sys/amd64/amd64/mpboot.s#7 edit
>
> Differences ...
>
> ==== //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#10 (text+ko) ====
>
> @@ -316,16 +316,17 @@
> /* XXX: List I/O APICs? They are done differently now. */
> }
>
> -#ifdef SMP_ME_HARDER
> /*
> * AP cpu's call this to sync up protected mode.
> */
> void
> init_secondary(void)
> {
> +#ifdef SMP_ME_HARDER
> int gsel_tss;
> int x, myid = bootAP;
> u_int cr0;
> + u_int32 value;
>
> gdt_segs[GPRIV_SEL].ssd_base = (long) &SMP_prvspace[myid];
> gdt_segs[GPROC0_SEL].ssd_base =
> @@ -363,8 +364,17 @@
> cr0 = rcr0();
> cr0 &= ~(CR0_CD | CR0_NW | CR0_EM);
> load_cr0(cr0);
> +
> + /* Disable local apic just to be sure. */
> + value = lapic->svr;
> + value &= ~(APIC_SVR_SWEN);
> + lapic->svr = value;
> +
> + mp_naps++;
> +
> + ap_init(); /* kick things off, this does not return */
> +#endif
> }
> -#endif
I should do this for i386, too, huh.
--
John Baldwin <jhb at FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!" - http://www.FreeBSD.org/
More information about the p4-projects
mailing list