Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jun 2002 13:37:24 -0700 (PDT)
From:      Julian Elischer <julian@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 13170 for review
Message-ID:  <200206192037.g5JKbOJ92925@freefall.freebsd.org>

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

Change 13170 by julian@julian_ref on 2002/06/19 13:36:35

	this test program matches the new API/ABI

Affected files ...

... //depot/projects/kse/bin/ksetest/kse_threads_test.c#9 edit

Differences ...

==== //depot/projects/kse/bin/ksetest/kse_threads_test.c#9 (text+ko) ====

@@ -1,3 +1,4 @@
+#define _KERNEL
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -52,7 +53,7 @@
 /*************************************************************
  * Globals
  **************************************************************/
-struct per_kse *first_kse; /* for NOW cheat and make it global */
+struct per_kse first_kse; /* for NOW cheat and make it global */
 TAILQ_HEAD(, user_thread) runqueue = TAILQ_HEAD_INITIALIZER(runqueue);
 /*************************************************************
  * Implementation parameters
@@ -91,7 +92,7 @@
 {
 	struct user_thread *thread;
 	struct thread_mailbox *completed;
-	struct per_kse *ksedata = ke_mbox->kmbx_UTS_handle;
+	struct per_kse *ksedata;
 	int done = 0;	
 
 	/**********************************/
@@ -99,6 +100,7 @@
 	/**********************************/
 	/**********************************/
 
+	ksedata = ke_mbox->kmbx_UTS_handle;
 	/* If there are returned syscall threads, put them on the run queue */
 	if ((completed = ke_mbox->kmbx_completed_threads)) {
 		ke_mbox->kmbx_completed_threads = NULL;
@@ -136,13 +138,11 @@
 	int err;
 
 	newstack = malloc(K_STACKSIZE);
-	user_UTS_info = malloc(sizeof (struct per_kse));
-	bzero(user_UTS_info, sizeof (struct per_kse));
-	mboxaddr = &user_UTS_info->mbox;
+	mboxaddr = &ksedata->mbox;
 	mboxaddr->kmbx_stackbase = newstack;
 	mboxaddr->kmbx_stacksize = K_STACKSIZE;
 	mboxaddr->kmbx_upcall = &UTS;
-	mboxaddr->kmbx_UTS_handle = newstack;
+	mboxaddr->kmbx_UTS_handle = ksedata;
 	err = kse_new(mboxaddr, newgroup);
 	return(err);
 }
@@ -252,10 +252,10 @@
 	runq_insert( makethread(&thread2_code, 0, NULL));
 
 	/* and one which we will run ourself */
-	first_kse->curthread = makethread(&thread3_code, 0, NULL);
+	first_kse.curthread = makethread(&thread3_code, 0, NULL);
 
 	/* start two KSEs in different KSEGRPs */
-	if (startkse(first_kse)) {
+	if (startkse(&first_kse)) {
 		perror("failed to start KSE");
 		exit(1);
 	}
@@ -265,7 +265,7 @@
 
 	/* we are a thread, start the ball rolling */
 	/* let the kernel know we are it */
-	first_kse->mbox.kmbx_current_thread = &first_kse->curthread->mbox;
+	first_kse.mbox.kmbx_current_thread = &first_kse.curthread->mbox;
 	thread3_code(NULL);
 	return 0;
 }

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?200206192037.g5JKbOJ92925>