diff options
author | jake <jake@FreeBSD.org> | 2001-09-30 18:42:56 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2001-09-30 18:42:56 +0000 |
commit | de1928a0bc09906d2f0199a21ae8209f505c8f76 (patch) | |
tree | 967546b22b27e0fad917a4a16732be09de507c9f | |
parent | 327570ce60687a04845debeff23fa2d4517686b6 (diff) | |
download | FreeBSD-src-de1928a0bc09906d2f0199a21ae8209f505c8f76.zip FreeBSD-src-de1928a0bc09906d2f0199a21ae8209f505c8f76.tar.gz |
Don't overflow the ktr buffer <gulp>.
-rw-r--r-- | sys/sparc64/include/ktr.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/sparc64/include/ktr.h b/sys/sparc64/include/ktr.h index 4b8e7df..7a48503 100644 --- a/sys/sparc64/include/ktr.h +++ b/sys/sparc64/include/ktr.h @@ -47,6 +47,7 @@ /* * XXX doesn't do timestamp or ktr_cpu. + * XXX could really use another register. */ #define ATR(desc, r1, r2, r3, l1, l2) \ .sect .rodata ; \ @@ -55,6 +56,9 @@ l1 ## : .asciz desc ; \ set ktr_idx, r1 ; \ lduw [r1], r2 ; \ l2 ## : add r2, 1, r3 ; \ + set KTR_ENTRIES - 1, r1 ; \ + and r3, r1, r3 ; \ + set ktr_idx, r1 ; \ casa [r1] ASI_N, r2, r3 ; \ cmp r2, r3 ; \ bne %icc, l2 ## b ; \ |