Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Feb 2010 16:19:15 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r203879 - projects/ppc64/sys/powerpc/booke
Message-ID:  <201002141619.o1EGJFxt021224@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Sun Feb 14 16:19:15 2010
New Revision: 203879
URL: http://svn.freebsd.org/changeset/base/203879

Log:
  A few steps toward making Book-E compile again.

Modified:
  projects/ppc64/sys/powerpc/booke/machdep.c
  projects/ppc64/sys/powerpc/booke/vm_machdep.c

Modified: projects/ppc64/sys/powerpc/booke/machdep.c
==============================================================================
--- projects/ppc64/sys/powerpc/booke/machdep.c	Sun Feb 14 16:18:25 2010	(r203878)
+++ projects/ppc64/sys/powerpc/booke/machdep.c	Sun Feb 14 16:19:15 2010	(r203879)
@@ -507,57 +507,6 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpu
 #endif
 }
 
-/* Set set up registers on exec. */
-void
-exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings)
-{
-	struct trapframe *tf;
-	struct ps_strings arginfo;
-
-	tf = trapframe(td);
-	bzero(tf, sizeof *tf);
-	tf->fixreg[1] = -roundup(-stack + 8, 16);
-
-	/*
-	 * XXX Machine-independent code has already copied arguments and
-	 * XXX environment to userland.  Get them back here.
-	 */
-	(void)copyin((char *)PS_STRINGS, &arginfo, sizeof(arginfo));
-
-	/*
-	 * Set up arguments for _start():
-	 *	_start(argc, argv, envp, obj, cleanup, ps_strings);
-	 *
-	 * Notes:
-	 *	- obj and cleanup are the auxilliary and termination
-	 *	  vectors.  They are fixed up by ld.elf_so.
-	 *	- ps_strings is a NetBSD extention, and will be
-	 * 	  ignored by executables which are strictly
-	 *	  compliant with the SVR4 ABI.
-	 *
-	 * XXX We have to set both regs and retval here due to different
-	 * XXX calling convention in trap.c and init_main.c.
-	 */
-	/*
-	 * XXX PG: these get overwritten in the syscall return code.
-	 * execve() should return EJUSTRETURN, like it does on NetBSD.
-	 * Emulate by setting the syscall return value cells. The
-	 * registers still have to be set for init's fork trampoline.
-	 */
-	td->td_retval[0] = arginfo.ps_nargvstr;
-	td->td_retval[1] = (register_t)arginfo.ps_argvstr;
-	tf->fixreg[3] = arginfo.ps_nargvstr;
-	tf->fixreg[4] = (register_t)arginfo.ps_argvstr;
-	tf->fixreg[5] = (register_t)arginfo.ps_envstr;
-	tf->fixreg[6] = 0;			/* auxillary vector */
-	tf->fixreg[7] = 0;			/* termination vector */
-	tf->fixreg[8] = (register_t)PS_STRINGS;	/* NetBSD extension */
-
-	tf->srr0 = entry;
-	tf->srr1 = PSL_USERSET;
-	td->td_pcb->pcb_flags = 0;
-}
-
 int
 fill_regs(struct thread *td, struct reg *regs)
 {

Modified: projects/ppc64/sys/powerpc/booke/vm_machdep.c
==============================================================================
--- projects/ppc64/sys/powerpc/booke/vm_machdep.c	Sun Feb 14 16:18:25 2010	(r203878)
+++ projects/ppc64/sys/powerpc/booke/vm_machdep.c	Sun Feb 14 16:19:15 2010	(r203879)
@@ -380,165 +380,3 @@ is_physical_memory(vm_offset_t addr)
 	return (1);
 }
 
