[PATCH 10/20] powerpc/xmon: Factor out the oft-repeated setjmp logic

Paul Mackerras paulus at samba.org
Wed Oct 10 09:23:58 EST 2012


On Wed, Oct 10, 2012 at 01:20:37AM +1100, Michael Ellerman wrote:
> We have over 15 routines that implement essentially the same logic
> in terms of catching faults. Pull the logic out into two helper
> routines.
> 
> The pattern becomes:
> 
> 	if (start_bus_error_jump() == 0) {
> 		<do potentially faulting things>
> 
> 		end_bus_error_jump();
> 	} else {
> 		printf("Faulting thing faulted!\n");
> 	}

NAK...  think about how setjmp() works.  You can't return from the
function that called setjmp() while there is any possibility that
longjmp() could be called for the same jmp_buf.

Paul.


More information about the Linuxppc-dev mailing list