Fri Aug 23 06:24:21 2013 UTC ()
Avoid a few instructions since we know CURLWP is in %r13


(matt)
diff -r1.76 -r1.77 src/sys/arch/powerpc/powerpc/trap_subr.S

cvs diff -r1.76 -r1.77 src/sys/arch/powerpc/powerpc/trap_subr.S (expand / switch to unified diff)

--- src/sys/arch/powerpc/powerpc/trap_subr.S 2013/04/11 17:13:15 1.76
+++ src/sys/arch/powerpc/powerpc/trap_subr.S 2013/08/23 06:24:21 1.77
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: trap_subr.S,v 1.76 2013/04/11 17:13:15 macallan Exp $ */ 1/* $NetBSD: trap_subr.S,v 1.77 2013/08/23 06:24:21 matt Exp $ */
2 2
3/* 3/*
4 * Copyright (C) 1995, 1996 Wolfgang Solfrank. 4 * Copyright (C) 1995, 1996 Wolfgang Solfrank.
5 * Copyright (C) 1995, 1996 TooLs GmbH. 5 * Copyright (C) 1995, 1996 TooLs GmbH.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -1058,33 +1058,27 @@ _C_LABEL(sctrap): @@ -1058,33 +1058,27 @@ _C_LABEL(sctrap):
1058s_sctrap: 1058s_sctrap:
1059 GET_CPUINFO(%r1) 1059 GET_CPUINFO(%r1)
1060 ldptr %r1,CI_CURPCB(%r1) 1060 ldptr %r1,CI_CURPCB(%r1)
1061 addi %r1,%r1,USPACE-CALLFRAMELEN /* stack is top of user struct */ 1061 addi %r1,%r1,USPACE-CALLFRAMELEN /* stack is top of user struct */
1062 RESTORE_KERN_SRS(%r30,%r31) /* First enable KERNEL mapping */ 1062 RESTORE_KERN_SRS(%r30,%r31) /* First enable KERNEL mapping */
1063 FRAME_SETUP(CI_TEMPSAVE) 1063 FRAME_SETUP(CI_TEMPSAVE)
1064/* Now we can recover interrupts again: */ 1064/* Now we can recover interrupts again: */
1065 mfmsr %r7 1065 mfmsr %r7
1066 ori %r7,%r7,(PSL_EE|PSL_ME|PSL_RI)@l 1066 ori %r7,%r7,(PSL_EE|PSL_ME|PSL_RI)@l
1067 mtmsr %r7 1067 mtmsr %r7
1068 isync 1068 isync
1069 addi %r3,%r1,FRAME_TF 1069 addi %r3,%r1,FRAME_TF
1070/* Call the appropriate syscall handler: */ 1070/* Call the appropriate syscall handler: */
1071#if 0 
1072 GET_CPUINFO(%r4) 
1073 ldptr %r4,CI_CURLWP(%r4) 
1074 ldptr %r4,L_PROC(%r4) 
1075#else 
1076 ldptr %r4,L_PROC(%r13) 1071 ldptr %r4,L_PROC(%r13)
1077#endif 
1078 ldptr %r4,P_MD_SYSCALL(%r4) 1072 ldptr %r4,P_MD_SYSCALL(%r4)
1079 mtctr %r4 1073 mtctr %r4
1080 bctrl 1074 bctrl
1081_C_LABEL(sctrapexit): 1075_C_LABEL(sctrapexit):
1082 b trapexit 1076 b trapexit
1083 1077
1084/* 1078/*
1085 * External interrupt second level handler 1079 * External interrupt second level handler
1086 */ 1080 */
1087/* 1081/*
1088 * INTR_SETUP assumes: 1082 * INTR_SETUP assumes:
1089 * SPRG1 SP (%r1) 1083 * SPRG1 SP (%r1)
1090 * savearea r28-r31 1084 * savearea r28-r31