diff -Npur gnumach.old/ChangeLog gnumach.new/ChangeLog
--- gnumach.old/ChangeLog	2006-04-02 07:48:52.000000000 -0300
+++ gnumach.new/ChangeLog	2006-04-06 00:14:56.000000000 -0300
@@ -1,3 +1,15 @@
+2006-04-05  Leonardo Lopes Pereira  <leonardolopespereira@gmail.com>
+
+	* i386/Makerules.in: Remove the definition of CONTINUATIONS.
+	* ipc/mach_msg.c: Adopt all users of CONTINUATIONS as if it were
+	always defined.
+	* kern/eventcount.c: Likewise.
+	* kern/ipc_sched.c: Likewise.
+	* kern/syscall_subr.c: Likewise.
+	* vm/vm_fault.c: Likewise.
+	* vm/vm_pageout.c: Likewise.
+	* vm/vm_resident.c: Likewise.
+
 2006-04-02  Thomas Schwinge  <tschwinge@gnu.org>
 
 	* Makerules.in (%_user.c, %_server.c): Those are `.PRECIOUS'.
diff -Npur gnumach.old/i386/Makerules.in gnumach.new/i386/Makerules.in
--- gnumach.old/i386/Makerules.in	2006-03-21 20:22:18.000000000 -0300
+++ gnumach.new/i386/Makerules.in	2006-04-06 00:14:56.000000000 -0300
@@ -28,7 +28,7 @@ include $(abs_top_builddir)/$(systype)/l
 
 
 # Some of the i386-specific code checks for these.
-DEFINES += -DCONTINUATIONS -D__ELF__ -Di386 $(DEFS-$(systype))
+DEFINES += -D__ELF__ -Di386 $(DEFS-$(systype))
 
 # Arrange for a suitable load address.
 LDFLAGS-kernel += -Ttext 100000
diff -Npur gnumach.old/ipc/mach_msg.c gnumach.new/ipc/mach_msg.c
--- gnumach.old/ipc/mach_msg.c	2006-03-20 08:31:36.000000000 -0300
+++ gnumach.new/ipc/mach_msg.c	2006-04-06 00:14:56.000000000 -0300
@@ -63,10 +63,6 @@
 
 extern void exception_raise_continue();
 extern void exception_raise_continue_fast();
-#ifndef CONTINUATIONS
-#define mach_msg_receive_continue	0
-#define msg_receive_continue		0
-#endif
 
 /*
  *	Routine:	mach_msg_send
@@ -198,7 +194,6 @@ mach_msg_receive(msg, option, rcv_size, 
 		return mr;
 	/* hold ref for object; mqueue is locked */
 
-#ifdef CONTINUATIONS
 	/*
 	 *	ipc_mqueue_receive may not return, because if we block
 	 *	then our kernel stack may be discarded.  So we save
@@ -212,7 +207,6 @@ mach_msg_receive(msg, option, rcv_size, 
 	self->ith_notify = notify;
 	self->ith_object = object;
 	self->ith_mqueue = mqueue;
-#endif
 
 	if (option & MACH_RCV_LARGE) {
 		mr = ipc_mqueue_receive(mqueue, option & MACH_RCV_TIMEOUT,
@@ -278,7 +272,6 @@ mach_msg_receive(msg, option, rcv_size, 
 	return ipc_kmsg_put(msg, kmsg, kmsg->ikm_header.msgh_size);
 }
 
-#ifdef CONTINUATIONS
 /*
  *	Routine:	mach_msg_receive_continue
  *	Purpose:
@@ -376,7 +369,6 @@ mach_msg_receive_continue()
 	thread_syscall_return(mr);
 	/*NOTREACHED*/
 }
-#endif /* CONTINUATIONS */
 
 /*
  *	Routine:	mach_msg_trap [mach trap]
@@ -400,7 +392,6 @@ mach_msg_trap(msg, option, send_size, rc
 {
 	mach_msg_return_t mr;
 
-#ifdef	CONTINUATIONS
 	/* first check for common cases */
 
 	if (option == (MACH_SEND_MSG|MACH_RCV_MSG)) {
@@ -1653,7 +1644,6 @@ mach_msg_trap(msg, option, send_size, rc
 		thread_syscall_return(MACH_MSG_SUCCESS);
 		/*NOTREACHED*/
 	}
-#endif	/* CONTINUATIONS */
 
 	if (option & MACH_SEND_MSG) {
 		mr = mach_msg_send(msg, option, send_size,
@@ -1672,7 +1662,6 @@ mach_msg_trap(msg, option, send_size, rc
 	return MACH_MSG_SUCCESS;
 }
 
-#ifdef CONTINUATIONS
 /*
  *	Routine:	mach_msg_continue
  *	Purpose:
@@ -1775,7 +1764,6 @@ mach_msg_interrupt(thread)
 	thread->swap_func = thread_exception_return;
 	return TRUE;
 }
-#endif /* CONTINUATIONS */
 
 #if	MACH_IPC_COMPAT
 
@@ -1947,7 +1935,6 @@ msg_receive_trap(msg, option, rcv_size, 
 		return msg_return_translate(mr);
 	/* hold ref for object; mqueue is locked */
 
-#ifdef CONTINUATIONS
 	/*
 	 *	ipc_mqueue_receive may not return, because if we block
 	 *	then our kernel stack may be discarded.  So we save
@@ -1961,7 +1948,6 @@ msg_receive_trap(msg, option, rcv_size, 
 	self->ith_timeout = (mach_msg_timeout_t) time_out;
 	self->ith_object = object;
 	self->ith_mqueue = mqueue;
-#endif /* CONTINUATIONS */
 
 	mr = ipc_mqueue_receive(mqueue,
 				(option & RCV_TIMEOUT) ?
@@ -2120,7 +2106,6 @@ msg_rpc_trap(msg, option, send_size, rcv
 	imq_lock(mqueue);
 	ip_unlock(reply);
 
-#ifdef CONTINUATIONS
 	/*
 	 *	ipc_mqueue_receive may not return, because if we block
 	 *	then our kernel stack may be discarded.  So we save
@@ -2134,7 +2119,6 @@ msg_rpc_trap(msg, option, send_size, rcv
 	self->ith_timeout = (mach_msg_timeout_t) rcv_timeout;
 	self->ith_object = (ipc_object_t) reply;
 	self->ith_mqueue = mqueue;
-#endif /* CONTINUATIONS */
 
 	mr = ipc_mqueue_receive(mqueue,
 				(option & RCV_TIMEOUT) ?
@@ -2170,7 +2154,6 @@ msg_rpc_trap(msg, option, send_size, rcv
 	return msg_return_translate(mr);
 }
 
-#ifdef CONTINUATIONS
 /*
  *	Routine:	msg_receive_continue
  *	Purpose:
@@ -2230,6 +2213,5 @@ msg_receive_continue()
 	thread_syscall_return(msg_return_translate(mr));
 	/*NOTREACHED*/
 }
-#endif /* CONTINUATIONS */
 
 #endif	/* MACH_IPC_COMPAT */
diff -Npur gnumach.old/kern/eventcount.c gnumach.new/kern/eventcount.c
--- gnumach.old/kern/eventcount.c	1997-02-25 18:28:22.000000000 -0300
+++ gnumach.new/kern/eventcount.c	2006-04-06 00:14:56.000000000 -0300
@@ -125,7 +125,6 @@ void evc_notify_abort(thread_t thread)
     splx(s);
 }
 
-#ifdef CONTINUATIONS
 /*
  * Just so that we return success, and give
  * up the stack while blocked
@@ -136,9 +135,6 @@ evc_continue(void)
 	thread_syscall_return(KERN_SUCCESS);
 	/* NOTREACHED */
 }
-#else /* not CONTINUATIONS */
-#define evc_continue 0
-#endif /* not CONTINUATIONS */
 
 /*
  * User-trappable
diff -Npur gnumach.old/kern/ipc_sched.c gnumach.new/kern/ipc_sched.c
--- gnumach.old/kern/ipc_sched.c	1997-02-25 18:28:23.000000000 -0300
+++ gnumach.new/kern/ipc_sched.c	2006-04-06 00:14:56.000000000 -0300
@@ -168,7 +168,6 @@ thread_will_wait_with_timeout(
 #define	check_bound_processor(thread)	TRUE
 #endif	/* NCPUS > 1 */
 
-#ifdef CONTINUATIONS
 /*
  *	Routine:	thread_handoff
  *	Purpose:
@@ -284,4 +283,3 @@ thread_handoff(
 	counter_always(c_thread_handoff_hits++);
 	return TRUE;
 }
-#endif /* CONTINUATIONS */
diff -Npur gnumach.old/kern/syscall_subr.c gnumach.new/kern/syscall_subr.c
--- gnumach.old/kern/syscall_subr.c	2001-04-05 03:39:20.000000000 -0300
+++ gnumach.new/kern/syscall_subr.c	2006-04-06 00:14:56.000000000 -0300
@@ -68,7 +68,6 @@
 extern void thread_depress_priority();
 extern kern_return_t thread_depress_abort();
 
-#ifdef CONTINUATIONS
 void swtch_continue()
 {
 	register processor_t	myprocessor;
@@ -78,9 +77,6 @@ void swtch_continue()
 			      myprocessor->processor_set->runq.count > 0);
 	/*NOTREACHED*/
 }
-#else	/* not CONTINUATIONS */
-#define swtch_continue 0
-#endif	/* not CONTINUATIONS */
 
 boolean_t swtch()
 {
@@ -100,7 +96,6 @@ boolean_t swtch()
 	       myprocessor->processor_set->runq.count > 0);
 }
 
-#ifdef CONTINUATIONS
 void swtch_pri_continue()
 {
 	register thread_t	thread = current_thread();
@@ -113,9 +108,6 @@ void swtch_pri_continue()
 			      myprocessor->processor_set->runq.count > 0);
 	/*NOTREACHED*/
 }
-#else	/* not CONTINUATIONS */
-#define swtch_pri_continue 0
-#endif	/* not CONTINUATIONS */
 
 boolean_t  swtch_pri(pri)
 	int pri;
@@ -152,7 +144,6 @@ boolean_t  swtch_pri(pri)
 
 extern int hz;
 
-#ifdef CONTINUATIONS
 void thread_switch_continue()
 {
 	register thread_t	cur_thread = current_thread();
@@ -165,9 +156,6 @@ void thread_switch_continue()
 	thread_syscall_return(KERN_SUCCESS);
 	/*NOTREACHED*/
 }
-#else	/* not CONTINUATIONS */
-#define thread_switch_continue 0
-#endif	/* not CONTINUATIONS */
 
 /*
  *	thread_switch:
diff -Npur gnumach.old/teste gnumach.new/teste
--- gnumach.old/teste	1969-12-31 21:00:00.000000000 -0300
+++ gnumach.new/teste	2006-04-06 00:15:18.000000000 -0300
@@ -0,0 +1,8 @@
+rm -fr i386/Makerules.in.~1.1.2.2.~
+rm -fr ipc/mach_msg.c.~1.2.2.1.~
+rm -fr kern/eventcount.c.~1.1.1.1.~
+rm -fr kern/ipc_sched.c.~1.1.1.1.~
+rm -fr kern/syscall_subr.c.~1.2.~
+rm -fr vm/vm_fault.c.~1.3.~
+rm -fr vm/vm_pageout.c.~1.7.2.1.~
+rm -fr vm/vm_resident.c.~1.7.4.1.~
diff -Npur gnumach.old/vm/vm_fault.c gnumach.new/vm/vm_fault.c
--- gnumach.old/vm/vm_fault.c	2001-04-05 03:39:20.000000000 -0300
+++ gnumach.new/vm/vm_fault.c	2006-04-06 00:14:56.000000000 -0300
@@ -243,7 +243,6 @@ vm_fault_return_t vm_fault_page(first_ob
 	boolean_t	look_for_page;
 	vm_prot_t	access_required;
 
-#ifdef CONTINUATIONS
 	if (resume) {
 		register vm_fault_state_t *state =
 			(vm_fault_state_t *) current_thread()->ith_other;
@@ -257,10 +256,6 @@ vm_fault_return_t vm_fault_page(first_ob
 		access_required = state->vmfp_access;
 		goto after_thread_block;
 	}
-#else /* not CONTINUATIONS */
-	assert(continuation == 0);
-	assert(!resume);
-#endif /* not CONTINUATIONS */
 
 	vm_stat_sample(SAMPLED_PC_VM_FAULTS_ANY);
 	vm_stat.faults++;		/* needs lock XXX */
@@ -365,7 +360,6 @@ vm_fault_return_t vm_fault_page(first_ob
 
 				PAGE_ASSERT_WAIT(m, interruptible);
 				vm_object_unlock(object);
-#ifdef CONTINUATIONS
 				if (continuation != (void (*)()) 0) {
 					register vm_fault_state_t *state =
 						(vm_fault_state_t *) current_thread()->ith_other;
@@ -387,7 +381,6 @@ vm_fault_return_t vm_fault_page(first_ob
 					counter(c_vm_fault_page_block_busy_user++);
 					thread_block(continuation);
 				} else
-#endif /* CONTINUATIONS */
 				{
 					counter(c_vm_fault_page_block_busy_kernel++);
 					thread_block((void (*)()) 0);
@@ -1099,7 +1092,6 @@ vm_fault_return_t vm_fault_page(first_ob
     block_and_backoff:
 	vm_fault_cleanup(object, first_m);
 
-#ifdef CONTINUATIONS
 	if (continuation != (void (*)()) 0) {
 		register vm_fault_state_t *state =
 			(vm_fault_state_t *) current_thread()->ith_other;
@@ -1114,7 +1106,6 @@ vm_fault_return_t vm_fault_page(first_ob
 		counter(c_vm_fault_page_block_backoff_user++);
 		thread_block(continuation);
 	} else
-#endif /* CONTINUATIONS */
 	{
 		counter(c_vm_fault_page_block_backoff_kernel++);
 		thread_block((void (*)()) 0);
@@ -1148,7 +1139,6 @@ vm_fault_return_t vm_fault_page(first_ob
  *		and deallocated when leaving vm_fault.
  */
 
-#ifdef CONTINUATIONS
 void
 vm_fault_continue()
 {
@@ -1162,7 +1152,6 @@ vm_fault_continue()
 			TRUE, state->vmf_continuation);
 	/*NOTREACHED*/
 }
-#endif /* CONTINUATIONS */
 
 kern_return_t vm_fault(map, vaddr, fault_type, change_wiring,
 		       resume, continuation)
@@ -1186,7 +1175,6 @@ kern_return_t vm_fault(map, vaddr, fault
 	register
 	vm_page_t		m;	/* Fast access to result_page */
 
-#ifdef CONTINUATIONS
 	if (resume) {
 		register vm_fault_state_t *state =
 			(vm_fault_state_t *) current_thread()->ith_other;
@@ -1229,10 +1217,6 @@ kern_return_t vm_fault(map, vaddr, fault
 		current_thread()->ith_other = state;
 
 	}
-#else /* not CONTINUATIONS */
-	assert(continuation == 0);
-	assert(!resume);
-#endif /* not CONTINUATIONS */
 
     RetryFault: ;
 
@@ -1267,7 +1251,6 @@ kern_return_t vm_fault(map, vaddr, fault
 	object->ref_count++;
 	vm_object_paging_begin(object);
 
-#ifdef CONTINUATIONS
 	if (continuation != (void (*)()) 0) {
 		register vm_fault_state_t *state =
 			(vm_fault_state_t *) current_thread()->ith_other;
@@ -1294,7 +1277,6 @@ kern_return_t vm_fault(map, vaddr, fault
 				   &prot, &result_page, &top_page,
 				   FALSE, vm_fault_continue);
 	} else
-#endif /* CONTINUATIONS */
 	{
 		kr = vm_fault_page(object, offset, fault_type,
 				   (change_wiring && !wired), !change_wiring,
@@ -1323,7 +1305,6 @@ kern_return_t vm_fault(map, vaddr, fault
 			kr = KERN_SUCCESS;
 			goto done;
 		case VM_FAULT_MEMORY_SHORTAGE:
-#ifdef CONTINUATIONS
 			if (continuation != (void (*)()) 0) {
 				register vm_fault_state_t *state =
 					(vm_fault_state_t *) current_thread()->ith_other;
@@ -1342,7 +1323,6 @@ kern_return_t vm_fault(map, vaddr, fault
 
 				VM_PAGE_WAIT(vm_fault_continue);
 			} else
-#endif /* CONTINUATIONS */
 				VM_PAGE_WAIT((void (*)()) 0);
 			goto RetryFault;
 		case VM_FAULT_FICTITIOUS_SHORTAGE:
@@ -1508,7 +1488,6 @@ kern_return_t vm_fault(map, vaddr, fault
 #undef	RELEASE_PAGE
 
     done:
-#ifdef CONTINUATIONS
 	if (continuation != (void (*)()) 0) {
 		register vm_fault_state_t *state =
 			(vm_fault_state_t *) current_thread()->ith_other;
@@ -1517,7 +1496,6 @@ kern_return_t vm_fault(map, vaddr, fault
 		(*continuation)(kr);
 		/*NOTREACHED*/
 	}
-#endif /* CONTINUATIONS */
 
 	return(kr);
 }
diff -Npur gnumach.old/vm/vm_pageout.c gnumach.new/vm/vm_pageout.c
--- gnumach.old/vm/vm_pageout.c	2006-03-20 08:31:36.000000000 -0300
+++ gnumach.new/vm/vm_pageout.c	2006-04-06 00:14:56.000000000 -0300
@@ -677,18 +677,8 @@ void vm_pageout_scan()
 			thread_will_wait_with_timeout(current_thread(), msecs);
 			counter(c_vm_pageout_scan_block++);
 			thread_block(vm_pageout_scan_continue);
-#ifndef CONTINUATIONS
-			/*
-			 *	Unfortunately, we don't have call_continuation
-			 *	so we can't rely on tail-recursion.
-			 */
-
-			vm_pageout_scan_continue();
-			goto Restart;
-#else	/* CONTINUATIONS */
 			call_continuation(vm_pageout_scan_continue);
 			/*NOTREACHED*/
-#endif	/* CONTINUATIONS */
 		}
 
 		vm_pageout_inactive++;
@@ -887,10 +877,8 @@ void vm_pageout_scan_continue()
 	}
 	vm_page_unlock_queues();
 
-#ifdef	CONTINUATIONS
 	vm_pageout_continue();
 	/*NOTREACHED*/
-#endif	/* CONTINUATIONS */
 }
 
 /*
diff -Npur gnumach.old/vm/vm_resident.c gnumach.new/vm/vm_resident.c
--- gnumach.old/vm/vm_resident.c	2006-01-31 06:21:05.000000000 -0300
+++ gnumach.new/vm/vm_resident.c	2006-04-06 00:14:56.000000000 -0300
@@ -1200,10 +1200,6 @@ void vm_page_wait(
 	void (*continuation)(void))
 {
 
-#ifndef CONTINUATIONS
-	assert (continuation == 0);
-#endif
-
 	/*
 	 *	We can't use vm_page_free_reserved to make this
 	 *	determination.  Consider: some thread might
