Date: Mon, 5 Oct 2009 00:28:47 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r197762 - projects/ppc64/sys/powerpc/aim64 Message-ID: <200910050028.n950Sldc089935@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nwhitehorn Date: Mon Oct 5 00:28:47 2009 New Revision: 197762 URL: http://svn.freebsd.org/changeset/base/197762 Log: Change the fake top stack frame from 16 to 48 bytes to match the ABI, and use the dsitrap handler for data segment exceptions in order to record the DAR. Still weird crashing bugs associated with threading -- maybe the trap handlers are misbehaving in a way that completely eludes me. Modified: projects/ppc64/sys/powerpc/aim64/locore.S projects/ppc64/sys/powerpc/aim64/machdep.c projects/ppc64/sys/powerpc/aim64/trap_subr.S Modified: projects/ppc64/sys/powerpc/aim64/locore.S ============================================================================== --- projects/ppc64/sys/powerpc/aim64/locore.S Sun Oct 4 23:30:08 2009 (r197761) +++ projects/ppc64/sys/powerpc/aim64/locore.S Mon Oct 5 00:28:47 2009 (r197762) @@ -147,8 +147,8 @@ ASENTRY(__start) std 5,openfirmware_entry@l(8) /* save client interface handler */ /* Set up the stack pointer */ - lis 1,(tmpstk+TMPSTKSZ-16)@ha - addi 1,1,(tmpstk+TMPSTKSZ-16)@l + lis 1,(tmpstk+TMPSTKSZ-48)@ha + addi 1,1,(tmpstk+TMPSTKSZ-48)@l /* Set up the TOC pointer */ lis 2,tocbase@ha Modified: projects/ppc64/sys/powerpc/aim64/machdep.c ============================================================================== --- projects/ppc64/sys/powerpc/aim64/machdep.c Sun Oct 4 23:30:08 2009 (r197761) +++ projects/ppc64/sys/powerpc/aim64/machdep.c Mon Oct 5 00:28:47 2009 (r197762) @@ -128,8 +128,8 @@ extern vm_offset_t ksym_start, ksym_end; #endif int cold = 1; -int cacheline_size = 32; -int ppc64 = 0; +int cacheline_size = 128; +int ppc64 = 1; int hw_direct_map = 1; struct pcpu __pcpu[MAXCPU]; @@ -145,17 +145,10 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, SYSCTL_INT(_machdep, CPU_CACHELINE, cacheline_size, CTLFLAG_RD, &cacheline_size, 0, ""); -u_int powerpc_init(u_int, u_int, u_int, void *); - -int save_ofw_mapping(void); -int restore_ofw_mapping(void); - -void install_extint(void (*)(void)); - -int setfault(faultbuf); /* defined in locore.S */ - +uintptr_t powerpc_init(vm_offset_t, vm_offset_t, vm_offset_t, void *); static int grab_mcontext(struct thread *, mcontext_t *, int); +int setfault(faultbuf); /* defined in locore.S */ void asm_panic(char *); long Maxmem = 0; @@ -239,8 +232,9 @@ extern void *decrint, *decrsize; extern void *extint, *extsize; extern void *dblow, *dbsize; -u_int -powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, void *mdp) +uintptr_t +powerpc_init(vm_offset_t startkernel, vm_offset_t endkernel, + vm_offset_t basekernel, void *mdp) { struct pcpu *pc; vm_offset_t end; @@ -372,11 +366,9 @@ powerpc_init(u_int startkernel, u_int en cache_check[cacheline_size] == 0; cacheline_size++); /* - * This is a PPC64 system + * Install interrupt handlers */ - ppc64 = 1; - #ifdef SMP bcopy(&rstcode, (void *)EXC_RST, (size_t)&rstsize); #else @@ -395,7 +387,7 @@ powerpc_init(u_int startkernel, u_int en bcopy(&trapcode, (void *)EXC_BPT, (size_t)&trapsize); #endif bcopy(&dsitrap, (void *)EXC_DSI, (size_t)&dsisize); - bcopy(&trapcode, (void *)EXC_DSE, (size_t)&trapsize); + bcopy(&dsitrap, (void *)EXC_DSE, (size_t)&dsisize); bcopy(&alitrap, (void *)EXC_ALI, (size_t)&alisize); bcopy(&trapcode, (void *)EXC_ISI, (size_t)&trapsize); bcopy(&trapcode, (void *)EXC_ISE, (size_t)&trapsize); @@ -464,7 +456,7 @@ powerpc_init(u_int startkernel, u_int en "Boot flags requested debugger"); #endif - return (((uintptr_t)thread0.td_pcb - 16) & ~15UL); + return (((uintptr_t)thread0.td_pcb - 48) & ~15UL); } void Modified: projects/ppc64/sys/powerpc/aim64/trap_subr.S ============================================================================== --- projects/ppc64/sys/powerpc/aim64/trap_subr.S Sun Oct 4 23:30:08 2009 (r197761) +++ projects/ppc64/sys/powerpc/aim64/trap_subr.S Mon Oct 5 00:28:47 2009 (r197762) @@ -543,8 +543,8 @@ dbtrap: andi. %r1,%r1,0xff00 mtsprg3 %r1 - lis %r1,(tmpstk+TMPSTKSZ-16)@ha /* get new SP */ - addi %r1,%r1,(tmpstk+TMPSTKSZ-16)@l + lis %r1,(tmpstk+TMPSTKSZ-48)@ha /* get new SP */ + addi %r1,%r1,(tmpstk+TMPSTKSZ-48)@l FRAME_SETUP(PC_DBSAVE) /* Call C trap code: */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910050028.n950Sldc089935>