tlb.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2005 Jakub Jermar
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * - Redistributions of source code must retain the above copyright
00010  *   notice, this list of conditions and the following disclaimer.
00011  * - Redistributions in binary form must reproduce the above copyright
00012  *   notice, this list of conditions and the following disclaimer in the
00013  *   documentation and/or other materials provided with the distribution.
00014  * - The name of the author may not be used to endorse or promote products
00015  *   derived from this software without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00018  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00019  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00020  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00021  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00022  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00023  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00024  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00025  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00026  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027  */
00028 
00035 #ifndef __ia64_TLB_H__
00036 #define __ia64_TLB_H__
00037 
00038 #define tlb_arch_init()
00039 #define tlb_print()
00040 
00041 #include <arch/mm/page.h>
00042 #include <arch/mm/asid.h>
00043 #include <arch/interrupt.h>
00044 #include <arch/types.h>
00045 #include <typedefs.h>
00046 
00048 #define DTR_KERNEL      0
00049 #define ITR_KERNEL      0
00050 #define DTR_KSTACK1     1
00051 #define DTR_KSTACK2     2
00052 
00054 union tlb_entry {
00055         __u64 word[2];
00056         struct {
00057                 /* Word 0 */
00058                 unsigned p : 1;                 
00059                 unsigned : 1;
00060                 unsigned ma : 3;                
00061                 unsigned a : 1;                 
00062                 unsigned d : 1;                 
00063                 unsigned pl : 2;                
00064                 unsigned ar : 3;                
00065                 unsigned long long ppn : 38;    
00066                 unsigned : 2;
00067                 unsigned ed : 1;
00068                 unsigned ig1 : 11;
00069 
00070                 /* Word 1 */
00071                 unsigned : 2;
00072                 unsigned ps : 6;                
00073                 unsigned key : 24;              
00074                 unsigned : 32;
00075         } __attribute__ ((packed));
00076 } __attribute__ ((packed));
00077 typedef union tlb_entry tlb_entry_t;
00078 
00079 extern void tc_mapping_insert(__address va, asid_t asid, tlb_entry_t entry, bool dtc);
00080 extern void dtc_mapping_insert(__address va, asid_t asid, tlb_entry_t entry);
00081 extern void itc_mapping_insert(__address va, asid_t asid, tlb_entry_t entry);
00082 
00083 extern void tr_mapping_insert(__address va, asid_t asid, tlb_entry_t entry, bool dtr, index_t tr);
00084 extern void dtr_mapping_insert(__address va, asid_t asid, tlb_entry_t entry, index_t tr);
00085 extern void itr_mapping_insert(__address va, asid_t asid, tlb_entry_t entry, index_t tr);
00086 
00087 extern void dtlb_kernel_mapping_insert(__address page, __address frame, bool dtr, index_t tr);
00088 extern void dtr_purge(__address page, count_t width);
00089 
00090 extern void dtc_pte_copy(pte_t *t);
00091 extern void itc_pte_copy(pte_t *t);
00092 
00093 extern void alternate_instruction_tlb_fault(__u64 vector, istate_t *istate);
00094 extern void alternate_data_tlb_fault(__u64 vector, istate_t *istate);
00095 extern void data_nested_tlb_fault(__u64 vector, istate_t *istate);
00096 extern void data_dirty_bit_fault(__u64 vector, istate_t *istate);
00097 extern void instruction_access_bit_fault(__u64 vector, istate_t *istate);
00098 extern void data_access_bit_fault(__u64 vector, istate_t *istate);
00099 extern void page_not_present(__u64 vector, istate_t *istate);
00100 
00101 #endif
00102 

Generated on Sun Jun 18 16:51:21 2006 for HelenOS Kernel (ia64) by  doxygen 1.4.6