Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Jul 2015 18:16:07 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r285171 - head/sys/arm64/arm64
Message-ID:  <201507051816.t65IG73W078392@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Sun Jul  5 18:16:06 2015
New Revision: 285171
URL: https://svnweb.freebsd.org/changeset/base/285171

Log:
  Add the kernel functions needed to enable threading.
  
  Sponsored by:	ABT Systems Ltd

Modified:
  head/sys/arm64/arm64/vm_machdep.c

Modified: head/sys/arm64/arm64/vm_machdep.c
==============================================================================
--- head/sys/arm64/arm64/vm_machdep.c	Sun Jul  5 16:48:40 2015	(r285170)
+++ head/sys/arm64/arm64/vm_machdep.c	Sun Jul  5 18:16:06 2015	(r285171)
@@ -184,15 +184,25 @@ void
 cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg,
 	stack_t *stack)
 {
+	struct trapframe *tf = td->td_frame;
 
-	panic("cpu_set_upcall_kse");
+	tf->tf_sp = STACKALIGN(stack->ss_sp + stack->ss_size);
+	tf->tf_elr = (register_t)entry;
+	tf->tf_x[0] = (register_t)arg;
 }
 
 int
 cpu_set_user_tls(struct thread *td, void *tls_base)
 {
+	struct pcb *pcb;
 
-	panic("cpu_set_user_tls");
+	if ((uintptr_t)tls_base >= VM_MAXUSER_ADDRESS)
+		return (EINVAL);
+
+	pcb = td->td_pcb;
+	pcb->pcb_tpidr_el0 = (register_t)tls_base;
+
+	return (0);
 }
 
 void



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