From owner-p4-projects Sat Apr 6 7: 1:22 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 95DA237B417; Sat, 6 Apr 2002 07:00:42 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 66F4B37B405 for ; Sat, 6 Apr 2002 07:00:41 -0800 (PST) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g36F0fH91127 for perforce@freebsd.org; Sat, 6 Apr 2002 07:00:41 -0800 (PST) (envelope-from jake@freebsd.org) Date: Sat, 6 Apr 2002 07:00:41 -0800 (PST) Message-Id: <200204061500.g36F0fH91127@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to jake@freebsd.org using -f From: Jake Burkholder Subject: PERFORCE change 9206 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=9206 Change 9206 by jake@jake_sparc64 on 2002/04/06 06:59:44 Rename fields in struct frame to match netbsd/openbsd. f_ -> fr_, add fr_arg alias for fr_in. Rearrange struct reg to be ABI compatible; add r_in, r_local XXX these aren't filled in. Affected files ... ... //depot/projects/sparc64/sys/sparc64/include/frame.h#21 edit ... //depot/projects/sparc64/sys/sparc64/include/reg.h#12 edit ... //depot/projects/sparc64/sys/sparc64/sparc64/db_trace.c#27 edit ... //depot/projects/sparc64/sys/sparc64/sparc64/emul.c#11 edit ... //depot/projects/sparc64/sys/sparc64/sparc64/machdep.c#73 edit ... //depot/projects/sparc64/sys/sparc64/sparc64/trap.c#69 edit ... //depot/projects/sparc64/sys/sparc64/sparc64/vm_machdep.c#47 edit Differences ... ==== //depot/projects/sparc64/sys/sparc64/include/frame.h#21 (text+ko) ==== @@ -31,6 +31,7 @@ #define RW_SHIFT 7 #define SPOFF 2047 +#define BIAS SPOFF /* XXX - open/netbsd compat */ struct trapframe { u_long tf_global[8]; @@ -62,12 +63,15 @@ }; struct frame { - u_long f_local[8]; - u_long f_in[8]; - u_long f_pad[8]; + u_long fr_local[8]; + u_long fr_in[8]; + u_long fr_pad[8]; }; -#define f_fp f_in[6] -#define f_pc f_in[7] +#define fr_arg fr_in +#define fr_fp fr_in[6] +#define fr_pc fr_in[7] + +#define v9next_frame(fp) ((struct frame *)(fp->fr_fp + BIAS)) /* * Frame used for pcb_wscratch. ==== //depot/projects/sparc64/sys/sparc64/include/reg.h#12 (text+ko) ==== @@ -45,12 +45,14 @@ * Register set accessible via /proc/$pid/regs and PT_{SET,GET}REGS. */ struct reg { - u_long r_global[8]; - u_long r_out[8]; u_long r_tstate; u_long r_pc; u_long r_npc; u_int r_y; + u_long r_global[8]; + u_long r_out[8]; + u_long r_local[8]; + u_long r_in[8]; }; /* ==== //depot/projects/sparc64/sys/sparc64/sparc64/db_trace.c#27 (text+ko) ==== @@ -148,8 +148,8 @@ fp = (struct frame *)(addr + SPOFF); while (count-- && !user) { - pc = (db_addr_t)db_get_value((db_addr_t)&fp->f_pc, - sizeof(fp->f_pc), FALSE); + pc = (db_addr_t)db_get_value((db_addr_t)&fp->fr_pc, + sizeof(fp->fr_pc), FALSE); if (trap) { pc = npc; trap = 0; @@ -164,8 +164,8 @@ db_symbol_values(sym, &name, &value); if (name == NULL) name = "(null)"; - fp = (struct frame *)(db_get_value((db_addr_t)&fp->f_fp, - sizeof(fp->f_fp), FALSE) + SPOFF); + fp = (struct frame *)(db_get_value((db_addr_t)&fp->fr_fp, + sizeof(fp->fr_fp), FALSE) + SPOFF); if (bcmp(name, "tl0_", 4) == 0 || bcmp(name, "tl1_", 4) == 0) { tf = (struct trapframe *)(fp + 1); @@ -296,9 +296,9 @@ if (!found) { rsp = sp + SPOFF; sp = NULL; - if (copyin((void *)(rsp + offsetof(struct frame, f_fp)), + if (copyin((void *)(rsp + offsetof(struct frame, fr_fp)), &sp, sizeof(sp)) != 0 || - copyin((void *)(rsp + offsetof(struct frame, f_pc)), + copyin((void *)(rsp + offsetof(struct frame, fr_pc)), &pc, sizeof(pc)) != 0) break; } ==== //depot/projects/sparc64/sys/sparc64/sparc64/emul.c#11 (text+ko) ==== @@ -70,7 +70,7 @@ * The in registers are immediately after the locals in * the frame. */ - offs = offsetof(struct frame, f_local[reg - IREG_L0]); + offs = offsetof(struct frame, fr_local[reg - IREG_L0]); return (copyin((void *)(tf->tf_sp + SPOFF + offs), val, sizeof(*val))); } @@ -94,7 +94,7 @@ * The in registers are immediately after the locals in * the frame. */ - offs = offsetof(struct frame, f_local[reg - IREG_L0]); + offs = offsetof(struct frame, fr_local[reg - IREG_L0]); return (copyout(&val, (void *)(tf->tf_sp + SPOFF + offs), sizeof(val))); } ==== //depot/projects/sparc64/sys/sparc64/sparc64/machdep.c#73 (text+ko) ==== @@ -428,7 +428,7 @@ /* Copy the sigframe out to the user's stack. */ if (rwindow_save(td) != 0 || copyout(&sf, sfp, sizeof(*sfp)) != 0 || - suword(&fp->f_in[6], tf->tf_out[6]) != 0) { + suword(&fp->fr_in[6], tf->tf_out[6]) != 0) { /* * Something is wrong with the stack pointer. * ...Kill the process. @@ -638,12 +638,15 @@ struct trapframe *tf; tf = td->td_frame; + regs->r_tstate = tf->tf_tstate; + regs->r_pc = tf->tf_tpc; + regs->r_npc = tf->tf_tnpc; + regs->r_y = tf->tf_y; bcopy(tf->tf_global, regs->r_global, sizeof(tf->tf_global)); bcopy(tf->tf_out, regs->r_out, sizeof(tf->tf_out)); - regs->r_npc = tf->tf_tnpc; - regs->r_pc = tf->tf_tpc; - regs->r_tstate = tf->tf_tstate; - regs->r_y = tf->tf_y; + /* XXX - these are a pain to get at */ + bzero(regs->r_in, sizeof(regs->r_in)); + bzero(regs->r_local, sizeof(regs->r_local)); return (0); } @@ -657,12 +660,12 @@ return (EINVAL); if (!TSTATE_SECURE(regs->r_tstate)) return (EINVAL); + tf->tf_tstate = regs->r_tstate; + tf->tf_tpc = regs->r_pc; + tf->tf_tnpc = regs->r_npc; + tf->tf_y = regs->r_y; bcopy(regs->r_global, tf->tf_global, sizeof(regs->r_global)); bcopy(regs->r_out, tf->tf_out, sizeof(regs->r_out)); - tf->tf_tnpc = regs->r_npc; - tf->tf_tpc = regs->r_pc; - tf->tf_tstate = regs->r_tstate; - tf->tf_y = regs->r_y; return (0); } ==== //depot/projects/sparc64/sys/sparc64/sparc64/trap.c#69 (text+ko) ==== @@ -652,7 +652,7 @@ argp = args; bcopy(&tf->tf_out[reg], args, sizeof(args[0]) * regcnt); error = copyin((void *)(tf->tf_out[6] + SPOFF + - offsetof(struct frame, f_pad[6])), + offsetof(struct frame, fr_pad[6])), &args[regcnt], (narg - regcnt) * sizeof(args[0])); if (error != 0) goto bad; ==== //depot/projects/sparc64/sys/sparc64/sparc64/vm_machdep.c#47 (text+ko) ==== @@ -234,9 +234,9 @@ td2->td_frame = tf; fp = (struct frame *)tf - 1; - fp->f_local[0] = (u_long)fork_return; - fp->f_local[1] = (u_long)td2; - fp->f_local[2] = (u_long)tf; + fp->fr_local[0] = (u_long)fork_return; + fp->fr_local[1] = (u_long)td2; + fp->fr_local[2] = (u_long)tf; pcb2->pcb_fp = (u_long)fp - SPOFF; pcb2->pcb_pc = (u_long)fork_trampoline - 8; @@ -284,8 +284,8 @@ pcb = td->td_pcb; fp = (struct frame *)(pcb->pcb_fp + SPOFF); - fp->f_local[0] = (u_long)func; - fp->f_local[1] = (u_long)arg; + fp->fr_local[0] = (u_long)func; + fp->fr_local[1] = (u_long)arg; } void To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message