filename | src/sh4/mmu.h |
changeset | 931:430048ea8b71 |
next | 939:6f2302afeb89 |
author | nkeynes |
date | Tue Dec 23 05:48:05 2008 +0000 (15 years ago) |
branch | lxdream-mem |
permissions | -rw-r--r-- |
last change | More refactoring and general cleanup. Most things should be working again now. Split off cache and start real implementation, breaking save states in the process |
file | annotate | diff | log | raw |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00001.2 +++ b/src/sh4/mmu.h Tue Dec 23 05:48:05 2008 +00001.3 @@ -0,0 +1,81 @@1.4 +/**1.5 + * $Id$1.6 + *1.7 + * MMU/TLB definitions.1.8 + *1.9 + * Copyright (c) 2005 Nathan Keynes.1.10 + *1.11 + * This program is free software; you can redistribute it and/or modify1.12 + * it under the terms of the GNU General Public License as published by1.13 + * the Free Software Foundation; either version 2 of the License, or1.14 + * (at your option) any later version.1.15 + *1.16 + * This program is distributed in the hope that it will be useful,1.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1.19 + * GNU General Public License for more details.1.20 + */1.21 +1.22 +1.23 +#ifndef lxdream_sh4_mmu_H1.24 +#define lxdream_sh4_mmu_H 11.25 +1.26 +#include "lxdream.h"1.27 +1.28 +#ifdef __cplusplus1.29 +extern "C" {1.30 +#endif1.31 +1.32 +#define VMA_TO_EXT_ADDR(vma) ((vma)&0x1FFFFFFF)1.33 +1.34 +/************************** UTLB/ITLB Definitions ***************************/1.35 +#define ITLB_ENTRY_COUNT 41.36 +#define UTLB_ENTRY_COUNT 641.37 +1.38 +/* Entry address */1.39 +#define TLB_VALID 0x000001001.40 +#define TLB_USERMODE 0x000000401.41 +#define TLB_WRITABLE 0x000000201.42 +#define TLB_USERWRITABLE (TLB_WRITABLE|TLB_USERMODE)1.43 +#define TLB_SIZE_MASK 0x000000901.44 +#define TLB_SIZE_1K 0x000000001.45 +#define TLB_SIZE_4K 0x000000101.46 +#define TLB_SIZE_64K 0x000000801.47 +#define TLB_SIZE_1M 0x000000901.48 +#define TLB_CACHEABLE 0x000000081.49 +#define TLB_DIRTY 0x000000041.50 +#define TLB_SHARE 0x000000021.51 +#define TLB_WRITETHRU 0x000000011.52 +1.53 +#define MASK_1K 0xFFFFFC001.54 +#define MASK_4K 0xFFFFF0001.55 +#define MASK_64K 0xFFFF00001.56 +#define MASK_1M 0xFFF000001.57 +1.58 +struct itlb_entry {1.59 + sh4addr_t vpn; // Virtual Page Number1.60 + uint32_t asid; // Process ID1.61 + uint32_t mask;1.62 + sh4addr_t ppn; // Physical Page Number1.63 + uint32_t flags;1.64 +};1.65 +1.66 +struct utlb_entry {1.67 + sh4addr_t vpn; // Virtual Page Number1.68 + uint32_t mask; // Page size mask1.69 + uint32_t asid; // Process ID1.70 + sh4addr_t ppn; // Physical Page Number1.71 + uint32_t flags;1.72 + uint32_t pcmcia; // extra pcmcia data - not used1.73 +};1.74 +1.75 +struct utlb_sort_entry {1.76 + sh4addr_t key; // Masked VPN + ASID1.77 + uint32_t mask; // Mask + 0x00FF1.78 + int entryNo;1.79 +};1.80 +1.81 +#ifdef __cplusplus1.82 +}1.83 +#endif1.84 +#endif /* !lxdream_sh4_mmu_H */
.