Module Name: src Committed By: matt Date: Sun Aug 11 02:53:18 UTC 2013
Modified Files: src/sys/arch/arm/arm: bcopyinout_xscale.S Log Message: fix conditional instructions to conform to unified syntax use push/pop use RET/RETc To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/arm/bcopyinout_xscale.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/arm/bcopyinout_xscale.S diff -u src/sys/arch/arm/arm/bcopyinout_xscale.S:1.7 src/sys/arch/arm/arm/bcopyinout_xscale.S:1.8 --- src/sys/arch/arm/arm/bcopyinout_xscale.S:1.7 Sun Jan 18 01:19:32 2009 +++ src/sys/arch/arm/arm/bcopyinout_xscale.S Sun Aug 11 02:53:18 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bcopyinout_xscale.S,v 1.7 2009/01/18 01:19:32 bjh21 Exp $ */ +/* $NetBSD: bcopyinout_xscale.S,v 1.8 2013/08/11 02:53:18 matt Exp $ */ /* * Copyright 2003 Wasabi Systems, Inc. @@ -35,7 +35,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -RCSID("$NetBSD: bcopyinout_xscale.S,v 1.7 2009/01/18 01:19:32 bjh21 Exp $") +RCSID("$NetBSD: bcopyinout_xscale.S,v 1.8 2013/08/11 02:53:18 matt Exp $") .text .align 0 @@ -50,9 +50,9 @@ RCSID("$NetBSD: bcopyinout_xscale.S,v 1. ENTRY(copyin) cmp r2, #0x00 movle r0, #0x00 - movle pc, lr /* Bail early if length is <= 0 */ + RETc(le) /* Bail early if length is <= 0 */ - stmfd sp!, {r10-r11, lr} + push {r10-r11, lr} GET_CURPCB(r10) @@ -63,14 +63,16 @@ ENTRY(copyin) bl .Lcopyin_guts str r11, [r10, #PCB_ONFAULT] mov r0, #0x00 - ldmfd sp!, {r10-r11, pc} + pop {r10-r11, lr} + RET .Lcopyin_fault: str r11, [r10, #PCB_ONFAULT] cmp r3, #0x00 - ldmgtfd sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ - ldmltfd sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */ - ldmfd sp!, {r10-r11, pc} + popgt {r4-r7} /* r3 > 0 Restore r4-r7 */ + poplt {r4-r9} /* r3 < 0 Restore r4-r9 */ + pop {r10-r11, lr} + RET .Lcopyin_guts: pld [r0] @@ -91,7 +93,7 @@ ENTRY(copyin) ldrbt ip, [r0], #0x01 strb ip, [r1], #0x01 cmp r2, #0x00 /* All done? */ - moveq pc, lr + RETc(eq) /* Destination buffer is now word aligned */ .Lcopyin_wordaligned: @@ -102,8 +104,8 @@ ENTRY(copyin) /* Quad-align the destination buffer */ tst r1, #0x07 /* Already quad aligned? */ - ldrnet ip, [r0], #0x04 - stmfd sp!, {r4-r9} /* Free up some registers */ + ldrtne ip, [r0], #0x04 + push {r4-r9} /* Free up some registers */ mov r3, #-1 /* Signal restore r4-r9 */ tst r1, #0x07 /* XXX: bug work-around */ subne r2, r2, #0x04 @@ -172,8 +174,8 @@ ENTRY(copyin) .Lcopyin_w_lessthan128: adds r2, r2, #0x80 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} - moveq pc, lr /* Return now if done */ + popeq {r4-r9} + RETc(eq) /* Return now if done */ subs r2, r2, #0x20 blt .Lcopyin_w_lessthan32 @@ -197,8 +199,8 @@ ENTRY(copyin) .Lcopyin_w_lessthan32: adds r2, r2, #0x20 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} - moveq pc, lr /* Return now if done */ + popeq {r4-r9} + RETc(eq) /* Return now if done */ and r4, r2, #0x18 rsb r5, r4, #0x18 @@ -225,24 +227,24 @@ ENTRY(copyin) strd r4, [r1], #0x08 /* Less than 8 bytes remaining */ - ldmfd sp!, {r4-r9} - moveq pc, lr /* Return now if done */ + pop {r4-r9} + RETc(eq) /* Return now if done */ mov r3, #0x00 .Lcopyin_w_less_than8: subs r2, r2, #0x04 - ldrget ip, [r0], #0x04 + ldrtge ip, [r0], #0x04 strge ip, [r1], #0x04 - moveq pc, lr /* Return now if done */ + RETc(eq) /* Return now if done */ addlt r2, r2, #0x04 ldrbt ip, [r0], #0x01 cmp r2, #0x02 - ldrgebt r2, [r0], #0x01 + ldrbtge r2, [r0], #0x01 strb ip, [r1], #0x01 - ldrgtbt ip, [r0] - strgeb r2, [r1], #0x01 - strgtb ip, [r1] - mov pc, lr + ldrbtgt ip, [r0] + strbge r2, [r1], #0x01 + strbgt ip, [r1] + RETc(eq) /* * At this point, it has not been possible to word align both buffers. @@ -250,7 +252,7 @@ ENTRY(copyin) * (r0) is not. */ .Lcopyin_bad_align: - stmfd sp!, {r4-r7} + push {r4-r7} mov r3, #0x01 bic r0, r0, #0x03 cmp ip, #2 @@ -296,8 +298,8 @@ ENTRY(copyin) bge .Lcopyin_bad1_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} - moveq pc, lr /* Return now if done */ + popeq {r4-r7} + RETc(eq) /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x03 blt .Lcopyin_l4 @@ -357,8 +359,8 @@ ENTRY(copyin) bge .Lcopyin_bad2_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} - moveq pc, lr /* Return now if done */ + popeq {r4-r7} + RETc(eq) /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x02 blt .Lcopyin_l4 @@ -418,8 +420,8 @@ ENTRY(copyin) bge .Lcopyin_bad3_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} - moveq pc, lr /* Return now if done */ + popeq {r4-r7} + RETc(eq) /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x01 blt .Lcopyin_l4 @@ -442,10 +444,10 @@ ENTRY(copyin) sub r0, r0, #0x01 .Lcopyin_l4: - ldmfd sp!, {r4-r7} + pop {r4-r7} mov r3, #0x00 adds r2, r2, #0x04 - moveq pc, lr + RETc(eq) .Lcopyin_l4_2: rsbs r2, r2, #0x03 addne pc, pc, r2, lsl #3 @@ -456,7 +458,7 @@ ENTRY(copyin) strb ip, [r1], #0x01 ldrbt ip, [r0] strb ip, [r1] - mov pc, lr + RET /* @@ -469,9 +471,9 @@ ENTRY(copyin) ENTRY(copyout) cmp r2, #0x00 movle r0, #0x00 - movle pc, lr /* Bail early if length is <= 0 */ + RETc(le) /* Bail early if length is <= 0 */ - stmfd sp!, {r10-r11, lr} + push {r10-r11, lr} GET_CURPCB(r10) @@ -482,14 +484,16 @@ ENTRY(copyout) bl .Lcopyout_guts str r11, [r10, #PCB_ONFAULT] mov r0, #0x00 - ldmfd sp!, {r10-r11, pc} + pop {r10-r11, lr} + RET .Lcopyout_fault: str r11, [r10, #PCB_ONFAULT] cmp r3, #0x00 - ldmgtfd sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ - ldmltfd sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */ - ldmfd sp!, {r10-r11, pc} + popgt {r4-r7} /* r3 > 0 Restore r4-r7 */ + poplt {r4-r9} /* r3 < 0 Restore r4-r9 */ + pop {r10-r11, lr} + RET .Lcopyout_guts: pld [r0] @@ -510,7 +514,7 @@ ENTRY(copyout) ldrb ip, [r0], #0x01 strbt ip, [r1], #0x01 cmp r2, #0x00 /* All done? */ - moveq pc, lr + RETc(eq) /* Destination buffer is now word aligned */ .Lcopyout_wordaligned: @@ -522,11 +526,11 @@ ENTRY(copyout) /* Quad-align the destination buffer */ tst r1, #0x07 /* Already quad aligned? */ ldrne ip, [r0], #0x04 - stmfd sp!, {r4-r9} /* Free up some registers */ + push {r4-r9} /* Free up some registers */ mov r3, #-1 /* Signal restore r4-r9 */ tst r1, #0x07 /* XXX: bug work-around */ subne r2, r2, #0x04 - strnet ip, [r1], #0x04 + strtne ip, [r1], #0x04 /* Destination buffer quad aligned, source is word aligned */ subs r2, r2, #0x80 @@ -607,8 +611,8 @@ ENTRY(copyout) .Lcopyout_w_lessthan128: adds r2, r2, #0x80 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} - moveq pc, lr /* Return now if done */ + popeq {r4-r9} + RETc(eq) /* Return now if done */ subs r2, r2, #0x20 blt .Lcopyout_w_lessthan32 @@ -636,8 +640,8 @@ ENTRY(copyout) .Lcopyout_w_lessthan32: adds r2, r2, #0x20 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} - moveq pc, lr /* Return now if done */ + popeq {r4-r9} + RETc(eq) /* Return now if done */ and r4, r2, #0x18 rsb r5, r4, #0x18 @@ -664,24 +668,24 @@ ENTRY(copyout) strt r5, [r1], #0x04 /* Less than 8 bytes remaining */ - ldmfd sp!, {r4-r9} - moveq pc, lr /* Return now if done */ + pop {r4-r9} + RETc(eq) /* Return now if done */ mov r3, #0x00 .Lcopyout_w_less_than8: subs r2, r2, #0x04 ldrge ip, [r0], #0x04 - strget ip, [r1], #0x04 - moveq pc, lr /* Return now if done */ + strtge ip, [r1], #0x04 + RETc(eq) /* Return now if done */ addlt r2, r2, #0x04 ldrb ip, [r0], #0x01 cmp r2, #0x02 - ldrgeb r2, [r0], #0x01 + ldrbge r2, [r0], #0x01 strbt ip, [r1], #0x01 - ldrgtb ip, [r0] - strgebt r2, [r1], #0x01 - strgtbt ip, [r1] - mov pc, lr + ldrbgt ip, [r0] + strbtge r2, [r1], #0x01 + strbtgt ip, [r1] + RET /* * At this point, it has not been possible to word align both buffers. @@ -689,7 +693,7 @@ ENTRY(copyout) * (r0) is not. */ .Lcopyout_bad_align: - stmfd sp!, {r4-r7} + push {r4-r7} mov r3, #0x01 bic r0, r0, #0x03 cmp ip, #2 @@ -735,8 +739,8 @@ ENTRY(copyout) bge .Lcopyout_bad1_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} - moveq pc, lr /* Return now if done */ + popeq {r4-r7} + RETc(eq) /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x03 blt .Lcopyout_l4 @@ -796,8 +800,8 @@ ENTRY(copyout) bge .Lcopyout_bad2_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} - moveq pc, lr /* Return now if done */ + popeq {r4-r7} + RETc(eq) /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x02 blt .Lcopyout_l4 @@ -857,8 +861,8 @@ ENTRY(copyout) bge .Lcopyout_bad3_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} - moveq pc, lr /* Return now if done */ + popeq {r4-r7} + RETc(eq) /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x01 blt .Lcopyout_l4 @@ -881,10 +885,10 @@ ENTRY(copyout) sub r0, r0, #0x01 .Lcopyout_l4: - ldmfd sp!, {r4-r7} + pop {r4-r7} mov r3, #0x00 adds r2, r2, #0x04 - moveq pc, lr + RETc(eq) .Lcopyout_l4_2: rsbs r2, r2, #0x03 addne pc, pc, r2, lsl #3 @@ -895,7 +899,7 @@ ENTRY(copyout) strbt ip, [r1], #0x01 ldrb ip, [r0] strbt ip, [r1] - mov pc, lr + RET /* @@ -908,9 +912,9 @@ ENTRY(copyout) ENTRY(kcopy) cmp r2, #0x00 movle r0, #0x00 - movle pc, lr /* Bail early if length is <= 0 */ + RETc(le) /* Bail early if length is <= 0 */ - stmfd sp!, {r10-r11, lr} + push {r10-r11, lr} GET_CURPCB(r10) @@ -921,14 +925,16 @@ ENTRY(kcopy) bl .Lkcopy_guts str r11, [r10, #PCB_ONFAULT] mov r0, #0x00 - ldmfd sp!, {r10-r11, pc} + pop {r10-r11, lr} + RET .Lkcopy_fault: str r11, [r10, #PCB_ONFAULT] cmp r3, #0x00 - ldmgtfd sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ - ldmltfd sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */ - ldmfd sp!, {r10-r11, pc} + popgt {r4-r7} /* r3 > 0 Restore r4-r7 */ + poplt {r4-r9} /* r3 < 0 Restore r4-r9 */ + pop {r10-r11, lr} + RET .Lkcopy_guts: pld [r0] @@ -949,7 +955,7 @@ ENTRY(kcopy) ldrb ip, [r0], #0x01 strb ip, [r1], #0x01 cmp r2, #0x00 /* All done? */ - moveq pc, lr + RETc(eq) /* Destination buffer is now word aligned */ .Lkcopy_wordaligned: @@ -961,7 +967,7 @@ ENTRY(kcopy) /* Quad-align the destination buffer */ tst r1, #0x07 /* Already quad aligned? */ ldrne ip, [r0], #0x04 - stmfd sp!, {r4-r9} /* Free up some registers */ + push {r4-r9} /* Free up some registers */ mov r3, #-1 /* Signal restore r4-r9 */ subne r2, r2, #0x04 strne ip, [r1], #0x04 @@ -1029,8 +1035,8 @@ ENTRY(kcopy) .Lkcopy_w_lessthan128: adds r2, r2, #0x80 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} - moveq pc, lr /* Return now if done */ + popeq {r4-r9} + RETc(eq) /* Return now if done */ subs r2, r2, #0x20 blt .Lkcopy_w_lessthan32 @@ -1054,8 +1060,8 @@ ENTRY(kcopy) .Lkcopy_w_lessthan32: adds r2, r2, #0x20 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} - moveq pc, lr /* Return now if done */ + popeq {r4-r9} + RETc(eq) /* Return now if done */ and r4, r2, #0x18 rsb r5, r4, #0x18 @@ -1082,24 +1088,24 @@ ENTRY(kcopy) strd r4, [r1], #0x08 /* Less than 8 bytes remaining */ - ldmfd sp!, {r4-r9} - moveq pc, lr /* Return now if done */ + pop {r4-r9} + RETc(eq) /* Return now if done */ mov r3, #0x00 .Lkcopy_w_less_than8: subs r2, r2, #0x04 ldrge ip, [r0], #0x04 strge ip, [r1], #0x04 - moveq pc, lr /* Return now if done */ + RETc(eq) /* Return now if done */ addlt r2, r2, #0x04 ldrb ip, [r0], #0x01 cmp r2, #0x02 - ldrgeb r2, [r0], #0x01 + ldrbge r2, [r0], #0x01 strb ip, [r1], #0x01 - ldrgtb ip, [r0] - strgeb r2, [r1], #0x01 - strgtb ip, [r1] - mov pc, lr + ldrbgt ip, [r0] + strbge r2, [r1], #0x01 + strbgt ip, [r1] + RET /* * At this point, it has not been possible to word align both buffers. @@ -1107,7 +1113,7 @@ ENTRY(kcopy) * (r0) is not. */ .Lkcopy_bad_align: - stmfd sp!, {r4-r7} + push {r4-r7} mov r3, #0x01 bic r0, r0, #0x03 cmp ip, #2 @@ -1153,8 +1159,8 @@ ENTRY(kcopy) bge .Lkcopy_bad1_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} - moveq pc, lr /* Return now if done */ + popeq {r4-r7} + RETc(eq) /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x03 blt .Lkcopy_bad_endgame @@ -1214,8 +1220,8 @@ ENTRY(kcopy) bge .Lkcopy_bad2_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} - moveq pc, lr /* Return now if done */ + popeq {r4-r7} + RETc(eq) /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x02 blt .Lkcopy_bad_endgame @@ -1275,8 +1281,8 @@ ENTRY(kcopy) bge .Lkcopy_bad3_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} - moveq pc, lr /* Return now if done */ + popeq {r4-r7} + RETc(eq) /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x01 blt .Lkcopy_bad_endgame @@ -1299,10 +1305,10 @@ ENTRY(kcopy) sub r0, r0, #0x01 .Lkcopy_bad_endgame: - ldmfd sp!, {r4-r7} + pop {r4-r7} mov r3, #0x00 adds r2, r2, #0x04 - moveq pc, lr + RETc(eq) .Lkcopy_bad_endgame2: rsbs r2, r2, #0x03 addne pc, pc, r2, lsl #3 @@ -1313,4 +1319,4 @@ ENTRY(kcopy) strb ip, [r1], #0x01 ldrb ip, [r0] strb ip, [r1] - mov pc, lr + RET