/*
* Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
*
- * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
- * 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. The rights granted to you under the
- * License may not be used to create, or enable the creation or
- * redistribution of, unlawful or unlicensed copies of an Apple operating
- * system, or to circumvent, violate, or enable the circumvention or
- * violation of, any terms of an Apple operating system software license
- * agreement.
- *
- * 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
- * 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
+ * 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. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ *
+ * 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
+ * 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.
- *
- * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
/*
* @OSF_COPYRIGHT@
.text
.align 12 // Page align for single bcopy_phys()
-#define operand_size_prefix .byte 0x66
-#define address_size_prefix .byte 0x67
-
-#define LJMP(segment,address) \
- operand_size_prefix ;\
- .byte 0xea ;\
- .long address-EXT(slave_boot_base) ;\
+#define LJMP(segment,address) \
+ .byte 0xea ;\
+ .long address-EXT(slave_boot_base) ;\
.word segment
-#define LGDT(address) \
- address_size_prefix ;\
- operand_size_prefix ;\
- .word 0x010f ;\
- .byte 0x15 ;\
+#define LGDT(address) \
+ .word 0x010f ;\
+ .byte 0x15 ;\
.long address-EXT(slave_boot_base)
Entry(slave_boot_base)
/* code is loaded at 0x0:0x1000 */
/* ljmp to the next instruction to set up %cs */
- LJMP(MP_BOOTSEG, EXT(slave_rstart))
+ data16
+ LJMP(MP_BOOTSEG, EXT(slave_pstart))
-Entry(slave_rstart)
+Entry(slave_pstart)
/* set up %ds */
mov %cs, %ax
mov %ax, %ds
- POSTCODE(SLAVE_RSTART_ENTRY);
+ POSTCODE(SLAVE_PSTART_ENTRY);
/* set up %ss and %esp */
- mov %cs, %ax
+ data16
+ mov $(MP_BOOTSEG), %eax
mov %ax, %ss
+ data16
mov $(MP_BOOTSTACK), %esp
/*set up %es */
mov %ax, %es
/* change to protected mode */
- operand_size_prefix
- call EXT(slave_real_to_prot)
+ data16
+ call EXT(real_to_prot)
push MP_MACH_START
- call EXT(slave_startprog)
+ call EXT(startprog)
/*
- slave_real_to_prot()
+ real_to_prot()
transfer from real mode to protected mode.
*/
-Entry(slave_real_to_prot)
+Entry(real_to_prot)
/* guarantee that interrupt is disabled when in prot mode */
cli
- POSTCODE(SLAVE_REAL_TO_PROT_ENTRY);
+ POSTCODE(REAL_TO_PROT_ENTRY);
/* load the gdtr */
+ addr16
+ data16
LGDT(EXT(gdtr))
/* load the gdtr */
/* set the PE bit of CR0 */
mov %cr0, %eax
+
+ data16
or $(CR0_PE_ON), %eax
mov %eax, %cr0
/* make intrasegment jump to flush the processor pipeline and */
/* reload CS register */
+ data16
LJMP(0x08, xprot)
+
xprot:
/* we are in USE32 mode now */
movw %ax, %ss
movw %ax, %es
- POSTCODE(SLAVE_REAL_TO_PROT_EXIT);
+ POSTCODE(REAL_TO_PROT_EXIT);
ret
/*
- slave_startprog(phyaddr)
+ startprog(phyaddr)
start the program on protected mode where phyaddr is the entry point
*/
-Entry(slave_startprog)
+Entry(startprog)
push %ebp
movl %esp, %ebp
- POSTCODE(SLAVE_STARTPROG_ENTRY);
+ POSTCODE(STARTPROG_ENTRY);
movl 0x8(%ebp), %ecx /* entry offset */
movl $0x28, %ebx /* segment */
movw %bx, %ds
movw %bx, %es
- POSTCODE(SLAVE_STARTPROG_EXIT);
+ POSTCODE(STARTPROG_EXIT);
lret
.byte 0,0x9e,0x0,0
.word 0xffff,0 /* 0x20 : init data */
- .byte 0,0x9f,0xcf,0
+ .byte 0,0x93,0xcf,0
.word 0xffff,0 /* 0x28 : init code */
.byte 0,0x9f,0xcf,0