cleanup the duplicated $DragonFly$ cvs id, my bad
[dragonfly.git] / sys / platform / pc64 / amd64 / vm_machdep.c
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
9  * Science Department, and William Jolitz.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright
17  *    notice, this list of conditions and the following disclaimer in the
18  *    documentation and/or other materials provided with the distribution.
19  * 3. All advertising materials mentioning features or use of this software
20  *    must display the following acknowledgement:
21  *      This product includes software developed by the University of
22  *      California, Berkeley and its contributors.
23  * 4. Neither the name of the University nor the names of its contributors
24  *    may be used to endorse or promote products derived from this software
25  *    without specific prior written permission.
26  *
27  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37  * SUCH DAMAGE.
38  *
39  *      from: @(#)vm_machdep.c  7.3 (Berkeley) 5/13/91
40  *      Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
41  * $FreeBSD: src/sys/i386/i386/vm_machdep.c,v 1.132.2.9 2003/01/25 19:02:23 dillon Exp $
42  * $DragonFly: src/sys/platform/pc64/amd64/vm_machdep.c,v 1.2 2007/09/24 03:24:45 yanyh Exp $
43  */
44
45 #include <sys/param.h>
46 #include <sys/systm.h>
47 #include <sys/malloc.h>
48 #include <sys/proc.h>
49 #include <sys/buf.h>
50 #include <sys/interrupt.h>
51 #include <sys/vnode.h>
52 #include <sys/vmmeter.h>
53 #include <sys/kernel.h>
54 #include <sys/sysctl.h>
55 #include <sys/unistd.h>
56
57 #include <machine/clock.h>
58 #include <machine/cpu.h>
59 #include <machine/md_var.h>
60 #include <machine/smp.h>
61 #include <machine/pcb_ext.h>
62 #include <machine/pcb.h>
63 #include <machine/segments.h>
64 #include <machine/globaldata.h> /* npxthread */
65
66 #include <vm/vm.h>
67 #include <vm/vm_param.h>
68 #include <sys/lock.h>
69 #include <vm/vm_kern.h>
70 #include <vm/vm_page.h>
71 #include <vm/vm_map.h>
72 #include <vm/vm_extern.h>
73
74 #include <sys/thread2.h>
75
76 char machine[] = MACHINE;
77
78 char cpu_vendor[] = "DragonFly";        /* XXX */
79 u_int cpu_id = 0x80000000;              /* XXX */
80
81 /*
82  * Finish a fork operation, with lwp lp2 nearly set up.
83  * Copy and update the pcb, set up the stack so that the child
84  * ready to run and return to user mode.
85  */
86 void
87 cpu_fork(struct lwp *lp1, struct lwp *lp2, int flags)
88 {
89 }
90
91 /*
92  * Prepare new lwp to return to the address specified in params.
93  */
94 int
95 cpu_prepare_lwp(struct lwp *lp, struct lwp_params *params)
96 {
97         return (0);
98 }
99
100 /*
101  * Intercept the return address from a freshly forked process that has NOT
102  * been scheduled yet.
103  *
104  * This is needed to make kernel threads stay in kernel mode.
105  */
106 void
107 cpu_set_fork_handler(struct lwp *lp, void (*func)(void *, struct trapframe *),
108                      void *arg)
109 {
110 }
111
112 void
113 cpu_set_thread_handler(thread_t td, void (*rfunc)(void), void *func, void *arg)
114 {
115 }
116
117 void
118 cpu_lwp_exit(void)
119 {
120 }
121
122 /*
123  * Terminate the current thread.  The caller must have already acquired
124  * the thread's rwlock and placed it on a reap list or otherwise notified
125  * a reaper of its existance.  We set a special assembly switch function which
126  * releases td_rwlock after it has cleaned up the MMU state and switched
127  * out the stack.
128  *
129  * Must be caller from a critical section and with the thread descheduled.
130  */
131 void
132 cpu_thread_exit(void)
133 {
134 }
135
136 /*
137  * Process Reaper.  Called after the caller has acquired the thread's
138  * rwlock and removed it from the reap list.
139  */
140 void
141 cpu_proc_wait(struct proc *p)
142 {
143 }
144
145 int
146 kvm_access_check(vm_offset_t saddr, vm_offset_t eaddr, int prot)
147 {
148         return 0;
149 }
150