Module Name:    src
Committed By:   rin
Date:           Sat Sep 18 06:32:41 UTC 2021

Modified Files:
        src/sys/arch/sh3/sh3: cpu_in_cksum.S

Log Message:
Support __PIC__ build, in order to avoid text relocations for
/usr/tests/net/in_cksum/in_cksum.

Now, all the tests for in_cksum successfully pass for sh[34].

No binary changes for kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sh3/sh3/cpu_in_cksum.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/sh3/sh3/cpu_in_cksum.S
diff -u src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.6 src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.7
--- src/sys/arch/sh3/sh3/cpu_in_cksum.S:1.6	Sat Sep 18 06:31:46 2021
+++ src/sys/arch/sh3/sh3/cpu_in_cksum.S	Sat Sep 18 06:32:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_in_cksum.S,v 1.6 2021/09/18 06:31:46 rin Exp $	*/
+/*	$NetBSD: cpu_in_cksum.S,v 1.7 2021/09/18 06:32:41 rin Exp $	*/
 
 /*-
  * Copyright (c) 2000 SHIMIZU Ryo <r...@misakimix.org>
@@ -34,7 +34,7 @@
 #include <machine/asm.h>
 #include "assym.h"
 
-__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.S,v 1.6 2021/09/18 06:31:46 rin Exp $")
+__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.S,v 1.7 2021/09/18 06:32:41 rin Exp $")
 
 
 #define	reg_tmp0		r0
@@ -98,6 +98,7 @@ __KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum
  */
 ENTRY(cpu_in_cksum)
 	sts.l	pr,@-sp
+	PIC_PROLOGUE(.L_got)
 
 	tst	reg_len, reg_len
 	bt/s	mbuf_loop_done
@@ -222,6 +223,7 @@ mbuf_loop_done:
 
 in_cksum_return:
 	not	reg_sum,r0
+	PIC_EPILOGUE
 	lds.l	@sp+,pr
 	rts
 	 extu.w	r0,r0
@@ -233,15 +235,17 @@ out_of_mbufs:
 
 	mov.l	reg_sum,@-sp	/* save: call clobbered register */
 
-	jsr	@reg_tmp3
+1:	CALL	reg_tmp3
 	 mov	reg_tmp0,r4
 
 	bra	in_cksum_return
 	 mov.l	@sp+,reg_sum	/* restore */
 
 	.align 2
+.L_got:
+	PIC_GOT_DATUM
 .L_printf:
-	.long	_C_LABEL(printf)
+	CALL_DATUM(_C_LABEL(printf), 1b)
 
 	.align 2	/* mova target */
 .L_message_out_of_data:

Reply via email to