xref: /dflybsd-src/sys/platform/pc64/include/pmap_inval.h (revision 95270b7ecb6e66e42892546590e8bbf44d405ea3)
1b6871f55SYonghong Yan /*
2b6871f55SYonghong Yan  * Copyright (c) 2003,2004 The DragonFly Project.  All rights reserved.
3b6871f55SYonghong Yan  *
4b6871f55SYonghong Yan  * This code is derived from software contributed to The DragonFly Project
5b6871f55SYonghong Yan  * by Matthew Dillon <dillon@backplane.com>
6b6871f55SYonghong Yan  *
7b6871f55SYonghong Yan  * Redistribution and use in source and binary forms, with or without
8b6871f55SYonghong Yan  * modification, are permitted provided that the following conditions
9b6871f55SYonghong Yan  * are met:
10b6871f55SYonghong Yan  *
11b6871f55SYonghong Yan  * 1. Redistributions of source code must retain the above copyright
12b6871f55SYonghong Yan  *    notice, this list of conditions and the following disclaimer.
13b6871f55SYonghong Yan  * 2. Redistributions in binary form must reproduce the above copyright
14b6871f55SYonghong Yan  *    notice, this list of conditions and the following disclaimer in
15b6871f55SYonghong Yan  *    the documentation and/or other materials provided with the
16b6871f55SYonghong Yan  *    distribution.
17b6871f55SYonghong Yan  * 3. Neither the name of The DragonFly Project nor the names of its
18b6871f55SYonghong Yan  *    contributors may be used to endorse or promote products derived
19b6871f55SYonghong Yan  *    from this software without specific, prior written permission.
20b6871f55SYonghong Yan  *
21b6871f55SYonghong Yan  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22b6871f55SYonghong Yan  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23b6871f55SYonghong Yan  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24b6871f55SYonghong Yan  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
25b6871f55SYonghong Yan  * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26b6871f55SYonghong Yan  * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
27b6871f55SYonghong Yan  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28b6871f55SYonghong Yan  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29b6871f55SYonghong Yan  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30b6871f55SYonghong Yan  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31b6871f55SYonghong Yan  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32b6871f55SYonghong Yan  * SUCH DAMAGE.
33b6871f55SYonghong Yan  *
343dfd391fSYonghong Yan  * $DragonFly: src/sys/platform/pc64/include/pmap_inval.h,v 1.2 2007/09/24 03:24:45 yanyh Exp $
35b6871f55SYonghong Yan  */
36b6871f55SYonghong Yan 
37b6871f55SYonghong Yan #ifndef _MACHINE_PMAP_INVAL_H_
38b6871f55SYonghong Yan #define	_MACHINE_PMAP_INVAL_H_
39b6871f55SYonghong Yan 
40b6871f55SYonghong Yan #ifndef _SYS_THREAD_H_
41b6871f55SYonghong Yan #include <sys/thread.h>
42b6871f55SYonghong Yan #endif
43b6871f55SYonghong Yan 
44b6871f55SYonghong Yan #ifdef _KERNEL
45b6871f55SYonghong Yan 
46b6871f55SYonghong Yan #ifndef _MACHINE_PMAP_H_
47b6871f55SYonghong Yan #include <machine/pmap.h>
48b6871f55SYonghong Yan #endif
49b6871f55SYonghong Yan 
50ccd67bf6SMatthew Dillon typedef struct pmap_inval_bulk {
51ccd67bf6SMatthew Dillon 	pmap_t          pmap;
52ccd67bf6SMatthew Dillon 	vm_offset_t     va_beg;
53ccd67bf6SMatthew Dillon 	vm_offset_t     va_end;
54ccd67bf6SMatthew Dillon 	long		count;
55ccd67bf6SMatthew Dillon } pmap_inval_bulk_t;
56ccd67bf6SMatthew Dillon 
57*95270b7eSMatthew Dillon pt_entry_t pmap_inval_smp(pmap_t pmap, vm_offset_t va, vm_pindex_t npgs,
5879f2da03SMatthew Dillon 			pt_entry_t *ptep, pt_entry_t npte);
5979f2da03SMatthew Dillon int pmap_inval_smp_cmpset(pmap_t pmap, vm_offset_t va,
6079f2da03SMatthew Dillon 			pt_entry_t *ptep, pt_entry_t opte, pt_entry_t npte);
611a5c7e0fSMatthew Dillon int pmap_inval_intr(cpumask_t *cpumask, int toolong);
62b6871f55SYonghong Yan 
63ccd67bf6SMatthew Dillon void pmap_inval_bulk_init(pmap_inval_bulk_t *bulk, struct pmap *pmap);
64ccd67bf6SMatthew Dillon pt_entry_t pmap_inval_bulk(pmap_inval_bulk_t *bulk, vm_offset_t va,
65ccd67bf6SMatthew Dillon 			pt_entry_t *ptep, pt_entry_t npte);
66ccd67bf6SMatthew Dillon void pmap_inval_bulk_flush(pmap_inval_bulk_t *bulk);
67ccd67bf6SMatthew Dillon 
68ccd67bf6SMatthew Dillon void smp_smurf_idleinvlclr(cpumask_t *mask);
69ccd67bf6SMatthew Dillon void smp_invlpg(cpumask_t *cmdmask);
70ccd67bf6SMatthew Dillon void smp_inval_intr(void);
71ccd67bf6SMatthew Dillon 
72b6871f55SYonghong Yan #endif
73b6871f55SYonghong Yan 
74b6871f55SYonghong Yan #endif
75