From owner-p4-projects@FreeBSD.ORG Sun Mar 20 00:02:34 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 60DAC16A4D0; Sun, 20 Mar 2005 00:02:34 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1A1DB16A4CE for ; Sun, 20 Mar 2005 00:02:34 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CACAE43D2F for ; Sun, 20 Mar 2005 00:02:33 +0000 (GMT) (envelope-from jmallett@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j2K02XVk051309 for ; Sun, 20 Mar 2005 00:02:33 GMT (envelope-from jmallett@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j2K02XXt051306 for perforce@freebsd.org; Sun, 20 Mar 2005 00:02:33 GMT (envelope-from jmallett@freebsd.org) Date: Sun, 20 Mar 2005 00:02:33 GMT Message-Id: <200503200002.j2K02XXt051306@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jmallett@freebsd.org using -f From: Juli Mallett To: Perforce Change Reviews Subject: PERFORCE change 73547 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2005 00:02:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=73547 Change 73547 by jmallett@jmallett_windward on 2005/03/20 00:01:33 Cleanup PCB some. Affected files ... .. //depot/projects/mips/sys/mips/include/pcb.h#9 edit .. //depot/projects/mips/sys/mips/mips/genassym.c#15 edit .. //depot/projects/mips/sys/mips/mips/locore.S#17 edit .. //depot/projects/mips/sys/mips/mips/machdep.c#54 edit .. //depot/projects/mips/sys/mips/mips/support.S#14 edit .. //depot/projects/mips/sys/mips/mips/swtch.S#8 edit Differences ... ==== //depot/projects/mips/sys/mips/include/pcb.h#9 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2003-2004 Juli Mallett. All rights reserved. + * Copyright (c) 2003-2005 Juli Mallett. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -37,7 +37,18 @@ __register_t pcb_regs[12]; }; -typedef struct pcb label_t; +#define PCB_REG_S0 (0x00) +#define PCB_REG_S1 (0x01) +#define PCB_REG_S2 (0x02) +#define PCB_REG_S3 (0x03) +#define PCB_REG_S4 (0x04) +#define PCB_REG_S5 (0x05) +#define PCB_REG_S6 (0x06) +#define PCB_REG_S7 (0x07) +#define PCB_REG_SP (0x08) +#define PCB_REG_S8 (0x09) +#define PCB_REG_SR (0x0a) +#define PCB_REG_RA (0x0b) #ifdef _KERNEL #define PCB_FSR(pcb) (0) ==== //depot/projects/mips/sys/mips/mips/genassym.c#15 (text+ko) ==== @@ -165,19 +165,18 @@ ASSYM(TF_REG_SP, offsetof(struct trapframe, tf_regs[TF_SP])); ASSYM(TF_PPL, offsetof(struct trapframe, tf_ppl)); -ASSYM(CTXSWFRAME_SIZ, sizeof(label_t)); -ASSYM(SF_REG_SR, offsetof(label_t, pcb_regs[11])); -ASSYM(SF_REG_RA, offsetof(label_t, pcb_regs[10])); -ASSYM(SF_REG_S0, offsetof(label_t, pcb_regs[0])); -ASSYM(SF_REG_S1, offsetof(label_t, pcb_regs[1])); -ASSYM(SF_REG_S2, offsetof(label_t, pcb_regs[2])); -ASSYM(SF_REG_S3, offsetof(label_t, pcb_regs[3])); -ASSYM(SF_REG_S4, offsetof(label_t, pcb_regs[4])); -ASSYM(SF_REG_S5, offsetof(label_t, pcb_regs[5])); -ASSYM(SF_REG_S6, offsetof(label_t, pcb_regs[6])); -ASSYM(SF_REG_S7, offsetof(label_t, pcb_regs[7])); -ASSYM(SF_REG_SP, offsetof(label_t, pcb_regs[8])); -ASSYM(SF_REG_S8, offsetof(label_t, pcb_regs[9])); +ASSYM(PCB_REG_S0, offsetof(struct pcb, pcb_regs[PCB_REG_S0])) +ASSYM(PCB_REG_S1, offsetof(struct pcb, pcb_regs[PCB_REG_S1])) +ASSYM(PCB_REG_S2, offsetof(struct pcb, pcb_regs[PCB_REG_S2])) +ASSYM(PCB_REG_S3, offsetof(struct pcb, pcb_regs[PCB_REG_S3])) +ASSYM(PCB_REG_S4, offsetof(struct pcb, pcb_regs[PCB_REG_S4])) +ASSYM(PCB_REG_S5, offsetof(struct pcb, pcb_regs[PCB_REG_S5])) +ASSYM(PCB_REG_S6, offsetof(struct pcb, pcb_regs[PCB_REG_S6])) +ASSYM(PCB_REG_S7, offsetof(struct pcb, pcb_regs[PCB_REG_S7])) +ASSYM(PCB_REG_S8, offsetof(struct pcb, pcb_regs[PCB_REG_S8])) +ASSYM(PCB_REG_SP, offsetof(struct pcb, pcb_regs[PCB_REG_SP])) +ASSYM(PCB_REG_SR, offsetof(struct pcb, pcb_regs[PCB_REG_SR])) +ASSYM(PCB_REG_RA, offsetof(struct pcb, pcb_regs[PCB_REG_RA])) ASSYM(VM_MIN_ADDRESS, VM_MIN_ADDRESS); ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); ==== //depot/projects/mips/sys/mips/mips/locore.S#17 (text+ko) ==== @@ -101,7 +101,7 @@ ld k0, pcpup ld k0, PC_CURTHREAD(k0) ld k0, TD_PCB(k0) - ld k0, SF_REG_SP(k0) + ld k0, PCB_REG_SP(k0) /* Start MI things rolling. */ jal mi_startup ==== //depot/projects/mips/sys/mips/mips/machdep.c#54 (text+ko) ==== @@ -149,9 +149,9 @@ void makectx(struct trapframe *tf, struct pcb *pcb) { - pcb->pcb_regs[11] = tf->tf_regs[TF_SR]; - pcb->pcb_regs[10] = tf->tf_regs[TF_RA]; - pcb->pcb_regs[8] = tf->tf_regs[TF_SP]; + pcb->pcb_regs[PCB_REG_SR] = tf->tf_regs[TF_SR]; + pcb->pcb_regs[PCB_REG_RA] = tf->tf_regs[TF_RA]; + pcb->pcb_regs[PCB_REG_SP] = tf->tf_regs[TF_SP]; } ==== //depot/projects/mips/sys/mips/mips/support.S#14 (text+ko) ==== @@ -292,18 +292,18 @@ */ ENTRY(setjmp) mfc0 t0, MIPS_COP_0_STATUS - sd s0, SF_REG_S0(a0) - sd s1, SF_REG_S1(a0) - sd s2, SF_REG_S2(a0) - sd s3, SF_REG_S3(a0) - sd s4, SF_REG_S4(a0) - sd s5, SF_REG_S5(a0) - sd s6, SF_REG_S6(a0) - sd s7, SF_REG_S7(a0) - sd s8, SF_REG_S8(a0) - sd sp, SF_REG_SP(a0) - sd t0, SF_REG_SR(a0) - sd ra, SF_REG_RA(a0) + sd s0, PCB_REG_S0(a0) + sd s1, PCB_REG_S1(a0) + sd s2, PCB_REG_S2(a0) + sd s3, PCB_REG_S3(a0) + sd s4, PCB_REG_S4(a0) + sd s5, PCB_REG_S5(a0) + sd s6, PCB_REG_S6(a0) + sd s7, PCB_REG_S7(a0) + sd s8, PCB_REG_S8(a0) + sd sp, PCB_REG_SP(a0) + sd t0, PCB_REG_SR(a0) + sd ra, PCB_REG_RA(a0) li v0, 0 jr ra nop @@ -314,18 +314,18 @@ * void longjmp(jmp_buf, retval) */ ENTRY(longjmp) - ld s0, SF_REG_S0(a0) - ld s1, SF_REG_S1(a0) - ld s2, SF_REG_S2(a0) - ld s3, SF_REG_S3(a0) - ld s4, SF_REG_S4(a0) - ld s5, SF_REG_S5(a0) - ld s6, SF_REG_S6(a0) - ld s7, SF_REG_S7(a0) - ld s8, SF_REG_S8(a0) - ld sp, SF_REG_SP(a0) - ld ra, SF_REG_RA(a0) - ld t0, SF_REG_SR(a0) + ld s0, PCB_REG_S0(a0) + ld s1, PCB_REG_S1(a0) + ld s2, PCB_REG_S2(a0) + ld s3, PCB_REG_S3(a0) + ld s4, PCB_REG_S4(a0) + ld s5, PCB_REG_S5(a0) + ld s6, PCB_REG_S6(a0) + ld s7, PCB_REG_S7(a0) + ld s8, PCB_REG_S8(a0) + ld sp, PCB_REG_SP(a0) + ld ra, PCB_REG_RA(a0) + ld t0, PCB_REG_SR(a0) mtc0 t0, MIPS_COP_0_STATUS move v0, a1 jr ra ==== //depot/projects/mips/sys/mips/mips/swtch.S#8 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/mips/sys/mips/mips/swtch.S#7 $ + * $P4: //depot/projects/mips/sys/mips/mips/swtch.S#8 $ */ #include @@ -44,18 +44,18 @@ */ ENTRY(savectx) mfc0 t0, MIPS_COP_0_STATUS - sd s0, SF_REG_S0(a0) - sd s1, SF_REG_S1(a0) - sd s2, SF_REG_S2(a0) - sd s3, SF_REG_S3(a0) - sd s4, SF_REG_S4(a0) - sd s5, SF_REG_S5(a0) - sd s6, SF_REG_S6(a0) - sd s7, SF_REG_S7(a0) - sd s8, SF_REG_S8(a0) - sd sp, SF_REG_SP(a0) - sd t0, SF_REG_SR(a0) - sd ra, SF_REG_RA(a0) + sd s0, PCB_REG_S0(a0) + sd s1, PCB_REG_S1(a0) + sd s2, PCB_REG_S2(a0) + sd s3, PCB_REG_S3(a0) + sd s4, PCB_REG_S4(a0) + sd s5, PCB_REG_S5(a0) + sd s6, PCB_REG_S6(a0) + sd s7, PCB_REG_S7(a0) + sd s8, PCB_REG_S8(a0) + sd sp, PCB_REG_SP(a0) + sd t0, PCB_REG_SR(a0) + sd ra, PCB_REG_RA(a0) li v0, 0 jr ra nop @@ -77,18 +77,18 @@ sd t3, PC_CURTHREAD(t2) ld t0, TD_PCB(t3) sd t0, PC_CURPCB(t2) - ld s0, SF_REG_S0(t0) - ld s1, SF_REG_S1(t0) - ld s2, SF_REG_S2(t0) - ld s3, SF_REG_S3(t0) - ld s4, SF_REG_S4(t0) - ld s5, SF_REG_S5(t0) - ld s6, SF_REG_S6(t0) - ld s7, SF_REG_S7(t0) - ld s8, SF_REG_S8(t0) - ld sp, SF_REG_SP(t0) - ld ra, SF_REG_RA(t0) - ld t0, SF_REG_SR(t0) + ld s0, PCB_REG_S0(t0) + ld s1, PCB_REG_S1(t0) + ld s2, PCB_REG_S2(t0) + ld s3, PCB_REG_S3(t0) + ld s4, PCB_REG_S4(t0) + ld s5, PCB_REG_S5(t0) + ld s6, PCB_REG_S6(t0) + ld s7, PCB_REG_S7(t0) + ld s8, PCB_REG_S8(t0) + ld sp, PCB_REG_SP(t0) + ld ra, PCB_REG_RA(t0) + ld t0, PCB_REG_SR(t0) /* Copy s0-s3 into a0-s3 so we can just pass args. */ move a0, s0 move a1, s1