Slimmer setjmps
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 12 Jun 2014 17:41:43 +0000 (10:41 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 12 Jun 2014 17:41:43 +0000 (10:41 -0700)
commit7879dc37e259fb9cd2bfc2e4195aa426608f946e
tree3ea69429c237f303bdba4c23203560a0dc5dc8cc
parentad10b25d2fcf82e46f5ab9b9b91db251f6dfe8d2
Slimmer setjmps

AFAIK, the returns_twice tells the compiler to not expect any
caller-saved registers to still be valid.  The handmade asm clobber
tells the compiler not to trust any callee-saved registers either.  The
compiler might be allowed to save and restore the registers across that
asm volatile, but it doesn't seem to do so.

The clobbering of the callee-saved registers was necessary; despite the
language of the returns_twice attribute, which does not make a
distinction between caller-saved and callee-saved.

In addition to faster waserrors, this leads to smaller errbufs, which
leads to kthreads using less stack space.  Ultimately, we'll be able to
go back to single-page kthread stacks.
kern/arch/riscv/setjmp.S
kern/arch/riscv/setjmp.h
kern/arch/x86/setjmp.h
kern/arch/x86/setjmp32.S
kern/arch/x86/setjmp64.S
kern/include/err.h
kern/include/ns.h
kern/include/setjmp.h