summaryrefslogtreecommitdiffstats
path: root/sys/arm
diff options
context:
space:
mode:
authorjb <jb@FreeBSD.org>2006-11-01 04:54:51 +0000
committerjb <jb@FreeBSD.org>2006-11-01 04:54:51 +0000
commitd2bd8073567b9878a0f047164ede93eea2930207 (patch)
tree4ca8e0db1a4d979ac84b80de999f6b12bfe9e7f3 /sys/arm
parent978ee47c81472fd20aa0071b93d9fe4c7c9bbd7e (diff)
downloadFreeBSD-src-d2bd8073567b9878a0f047164ede93eea2930207.zip
FreeBSD-src-d2bd8073567b9878a0f047164ede93eea2930207.tar.gz
Add a cnputs() function to write a string to the console with
a lock to prevent interspersed strings written from different CPUs at the same time. To avoid putting a buffer on the stack or having to malloc one, space is incorporated in the per-cpu structure. The buffer size if 128 bytes; chosen because it's the next power of 2 size up from 80 characters. String writes to the console are buffered up the end of the line or until the buffer fills. Then the buffer is flushed to all console devices. Existing low level console output via cnputc() is unaffected by this change. ithread calls to log() are also unaffected to avoid blocking those threads. A minor change to the behaviour in a panic situation is that console output will still be buffered, but won't be written to a tty as before. This should prevent interspersed panic output as a number of CPUs panic before we end up single threaded running ddb. Reviewed by: scottl, jhb MFC after: 2 weeks
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/arm/genassym.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/arm/arm/genassym.c b/sys/arm/arm/genassym.c
index b179e74..f61e1f7 100644
--- a/sys/arm/arm/genassym.c
+++ b/sys/arm/arm/genassym.c
@@ -69,6 +69,7 @@ ASSYM(PCB_R12, offsetof(struct pcb, un_32.pcb32_r12));
ASSYM(PCB_PC, offsetof(struct pcb, un_32.pcb32_pc));
ASSYM(PCB_SP, offsetof(struct pcb, un_32.pcb32_sp));
+ASSYM(PC_CONS_BUFR, offsetof(struct pcpu, pc_cons_bufr));
ASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb));
ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
ASSYM(M_LEN, offsetof(struct mbuf, m_len));
OpenPOWER on IntegriCloud