1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/sh4/mmu.h Sat Dec 27 03:14:59 2008 +0000
1.7 + * MMU/TLB definitions.
1.9 + * Copyright (c) 2005 Nathan Keynes.
1.11 + * This program is free software; you can redistribute it and/or modify
1.12 + * it under the terms of the GNU General Public License as published by
1.13 + * the Free Software Foundation; either version 2 of the License, or
1.14 + * (at your option) any later version.
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 of
1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.19 + * GNU General Public License for more details.
1.23 +#ifndef lxdream_sh4_mmu_H
1.24 +#define lxdream_sh4_mmu_H 1
1.26 +#include "lxdream.h"
1.32 +#define VMA_TO_EXT_ADDR(vma) ((vma)&0x1FFFFFFF)
1.34 +/************************** UTLB/ITLB Definitions ***************************/
1.35 +#define ITLB_ENTRY_COUNT 4
1.36 +#define UTLB_ENTRY_COUNT 64
1.38 +/* Entry address */
1.39 +#define TLB_VALID 0x00000100
1.40 +#define TLB_USERMODE 0x00000040
1.41 +#define TLB_WRITABLE 0x00000020
1.42 +#define TLB_USERWRITABLE (TLB_WRITABLE|TLB_USERMODE)
1.43 +#define TLB_SIZE_MASK 0x00000090
1.44 +#define TLB_SIZE_1K 0x00000000
1.45 +#define TLB_SIZE_4K 0x00000010
1.46 +#define TLB_SIZE_64K 0x00000080
1.47 +#define TLB_SIZE_1M 0x00000090
1.48 +#define TLB_CACHEABLE 0x00000008
1.49 +#define TLB_DIRTY 0x00000004
1.50 +#define TLB_SHARE 0x00000002
1.51 +#define TLB_WRITETHRU 0x00000001
1.53 +#define MASK_1K 0xFFFFFC00
1.54 +#define MASK_4K 0xFFFFF000
1.55 +#define MASK_64K 0xFFFF0000
1.56 +#define MASK_1M 0xFFF00000
1.58 +struct itlb_entry {
1.59 + sh4addr_t vpn; // Virtual Page Number
1.60 + uint32_t asid; // Process ID
1.62 + sh4addr_t ppn; // Physical Page Number
1.66 +struct utlb_entry {
1.67 + sh4addr_t vpn; // Virtual Page Number
1.68 + uint32_t mask; // Page size mask
1.69 + uint32_t asid; // Process ID
1.70 + sh4addr_t ppn; // Physical Page Number
1.72 + uint32_t pcmcia; // extra pcmcia data - not used
1.75 +struct utlb_sort_entry {
1.76 + sh4addr_t key; // Masked VPN + ASID
1.77 + uint32_t mask; // Mask + 0x00FF
1.84 +#endif /* !lxdream_sh4_mmu_H */