Make HW trap reflection more arch-independent
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 21 Jan 2016 19:44:08 +0000 (14:44 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 2 Feb 2016 22:43:52 +0000 (17:43 -0500)
commit6540e9c6f62269baaa59e9d603d45e890794fa6f
treef45c426b150a2e05c2f527df4bc7503f4a7fb65c
parentd93296b672901ea33d63b1289adb126d6f3fa926
Make HW trap reflection more arch-independent

This isn't perfect, since the list of traps is somewhat arch-dependent, but
it's a little better.  For the most part, we're probably only ever going to
handle certain common traps, and I'd like to avoid duplicate code.

If an architecture is unable to produce certain traps, then they can just
pick an unused trap number.  So long as they are all distinct, the switch
statement will be fine.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/parlib/include/riscv/trap.h
user/parlib/include/x86/trap.h
user/pthread/pthread.c