Index: head/sys/conf/ldscript.sparc64 =================================================================== --- head/sys/conf/ldscript.sparc64 (revision 83755) +++ head/sys/conf/ldscript.sparc64 (revision 83756) @@ -1,267 +1,267 @@ /* $FreeBSD$ */ OUTPUT_FORMAT("elf64-sparc", "elf64-sparc", "elf64-sparc") OUTPUT_ARCH(sparc:v9) ENTRY(_start) SEARCH_DIR(/home/jake/sparc64-unknown-elf/lib); /* Do we need any of these for elf? __DYNAMIC = 0; */ SECTIONS { /* Read-only sections, merged into text segment: */ - . = 0x400000 + SIZEOF_HEADERS; + . = kernbase + SIZEOF_HEADERS; .interp : { *(.interp) } .hash : { *(.hash) } .dynsym : { *(.dynsym) } .dynstr : { *(.dynstr) } .gnu.version : { *(.gnu.version) } .gnu.version_d : { *(.gnu.version_d) } .gnu.version_r : { *(.gnu.version_r) } .rel.init : { *(.rel.init) } .rela.init : { *(.rela.init) } .rel.text : { *(.rel.text) *(.rel.text.*) *(.rel.gnu.linkonce.t.*) } .rela.text : { *(.rela.text) *(.rela.text.*) *(.rela.gnu.linkonce.t.*) } .rel.fini : { *(.rel.fini) } .rela.fini : { *(.rela.fini) } .rel.rodata : { *(.rel.rodata) *(.rel.rodata.*) *(.rel.gnu.linkonce.r.*) } .rela.rodata : { *(.rela.rodata) *(.rela.rodata.*) *(.rela.gnu.linkonce.r.*) } .rel.data : { *(.rel.data) *(.rel.data.*) *(.rel.gnu.linkonce.d.*) } .rela.data : { *(.rela.data) *(.rela.data.*) *(.rela.gnu.linkonce.d.*) } .rel.ctors : { *(.rel.ctors) } .rela.ctors : { *(.rela.ctors) } .rel.dtors : { *(.rel.dtors) } .rela.dtors : { *(.rela.dtors) } .rel.got : { *(.rel.got) } .rela.got : { *(.rela.got) } .rel.sdata : { *(.rel.sdata) *(.rel.sdata.*) *(.rel.gnu.linkonce.s.*) } .rela.sdata : { *(.rela.sdata) *(.rela.sdata.*) *(.rela.gnu.linkonce.s.*) } .rel.sbss : { *(.rel.sbss) *(.rel.sbss.*) *(.rel.gnu.linkonce.sb.*) } .rela.sbss : { *(.rela.sbss) *(.rela.sbss.*) *(.rel.gnu.linkonce.sb.*) } .rel.sdata2 : { *(.rel.sdata2) *(.rel.sdata2.*) *(.rel.gnu.linkonce.s2.*) } .rela.sdata2 : { *(.rela.sdata2) *(.rela.sdata2.*) *(.rela.gnu.linkonce.s2.*) } .rel.sbss2 : { *(.rel.sbss2) *(.rel.sbss2.*) *(.rel.gnu.linkonce.sb2.*) } .rela.sbss2 : { *(.rela.sbss2) *(.rela.sbss2.*) *(.rela.gnu.linkonce.sb2.*) } .rel.bss : { *(.rel.bss) *(.rel.bss.*) *(.rel.gnu.linkonce.b.*) } .rela.bss : { *(.rela.bss) *(.rela.bss.*) *(.rela.gnu.linkonce.b.*) } .rel.plt : { *(.rel.plt) } .rela.plt : { *(.rela.plt) } .init : { KEEP (*(.init)) - } = 0x400000 + } =0x1000000 .text : { *(.trap) *(.text) *(.text.*) *(.stub) /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) *(.gnu.linkonce.t.*) - } = 0x400000 + } =0x1000000 .fini : { KEEP (*(.fini)) - } = 0x400000 + } =0x1000000 PROVIDE (__etext = .); PROVIDE (_etext = .); PROVIDE (etext = .); .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } .rodata1 : { *(.rodata1) } .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) } .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) } . = ALIGN(0x2000) + (. & (0x2000 - 1)); .data : { *(.data) *(.data.*) *(.gnu.linkonce.d.*) SORT(CONSTRUCTORS) } .data1 : { *(.data1) } .eh_frame : { KEEP (*(.eh_frame)) } .gcc_except_table : { *(.gcc_except_table) } .ctors : { /* gcc uses crtbegin.o to find the start of the constructors, so we make sure it is first. Because this is a wildcard, it doesn't matter if the user does not actually link against crtbegin.o; the linker won't look for a file to match a wildcard. The wildcard also means that it doesn't matter which directory crtbegin.o is in. */ KEEP (*crtbegin.o(.ctors)) /* We don't want to include the .ctor section from from the crtend.o file until after the sorted ctors. The .ctor section from the crtend file contains the end of ctors marker and it must be last */ KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) } .dtors : { KEEP (*crtbegin.o(.dtors)) KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) } .plt : { *(.plt) } .got : { *(.got.plt) *(.got) } .dynamic : { *(.dynamic) } /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ .sdata : { *(.sdata) *(.sdata.*) *(.gnu.linkonce.s.*) } _edata = .; PROVIDE (edata = .); __bss_start = .; .sbss : { PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .); *(.dynsbss) *(.sbss) *(.sbss.*) *(.gnu.linkonce.sb.*) *(.scommon) PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .); } .bss : { *(.dynbss) *(.bss) *(.bss.*) *(.gnu.linkonce.b.*) *(COMMON) /* Align here to ensure that the .bss section occupies space up to _end. Align after .bss to ensure correct alignment even if the .bss section disappears because there are no input sections. */ . = ALIGN(64 / 8); } . = ALIGN(64 / 8); _end = .; PROVIDE (end = .); /* Stabs debugging sections. */ .stab 0 : { *(.stab) } .stabstr 0 : { *(.stabstr) } .stab.excl 0 : { *(.stab.excl) } .stab.exclstr 0 : { *(.stab.exclstr) } .stab.index 0 : { *(.stab.index) } .stab.indexstr 0 : { *(.stab.indexstr) } .comment 0 : { *(.comment) } /* DWARF debug sections. Symbols in the DWARF debugging sections are relative to the beginning of the section so we begin them at 0. */ /* DWARF 1 */ .debug 0 : { *(.debug) } .line 0 : { *(.line) } /* GNU DWARF 1 extensions */ .debug_srcinfo 0 : { *(.debug_srcinfo) } .debug_sfnames 0 : { *(.debug_sfnames) } /* DWARF 1.1 and DWARF 2 */ .debug_aranges 0 : { *(.debug_aranges) } .debug_pubnames 0 : { *(.debug_pubnames) } /* DWARF 2 */ .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } .debug_abbrev 0 : { *(.debug_abbrev) } .debug_line 0 : { *(.debug_line) } .debug_frame 0 : { *(.debug_frame) } .debug_str 0 : { *(.debug_str) } .debug_loc 0 : { *(.debug_loc) } .debug_macinfo 0 : { *(.debug_macinfo) } /* SGI/MIPS DWARF 2 extensions */ .debug_weaknames 0 : { *(.debug_weaknames) } .debug_funcnames 0 : { *(.debug_funcnames) } .debug_typenames 0 : { *(.debug_typenames) } .debug_varnames 0 : { *(.debug_varnames) } /* These must appear regardless of . */ } Index: head/sys/sparc64/sparc64/genassym.c =================================================================== --- head/sys/sparc64/sparc64/genassym.c (revision 83755) +++ head/sys/sparc64/sparc64/genassym.c (revision 83756) @@ -1,228 +1,230 @@ /*- * Copyright (c) 2001 Jake Burkholder. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * from: @(#)genassym.c 5.11 (Berkeley) 5/10/91 * $FreeBSD$ */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include +ASSYM(KERNBASE, KERNBASE); + /* * XXX: gas, as of version 2.11.2, does not know this ASI (and some other * UltraSparc specific ones). This definition will probably get us into trouble * as soon as they are added. */ ASSYM(ASI_BLK_S, ASI_BLK_S); ASSYM(EFAULT, EFAULT); ASSYM(ENAMETOOLONG, ENAMETOOLONG); ASSYM(KSTACK_PAGES, KSTACK_PAGES); ASSYM(UAREA_PAGES, UAREA_PAGES); ASSYM(PAGE_SIZE, PAGE_SIZE); ASSYM(PIL_TICK, PIL_TICK); ASSYM(FPRS_DL, FPRS_DL); ASSYM(FPRS_DU, FPRS_DU); ASSYM(FPRS_FEF, FPRS_FEF); ASSYM(TLB_DAR_TSB_USER_PRIMARY, TLB_DAR_SLOT(TLB_SLOT_TSB_USER_PRIMARY)); ASSYM(TLB_DEMAP_NUCLEUS, TLB_DEMAP_NUCLEUS); ASSYM(TSB_USER_MIN_ADDRESS, TSB_USER_MIN_ADDRESS); ASSYM(TSB_PRIMARY_BUCKET_SHIFT, TSB_PRIMARY_BUCKET_SHIFT); ASSYM(TSB_KERNEL_MIN_ADDRESS, TSB_KERNEL_MIN_ADDRESS); ASSYM(TSB_PRIMARY_MASK_WIDTH, TSB_MASK_WIDTH); ASSYM(TSB_PRIMARY_STTE_MASK, TSB_PRIMARY_STTE_MASK); ASSYM(TSB_PRIMARY_STTE_SHIFT, TSB_PRIMARY_STTE_SHIFT); ASSYM(TSB_1M_STTE_SHIFT, TSB_1M_STTE_SHIFT); ASSYM(TSB_KERNEL_MASK, TSB_KERNEL_MASK); ASSYM(PAGE_SHIFT, PAGE_SHIFT); ASSYM(PAGE_MASK, PAGE_MASK); ASSYM(KTR_COMPILE, KTR_COMPILE); ASSYM(KTR_CT1, KTR_CT1); ASSYM(KTR_CT2, KTR_CT2); ASSYM(KTR_SIZEOF, sizeof(struct ktr_entry)); ASSYM(KTR_DESC, offsetof(struct ktr_entry, ktr_desc)); ASSYM(KTR_PARM1, offsetof(struct ktr_entry, ktr_parm1)); ASSYM(KTR_PARM2, offsetof(struct ktr_entry, ktr_parm2)); ASSYM(KTR_PARM3, offsetof(struct ktr_entry, ktr_parm3)); ASSYM(KTR_PARM4, offsetof(struct ktr_entry, ktr_parm4)); ASSYM(KTR_PARM5, offsetof(struct ktr_entry, ktr_parm5)); ASSYM(TTE_DATA, offsetof(struct tte, tte_data)); ASSYM(TTE_TAG, offsetof(struct tte, tte_tag)); ASSYM(TTE_SHIFT, TTE_SHIFT); ASSYM(ST_TTE, offsetof(struct stte, st_tte)); ASSYM(STTE_SHIFT, STTE_SHIFT); ASSYM(STTE_SIZEOF, sizeof(struct stte)); ASSYM(TD_VA_LOW_MASK, TD_VA_LOW_MASK); ASSYM(TD_VA_LOW_SHIFT, TD_VA_LOW_SHIFT); ASSYM(TD_EXEC, TD_EXEC); ASSYM(TD_INIT, TD_INIT); ASSYM(TD_REF, TD_REF); ASSYM(TD_W, TD_W); ASSYM(TT_VA_MASK, TT_VA_MASK); ASSYM(TT_VA_SHIFT, TT_VA_SHIFT); ASSYM(TT_CTX_SHIFT, TT_CTX_SHIFT); ASSYM(GD_CURTHREAD, offsetof(struct globaldata, gd_curthread)); ASSYM(GD_CURPCB, offsetof(struct globaldata, gd_curpcb)); ASSYM(GD_CPUID, offsetof(struct globaldata, gd_cpuid)); ASSYM(GD_IQ, offsetof(struct globaldata, gd_iq)); ASSYM(GD_IVT, offsetof(struct globaldata, gd_ivt)); ASSYM(IQ_MASK, IQ_MASK); ASSYM(IQ_HEAD, offsetof(struct intr_queue, iq_head)); ASSYM(IQ_TAIL, offsetof(struct intr_queue, iq_tail)); ASSYM(IQE_SHIFT, IQE_SHIFT); ASSYM(IQE_TAG, offsetof(struct iqe, iqe_tag)); ASSYM(IQE_PRI, offsetof(struct iqe, iqe_pri)); ASSYM(IQE_VEC, offsetof(struct iqe, iqe_vec)); ASSYM(IQE_FUNC, offsetof(struct iqe, iqe_func)); ASSYM(IQE_ARG, offsetof(struct iqe, iqe_arg)); ASSYM(IV_SHIFT, IV_SHIFT); ASSYM(IV_FUNC, offsetof(struct intr_vector, iv_func)); ASSYM(IV_ARG, offsetof(struct intr_vector, iv_arg)); ASSYM(IV_PRI, offsetof(struct intr_vector, iv_pri)); ASSYM(JB_FP, offsetof(struct _jmp_buf, _jb[_JB_FP])); ASSYM(JB_PC, offsetof(struct _jmp_buf, _jb[_JB_PC])); ASSYM(JB_SP, offsetof(struct _jmp_buf, _jb[_JB_SP])); ASSYM(KEF_ASTPENDING, KEF_ASTPENDING); ASSYM(KEF_NEEDRESCHED, KEF_NEEDRESCHED); ASSYM(P_COMM, offsetof(struct proc, p_comm)); ASSYM(P_SFLAG, offsetof(struct proc, p_sflag)); ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace)); ASSYM(KE_FLAGS, offsetof(struct kse, ke_flags)); ASSYM(TD_FRAME, offsetof(struct thread, td_frame)); ASSYM(TD_KSE, offsetof(struct thread, td_kse)); ASSYM(TD_KSTACK, offsetof(struct thread, td_kstack)); ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); ASSYM(TD_PROC, offsetof(struct thread, td_proc)); ASSYM(PCB_FPSTATE, offsetof(struct pcb, pcb_fpstate)); ASSYM(PCB_FP, offsetof(struct pcb, pcb_fp)); ASSYM(PCB_PC, offsetof(struct pcb, pcb_pc)); ASSYM(PCB_Y, offsetof(struct pcb, pcb_pc)); ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); ASSYM(PCB_CWP, offsetof(struct pcb, pcb_cwp)); ASSYM(PCB_NSAVED, offsetof(struct pcb, pcb_nsaved)); ASSYM(PCB_RWSP, offsetof(struct pcb, pcb_rwsp)); ASSYM(PCB_RW, offsetof(struct pcb, pcb_rw)); ASSYM(PCB_CWP_EMPTY, PCB_CWP_EMPTY); ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap)); ASSYM(PM_CONTEXT, offsetof(struct pmap, pm_context)); ASSYM(PM_STTE, offsetof(struct pmap, pm_stte)); ASSYM(FP_FB0, offsetof(struct fpstate, fp_fb[0])); ASSYM(FP_FB1, offsetof(struct fpstate, fp_fb[1])); ASSYM(FP_FB2, offsetof(struct fpstate, fp_fb[2])); ASSYM(FP_FB3, offsetof(struct fpstate, fp_fb[3])); ASSYM(FP_FSR, offsetof(struct fpstate, fp_fsr)); ASSYM(FP_FPRS, offsetof(struct fpstate, fp_fprs)); ASSYM(CCFSZ, sizeof(struct frame)); ASSYM(SPOFF, SPOFF); ASSYM(SF_UC, offsetof(struct sigframe, sf_uc)); ASSYM(KF_FP, offsetof(struct kdbframe, kf_fp)); ASSYM(KF_SIZEOF, sizeof(struct kdbframe)); ASSYM(MF_SFAR, offsetof(struct mmuframe, mf_sfar)); ASSYM(MF_SFSR, offsetof(struct mmuframe, mf_sfsr)); ASSYM(MF_TAR, offsetof(struct mmuframe, mf_tar)); ASSYM(MF_SIZEOF, sizeof(struct mmuframe)); ASSYM(TF_G0, offsetof(struct trapframe, tf_global[0])); ASSYM(TF_G1, offsetof(struct trapframe, tf_global[1])); ASSYM(TF_G2, offsetof(struct trapframe, tf_global[2])); ASSYM(TF_G3, offsetof(struct trapframe, tf_global[3])); ASSYM(TF_G4, offsetof(struct trapframe, tf_global[4])); ASSYM(TF_G5, offsetof(struct trapframe, tf_global[5])); ASSYM(TF_G6, offsetof(struct trapframe, tf_global[6])); ASSYM(TF_G7, offsetof(struct trapframe, tf_global[7])); ASSYM(TF_O0, offsetof(struct trapframe, tf_out[0])); ASSYM(TF_O1, offsetof(struct trapframe, tf_out[1])); ASSYM(TF_O2, offsetof(struct trapframe, tf_out[2])); ASSYM(TF_O3, offsetof(struct trapframe, tf_out[3])); ASSYM(TF_O4, offsetof(struct trapframe, tf_out[4])); ASSYM(TF_O5, offsetof(struct trapframe, tf_out[5])); ASSYM(TF_O6, offsetof(struct trapframe, tf_out[6])); ASSYM(TF_O7, offsetof(struct trapframe, tf_out[7])); ASSYM(TF_SP, offsetof(struct trapframe, tf_sp)); ASSYM(TF_PIL, offsetof(struct trapframe, tf_pil)); ASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate)); ASSYM(TF_TPC, offsetof(struct trapframe, tf_tpc)); ASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc)); ASSYM(TF_TYPE, offsetof(struct trapframe, tf_type)); ASSYM(TF_WSTATE, offsetof(struct trapframe, tf_wstate)); ASSYM(TF_ARG, offsetof(struct trapframe, tf_arg)); ASSYM(TF_SIZEOF, sizeof(struct trapframe)); Index: head/sys/sparc64/sparc64/locore.S =================================================================== --- head/sys/sparc64/sparc64/locore.S (revision 83755) +++ head/sys/sparc64/sparc64/locore.S (revision 83756) @@ -1,73 +1,76 @@ /*- * Copyright (c) 2001 Jake Burkholder. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #include #include #include #include "assym.s" + .globl kernbase + .set kernbase,KERNBASE + /* * void _start(struct bootinfo *bi, u_long ofw_vec) */ ENTRY(_start) wrpr %g0, PSTATE_IE | PSTATE_PRIV | PSTATE_PEF, %pstate mov %o0, %g1 mov %o1, %g2 flushw wrpr %g0, 1, %cwp wrpr %g0, 0, %cleanwin wrpr %g0, 0, %pil setx kstack0 + KSTACK_PAGES * PAGE_SIZE - SPOFF, %l0, %o5 save %o5, -CCFSZ, %sp mov %g1, %o0 call sparc64_init mov %g2, %o1 call mi_startup nop ! NOTREACHED END(_start) ENTRY(sigcode) call %o4 nop add %sp, SPOFF + SF_UC, %o0 mov SYS_sigreturn, %g1 ta %xcc, 9 mov SYS_exit, %g1 ta %xcc, 9 1: b %xcc, 1b nop esigcode: END(sigcode) DATA(szsigcode) .long esigcode - sigcode Index: head/sys/sparc64/sparc64/locore.s =================================================================== --- head/sys/sparc64/sparc64/locore.s (revision 83755) +++ head/sys/sparc64/sparc64/locore.s (revision 83756) @@ -1,73 +1,76 @@ /*- * Copyright (c) 2001 Jake Burkholder. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #include #include #include #include "assym.s" + .globl kernbase + .set kernbase,KERNBASE + /* * void _start(struct bootinfo *bi, u_long ofw_vec) */ ENTRY(_start) wrpr %g0, PSTATE_IE | PSTATE_PRIV | PSTATE_PEF, %pstate mov %o0, %g1 mov %o1, %g2 flushw wrpr %g0, 1, %cwp wrpr %g0, 0, %cleanwin wrpr %g0, 0, %pil setx kstack0 + KSTACK_PAGES * PAGE_SIZE - SPOFF, %l0, %o5 save %o5, -CCFSZ, %sp mov %g1, %o0 call sparc64_init mov %g2, %o1 call mi_startup nop ! NOTREACHED END(_start) ENTRY(sigcode) call %o4 nop add %sp, SPOFF + SF_UC, %o0 mov SYS_sigreturn, %g1 ta %xcc, 9 mov SYS_exit, %g1 ta %xcc, 9 1: b %xcc, 1b nop esigcode: END(sigcode) DATA(szsigcode) .long esigcode - sigcode