-/*
- * Thread functions
- */
-void
-cpu_thread_exit(struct thread *td)
-{
-
-}
-
-void
-cpu_thread_clean(struct thread *td)
-{
-
-}
-
-void
-cpu_thread_alloc(struct thread *td)
-{
-	struct pcb *pcb;
-
-	pcb = (struct pcb *)((td->td_kstack + td->td_kstack_pages * PAGE_SIZE -
-	    sizeof(struct pcb)) & ~0x3fU);
-	td->td_pcb = pcb;
-	td->td_frame = (struct trapframe *)pcb - 1;
-}
-
-void
-cpu_thread_free(struct thread *td)
-{
-
-}
-
-void
-cpu_thread_swapin(struct thread *td)
-{
-
-}
-
-void
-cpu_thread_swapout(struct thread *td)
-{
-
-}
-
-void
-cpu_set_syscall_retval(struct thread *td, int error)
-{
-	struct proc *p;
-	struct trapframe *tf;
-	int fixup;
-
-	p = td->td_proc;
-	tf = td->td_frame;
-
-	if (tf->fixreg[0] == SYS___syscall) {
-		int code = tf->fixreg[FIRSTARG + 1];
-		if (p->p_sysent->sv_mask)
-			code &= p->p_sysent->sv_mask;
-		fixup = (code != SYS_freebsd6_lseek && code != SYS_lseek) ?
-		    1 : 0;
-	} else
-		fixup = 0;
-
-	switch (error) {
-	case 0:
-		if (fixup) {
-			/*
-			 * 64-bit return, 32-bit syscall. Fixup byte order
-			 */
-			tf->fixreg[FIRSTARG] = 0;
-			tf->fixreg[FIRSTARG + 1] = td->td_retval[0];
-		} else {
-			tf->fixreg[FIRSTARG] = td->td_retval[0];
-			tf->fixreg[FIRSTARG + 1] = td->td_retval[1];
-		}
-		tf->cr &= ~0x10000000;		/* XXX: Magic number */
-		break;
-	case ERESTART:
-		/*
-		 * Set user's pc back to redo the system call.
-		 */
-		tf->srr0 -= 4;
-		break;
-	case EJUSTRETURN:
-		/* nothing to do */
-		break;
-	default:
-		if (p->p_sysent->sv_errsize) {
-			error = (error < p->p_sysent->sv_errsize) ?
-			    p->p_sysent->sv_errtbl[error] : -1;
-		}
-		tf->fixreg[FIRSTARG] = error;
-		tf->cr |= 0x10000000;		/* XXX: Magic number */
-		break;
-	}
-}
-
-void
-cpu_set_upcall(struct thread *td, struct thread *td0)
-{
-	struct pcb *pcb2;
-	struct trapframe *tf;
-	struct callframe *cf;
-
-	pcb2 = td->td_pcb;
-
-	/* Copy the upcall pcb */
-	bcopy(td0->td_pcb, pcb2, sizeof(*pcb2));
-
-	/* Create a stack for the new thread */
-	tf = td->td_frame;
-	bcopy(td0->td_frame, tf, sizeof(struct trapframe));
-	tf->fixreg[FIRSTARG] = 0;
-	tf->fixreg[FIRSTARG + 1] = 0;
-	tf->cr &= ~0x10000000;
-
-	/* Set registers for trampoline to user mode. */
-	cf = (struct callframe *)tf - 1;
-	memset(cf, 0, sizeof(struct callframe));
-	cf->cf_func = (register_t)fork_return;
-	cf->cf_arg0 = (register_t)td;
-	cf->cf_arg1 = (register_t)tf;
-
-	pcb2->pcb_sp = (register_t)cf;
-	pcb2->pcb_lr = (register_t)fork_trampoline;
-
-	/* Setup to release sched_lock in fork_exit(). */
-	td->td_md.md_spinlock_count = 1;
-	td->td_md.md_saved_msr = PSL_KERNSET;
-}
-
-void
-cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg,
-    stack_t *stack)
-{
-	struct trapframe *tf;
-	uint32_t sp;
-
-	tf = td->td_frame;
-	/* align stack and alloc space for frame ptr and saved LR */
-	sp = ((uint32_t)stack->ss_sp + stack->ss_size -
-	    2 * sizeof(u_int32_t)) & ~0x3f;
-	bzero(tf, sizeof(struct trapframe));
-
-	tf->fixreg[1] = (register_t)sp;
-	tf->fixreg[3] = (register_t)arg;
-	tf->srr0 = (register_t)entry;
-
-	tf->srr1 = PSL_USERSET;
-	td->td_pcb->pcb_flags = 0;
-
-	td->td_retval[0] = (register_t)entry;
-	td->td_retval[1] = 0;
-}
-
-int
-cpu_set_user_tls(struct thread *td, void *tls_base)
-{
-
-	td->td_frame->fixreg[2] = (register_t)tls_base + 0x7008;
-	return (0);
-}



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