vm_machdep.c (c6a37e84139a1c73d4ef46ce4fdf8598a0ebbf45) vm_machdep.c (21fc3164307dc288ff6eb1f028a268f3c76cc6e5)
1/*-
2 * Copyright (c) 1982, 1986 The Regents of the University of California.
3 * Copyright (c) 1989, 1990 William Jolitz
4 * Copyright (c) 1994 John Dyson
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * the Systems Programming Group of the University of Utah Computer

--- 39 unchanged lines hidden (view full) ---

48#include <sys/kernel.h>
49#include <sys/malloc.h>
50#include <sys/mbuf.h>
51#include <sys/proc.h>
52#include <sys/socketvar.h>
53#include <sys/sf_buf.h>
54#include <machine/cpu.h>
55#include <machine/pcb.h>
1/*-
2 * Copyright (c) 1982, 1986 The Regents of the University of California.
3 * Copyright (c) 1989, 1990 William Jolitz
4 * Copyright (c) 1994 John Dyson
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * the Systems Programming Group of the University of Utah Computer

--- 39 unchanged lines hidden (view full) ---

48#include <sys/kernel.h>
49#include <sys/malloc.h>
50#include <sys/mbuf.h>
51#include <sys/proc.h>
52#include <sys/socketvar.h>
53#include <sys/sf_buf.h>
54#include <machine/cpu.h>
55#include <machine/pcb.h>
56#include <machine/sysarch.h>
56#include <vm/vm.h>
57#include <vm/pmap.h>
58#include <sys/lock.h>
59#include <sys/mutex.h>
60
61#include <vm/vm.h>
62#include <vm/vm_extern.h>
63#include <vm/vm_kern.h>

--- 210 unchanged lines hidden (view full) ---

274}
275
276/*
277 * Set that machine state for performing an upcall that has to
278 * be done in thread_userret() so that those upcalls generated
279 * in thread_userret() itself can be done as well.
280 */
281void
57#include <vm/vm.h>
58#include <vm/pmap.h>
59#include <sys/lock.h>
60#include <sys/mutex.h>
61
62#include <vm/vm.h>
63#include <vm/vm_extern.h>
64#include <vm/vm_kern.h>

--- 210 unchanged lines hidden (view full) ---

275}
276
277/*
278 * Set that machine state for performing an upcall that has to
279 * be done in thread_userret() so that those upcalls generated
280 * in thread_userret() itself can be done as well.
281 */
282void
282cpu_set_upcall_kse(struct thread *td, struct kse_upcall *ku)
283cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg,
284 stack_t *stack)
283{
284 struct trapframe *tf = td->td_frame;
285
285{
286 struct trapframe *tf = td->td_frame;
287
286 tf->tf_usr_sp = ((int)ku->ku_stack.ss_sp + ku->ku_stack.ss_size
288 tf->tf_usr_sp = ((int)stack->ss_sp + stack->ss_size
287 - sizeof(struct trapframe)) & ~7;
289 - sizeof(struct trapframe)) & ~7;
288 tf->tf_pc = (int)ku->ku_func;
289 tf->tf_r0 = (int)ku->ku_mailbox;
290 tf->tf_pc = (int)entry;
291 tf->tf_r0 = (int)arg;
290 tf->tf_spsr = PSR_USR32_MODE;
291}
292
293void
292 tf->tf_spsr = PSR_USR32_MODE;
293}
294
295void
296cpu_set_user_tls(struct thread *td, void *tls_base)
297{
298
299 if (td != curthread)
300 td->td_md.md_tp = tls_base;
301 else {
302 critical_enter();
303 *(void **)ARM_TP_ADDRESS = tls_base;
304 critical_exit();
305 }
306}
307
308void
294cpu_thread_exit(struct thread *td)
295{
296}
297
298void
299cpu_thread_setup(struct thread *td)
300{
301 td->td_pcb = (struct pcb *)(td->td_kstack + td->td_kstack_pages *

--- 45 unchanged lines hidden ---
309cpu_thread_exit(struct thread *td)
310{
311}
312
313void
314cpu_thread_setup(struct thread *td)
315{
316 td->td_pcb = (struct pcb *)(td->td_kstack + td->td_kstack_pages *

--- 45 unchanged lines hidden ---