re: Using %stick where available

matthew green <[email protected]>
Newsgroups gmane.os.netbsd.ports.sparc64
Message-ID <[email protected]>
mostly LGTM.

all the dancing in cpu_initclocks() and *tickintr_establish()
for curcpu() and primary CPU seems bogus.  all those code only
ever runs on the boot cpu.  this isn't your change, but your
change copies stuf that looked strange to me.  (the other thing
that sticks out about this code is the way it uses cpucpur()
without disabling kpreempt, but it doesn't matter yet..)

> @@ -3270,13 +3270,18 @@
>  	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! DEBUG
>  #endif
>  	/*
> -	 * If this is a %tick softint, clear it then call interrupt_vector.
> +	 * If this is a %tick or %stick softint, clear it then call
> +	 * interrupt_vector. Only one of them should be enabled at any given
> +	 * time.
>  	 */
>  	rd	SOFTINT, %g1
> -	btst	1, %g1
> +	mov	1, %g5
> +	sllx	%g5, 16, %g3
> +	or	%g5, %g3, %g5
> +	andcc	%g5, %g1, %g5

hmm, i think maybe this saves an insn here:

	sethi	%hi(1 << 16), %g5
	or	%g5, 1, %g5
	andcc	%g5, %g1, %g5

>  	bz,pt	%icc, 0f
>  	 sethi	%hi(CPUINFO_VA+CI_TICK_IH), %g3
> -	wr	%g0, 1, CLEAR_SOFTINT
> +	wr	%g0, %g5, CLEAR_SOFTINT
>  	ba,pt	%icc, setup_sparcintr
>  	 LDPTR	[%g3 + %lo(CPUINFO_VA+CI_TICK_IH)], %g5
>  0:

be nice if someone implemented the 10 year failure :)


.mrg.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.