1 /* 2 * <ofmem_sparc64.h> 3 * 4 * OF Memory manager 5 * 6 * Copyright (C) 1999, 2002 Samuel Rydh (samuel@ibrium.se) 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License 10 * as published by the Free Software Foundation 11 * 12 */ 13 14 #ifndef _H_OFMEM_SPARC64 15 #define _H_OFMEM_SPARC64 16 17 #include "libopenbios/ofmem.h" 18 19 #define OFMEM_VIRT_TOP 0xff000000 20 21 #define PAGE_SIZE_4M (4 * 1024 * 1024) 22 #define PAGE_SIZE_512K (512 * 1024) 23 #define PAGE_SIZE_64K (64 * 1024) 24 #define PAGE_SIZE_8K (8 * 1024) 25 #define PAGE_MASK_4M (4 * 1024 * 1024 - 1) 26 #define PAGE_MASK_512K (512 * 1024 - 1) 27 #define PAGE_MASK_64K (64 * 1024 - 1) 28 #define PAGE_MASK_8K (8 * 1024 - 1) 29 30 extern ucell *va2ttedata; 31 extern unsigned long find_tte(unsigned long va); 32 33 void itlb_load2(unsigned long vaddr, unsigned long tte_data); 34 void itlb_load3(unsigned long vaddr, unsigned long tte_data, unsigned long tte_index); 35 unsigned long itlb_faultva(void); 36 void itlb_demap(unsigned long vaddr); 37 void dtlb_load2(unsigned long vaddr, unsigned long tte_data); 38 void dtlb_load3(unsigned long vaddr, unsigned long tte_data, unsigned long tte_index); 39 unsigned long dtlb_faultva(void); 40 void dtlb_demap(unsigned long vaddr); 41 42 typedef int (*translation_entry_cb)(ucell phys, ucell virt, ucell size, ucell mode); 43 44 extern void ofmem_walk_boot_map(translation_entry_cb cb); 45 46 extern translation_t **g_ofmem_translations; 47 48 extern void dtlb_miss_handler(void); 49 extern void itlb_miss_handler(void); 50 extern void bug(void); 51 52 #endif /* _H_OFMEM_SPARC64 */ 53