Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jun 2002 17:15:28 -0700 (PDT)
From:      Julian Elischer <julian@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 12950 for review
Message-ID:  <200206150015.g5F0FS795389@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=12950

Change 12950 by julian@julian_jules1 on 2002/06/14 17:15:07

	 The upcall needs an argument now.

Affected files ...

... //depot/projects/kse/sys/i386/i386/pmap.c#36 edit
... //depot/projects/kse/sys/i386/i386/vm_machdep.c#51 edit
... //depot/projects/kse/sys/kern/subr_trap.c#64 edit
... //depot/projects/kse/sys/sys/kse.h#12 edit
... //depot/projects/kse/sys/sys/proc.h#110 edit

Differences ...

==== //depot/projects/kse/sys/i386/i386/pmap.c#36 (text+ko) ====

@@ -1130,16 +1130,6 @@
 #else
 	kmem_free(kernel_map, ks, KSTACK_PAGES * PAGE_SIZE);
 #endif
-
-	/*
-	 * If the thread got swapped out some of its KSTACK might have gotten
-	 * swapped.  Just get rid of the object to clean up the swap use
-	 * proactively.  NOTE! might block waiting for paging I/O to complete.
-	 */
-	if (ksobj->type == OBJT_SWAP) {
-		td->td_kstack_obj = NULL;
-		vm_object_deallocate(ksobj);
-	}
 	vm_object_deallocate(ksobj);
 	td->td_kstack_obj = NULL; /* play it safe */
 }

==== //depot/projects/kse/sys/i386/i386/vm_machdep.c#51 (text+ko) ====

@@ -391,11 +391,13 @@
 	 pcb2->pcb_ext = NULL;
 }
 
+#if 0
 /*
  * Set the return value for returning upcalls.
  * We should be able to do this ahead of time in cpu_save_upcall().
  * doing it once there instead of N times in the upcall path
  */
+
 void
 cpu_set_retval(struct thread *td, int retval, int aux, int success)
 {
@@ -409,6 +411,15 @@
 	else
 		frame->tf_eflags |= PSL_C;	/* error */
 }
+#endif
+
+void
+cpu_set_args(struct thread *td, struct *kse) 
+{
+	char * sp = ke->ke_frame->tf_esp;
+
+	suword(ke->ke_frame->tf_esp - sizeof(void *), ke->ke_mailbox);
+}
 
 void
 cpu_free_kse_mdstorage(struct kse *kse)

==== //depot/projects/kse/sys/kern/subr_trap.c#64 (text+ko) ====

@@ -213,10 +213,10 @@
 			bcopy(ke->ke_frame, frame, sizeof(struct trapframe));
 
 			/*
-			 * Decide what we are returning to the user
-			 * upcall returns 0, no error, (no aux?).
+			 * Decide what we are sending to the user
+			 * upcall sets one argument. The address of the mbox.
 			 */
-			cpu_set_retval(td, 0, 1, 1);
+			cpu_set_args(td, ke);
 
 			/*
 			 * There is no more work to do and we are going to ride

==== //depot/projects/kse/sys/sys/kse.h#12 (text+ko) ====

@@ -60,9 +60,7 @@
  */
 struct kse_mailbox 
 {
-	/*void (*kmbx_upcall)(struct kse_mailbox *mbx); */
 	kse_fn_t	*kmbx_upcall;
-int x;
 	char *kmbx_stackbase;
 	unsigned long int kmbx_stacksize;
 	struct thread_mailbox *kmbx_current_thread;

==== //depot/projects/kse/sys/sys/proc.h#110 (text+ko) ====

@@ -813,7 +813,7 @@
 int	cpu_export_context(struct thread *td);
 void	cpu_free_kse_mdstorage(struct kse *kse);
 void	cpu_save_upcall(struct thread *td, struct kse *newkse);
-void	cpu_set_retval(struct thread *, int, int, int);
+void	cpu_set_args(struct thread *, struct kse *);
 void	cpu_set_upcall(struct thread *td, void *pcb);
 void	cpu_thread_exit(struct thread *);
 void	cpu_thread_setup(struct thread *td);

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206150015.g5F0FS795389>