Changeset View
Changeset View
Standalone View
Standalone View
head/sys/mips/mips/vm_machdep.c
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
#include <sys/sysent.h> | #include <sys/sysent.h> | ||||
#include <sys/buf.h> | #include <sys/buf.h> | ||||
#include <sys/vnode.h> | #include <sys/vnode.h> | ||||
#include <sys/vmmeter.h> | #include <sys/vmmeter.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
#include <sys/unistd.h> | #include <sys/unistd.h> | ||||
#include <machine/abi.h> | |||||
#include <machine/cache.h> | #include <machine/cache.h> | ||||
#include <machine/clock.h> | #include <machine/clock.h> | ||||
#include <machine/cpu.h> | #include <machine/cpu.h> | ||||
#include <machine/cpufunc.h> | #include <machine/cpufunc.h> | ||||
#include <machine/cpuinfo.h> | #include <machine/cpuinfo.h> | ||||
#include <machine/md_var.h> | #include <machine/md_var.h> | ||||
#include <machine/pcb.h> | #include <machine/pcb.h> | ||||
#include <machine/tls.h> | #include <machine/tls.h> | ||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <vm/vm_extern.h> | #include <vm/vm_extern.h> | ||||
#include <vm/pmap.h> | #include <vm/pmap.h> | ||||
#include <vm/vm_kern.h> | #include <vm/vm_kern.h> | ||||
#include <vm/vm_map.h> | #include <vm/vm_map.h> | ||||
#include <vm/vm_page.h> | #include <vm/vm_page.h> | ||||
#include <vm/vm_pageout.h> | #include <vm/vm_pageout.h> | ||||
#include <vm/vm_param.h> | #include <vm/vm_param.h> | ||||
#include <vm/uma.h> | #include <vm/uma.h> | ||||
#include <vm/uma_int.h> | #include <vm/uma_int.h> | ||||
#include <sys/user.h> | #include <sys/user.h> | ||||
#include <sys/mbuf.h> | #include <sys/mbuf.h> | ||||
/* Duplicated from asm.h */ | |||||
#if defined(__mips_o32) | |||||
#define SZREG 4 | |||||
#else | |||||
#define SZREG 8 | |||||
#endif | |||||
#if defined(__mips_o32) || defined(__mips_o64) | |||||
#define CALLFRAME_SIZ (SZREG * (4 + 2)) | |||||
#elif defined(__mips_n32) || defined(__mips_n64) | |||||
#define CALLFRAME_SIZ (SZREG * 4) | |||||
#endif | |||||
/* | /* | ||||
* Finish a fork operation, with process p2 nearly set up. | * Finish a fork operation, with process p2 nearly set up. | ||||
* Copy and update the pcb, set up the stack so that the child | * Copy and update the pcb, set up the stack so that the child | ||||
* ready to run and return to user mode. | * ready to run and return to user mode. | ||||
*/ | */ | ||||
void | void | ||||
cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2,int flags) | cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2,int flags) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 320 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
void | void | ||||
cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, | cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, | ||||
stack_t *stack) | stack_t *stack) | ||||
{ | { | ||||
struct trapframe *tf; | struct trapframe *tf; | ||||
register_t sp; | register_t sp; | ||||
/* | sp = (((intptr_t)stack->ss_sp + stack->ss_size) & ~(STACK_ALIGN - 1)) - | ||||
* At the point where a function is called, sp must be 8 | |||||
* byte aligned[for compatibility with 64-bit CPUs] | |||||
* in ``See MIPS Run'' by D. Sweetman, p. 269 | |||||
* align stack | |||||
*/ | |||||
sp = (((intptr_t)stack->ss_sp + stack->ss_size) & ~0x7) - | |||||
CALLFRAME_SIZ; | CALLFRAME_SIZ; | ||||
/* | /* | ||||
* Set the trap frame to point at the beginning of the uts | * Set the trap frame to point at the beginning of the uts | ||||
* function. | * function. | ||||
*/ | */ | ||||
tf = td->td_frame; | tf = td->td_frame; | ||||
bzero(tf, sizeof(struct trapframe)); | bzero(tf, sizeof(struct trapframe)); | ||||
▲ Show 20 Lines • Show All 192 Lines • Show Last 20 Lines |