6 * Copyright (C) 1999, 2002 Samuel Rydh (samuel@ibrium.se)
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
14 #ifndef _H_OFMEM_SPARC64
15 #define _H_OFMEM_SPARC64
17 #include "libopenbios/ofmem.h"
19 #define PAGE_SIZE_4M (4 * 1024 * 1024)
20 #define PAGE_SIZE_512K (512 * 1024)
21 #define PAGE_SIZE_64K (64 * 1024)
22 #define PAGE_SIZE_8K (8 * 1024)
23 #define PAGE_MASK_4M (4 * 1024 * 1024 - 1)
24 #define PAGE_MASK_512K (512 * 1024 - 1)
25 #define PAGE_MASK_64K (64 * 1024 - 1)
26 #define PAGE_MASK_8K (8 * 1024 - 1)
28 extern ucell *va2ttedata;
29 extern unsigned long find_tte(unsigned long va);
31 void itlb_load2(unsigned long vaddr, unsigned long tte_data);
32 void itlb_load3(unsigned long vaddr, unsigned long tte_data, unsigned long tte_index);
33 unsigned long itlb_faultva(void);
34 void itlb_demap(unsigned long vaddr);
35 void dtlb_load2(unsigned long vaddr, unsigned long tte_data);
36 void dtlb_load3(unsigned long vaddr, unsigned long tte_data, unsigned long tte_index);
37 unsigned long dtlb_faultva(void);
38 void dtlb_demap(unsigned long vaddr);
40 typedef int (*translation_entry_cb)(ucell phys, ucell virt, ucell size, ucell mode);
42 extern void ofmem_walk_boot_map(translation_entry_cb cb);
44 extern translation_t **g_ofmem_translations;
46 extern void dtlb_miss_handler(void);
47 extern void itlb_miss_handler(void);
48 extern void bug(void);
50 #endif /* _H_OFMEM_SPARC64 */