	.text
	.global	__trap0
__trap0:
	trap	0		# trap 0 returns result in r2, error code in r3
	cmpui	r3,1		# is error code zero?
	bc	.Lret		# yes, skip setting errno
	st	r3,@r0		# no, set errno
.Lret:
	jmp	lr		# return to caller
