📄 memdef_depend.h
字号:
/* *---------------------------------------------------------------------- * T-Kernel / Standard Extension * * Copyright (C) 2006 by Ken Sakamura. All rights reserved. * T-Kernel / Standard Extension is distributed * under the T-License for T-Kernel / Standard Extension. *---------------------------------------------------------------------- * * Version: 1.00.00 * Released by T-Engine Forum(http://www.t-engine.org) at 2006/8/11. * *---------------------------------------------------------------------- *//* * memdef.h * * Memory map definitions */#ifndef __SYS_MEMDEF_DEPEND_H__#define __SYS_MEMDEF_DEPEND_H__#include <tk/sysdef.h>#define PAGESIZE 4096 /* Page size (number of bytes) *//* * Memory map of T-Engine/MC9328 * * 0x00000000 +-------------------------------+ -- 0x10000000 * |Boot ROM (1MB) |*3 | Same as first 1MB of ROM * 0x00100000 +-------------------------------+ -- 0x10100000 * |(Not used) |*1 * 0x00200000 +-------------------------------+ * |Internal register |*2 * |(Incl unused area) | * 0x00300000 +-------------------------------+ * |Built-in SRAM (128KB) | * |(Incl unused area) | * 0x00400000 +-------------------------------+ * |(Not used) |*1 * 0x08000000 +-------------------------------+ * |RAM (64MB) | * 0x0c000000 +-------------------------------+ * |(Not usable) |*1 * 0x10000000 +-------------------------------+ * |ROM (16MB) |*3 * 0x12000000 +-------------------------------+ * |(Not used) |*1 * 0x13000000 +-------------------------------+ * |(Not usable) |*1 * 0x14000000 +-------------------------------+ * |Peripheral device |*2 * 0x16000000 +-------------------------------+ * |(Open to user) |*2 * 0x17000000 +-------------------------------+ * |(Not used) |*1 * 0x40000000 +-------------------------------+ -- * |Task-specific space | ^ * 0x50000000 +-------------------------------+ | * |(Reserved task-specific space) | | Virtual memory * 0x80000000 +-------------------------------+ | * |Shared memory space | | * 0xc0000000 +-------------------------------+ | * |For program map | | * 0xd0000000 +-------------------------------+ | * |For memory map | v * 0xe0000000 +-------------------------------+ -- * |(Not used) |*1 * 0xffffffff +-------------------------------+ * * * In virtual memory areas, mapping of logical and physical addresses is dynamically * changed by OS. In the other areas, logical and physical addresses are mapped to the * same areas and the mapping is not dynamically changed. * * In areas other than virtual memory area, T-Monitor performs * mapping at startup (initialization) to enable MMU, cache and * write buffer. * In areas indicated by *1 and virtual memory areas, do not perform mapping and disable * access. * In areas indicated by *2, turn off cache and write buffer. * Areas indicated by *3 must be made read-only. * Perform mapping on a section (1MB) basis. All domains must be zero. * Disable any user-level access. * * The built-in SRAM is located in an area that is not used by OS or monitor. *//* * Conversion between physical and logical addresses in real memory area */#define toLogicalAddress(paddr) (VP)(paddr)#define toPhysicalAddress(laddr) (VP)(laddr)/* * Range of address in real memory area */#define REALMEMORY_TOP 0x08000000U#define REALMEMORY_END 0x0c000000U/* * Range of address in local space (0x40000000 - 0x50000000) */#define LOCALSPACE_TOP ( TOP_PDIR_ENTRIES * 0x00100000U )#define LOCALSPACE_END ( (TOP_PDIR_ENTRIES + NUM_PDIR_ENTRIES) * 0x00100000U )/* * Range of address in shared/system memory space */#define SYSSPACE_TOP 0x80000000U#define SYSSPACE_END 0xc0000000U/* * Range of address in system program map space */#define SYSPRGSPACE_TOP 0xc0000000U#define SYSPRGSPACE_END 0xd0000000U/* * Range of address in I/O space */#define IOSPACE_TOP 0xd0000000U#define IOSPACE_END 0xe0000000U/* * Within ROM area: True */#define isROM(addr) ( ((UW)(addr) < 0x00100000U) \ || ( ((UW)(addr) >= 0x10000000U) \ && ((UW)(addr) < 0x12000000U) ) )/* * Within logical space: True */#define isLogicalSpace(addr) ( ((UW)(addr) >= 0x40000000U) \ && ((UW)(addr) < 0xe0000000U) )/* * Range of section corresponding to logical space */#define LOGICALSPACE_SECTION_TOP ( 0x40000000U / (1024 * 1024) )#define LOGICALSPACE_SECTION_END ( 0xe0000000U / (1024 * 1024) )#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -