📄 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__#define PAGESIZE 4096 /* Page size (number of bytes) *//* * Number of task-specific space entries in page directory */#define NUM_PDIR_ENTRIES 64#define NUM_PDIR_ENTRIES_SHIFT 6 /* 1 << 6 = 64 *//* * Memory maps of T-Engine/SH7727 and SH7751 * * 0x00000000 +-------------------------------+ -- * |Task-specific space | ^ * 0x10000000 +-------------------------------+ | * |(Reserved task-specific space) | | Logical space (P0) (U0) * 0x40000000 +-------------------------------+ | * |Shared memory spaces | | * 0x70000000 +-------------------------------+ | * |For memory map | v * 0x80000000 +===============================+ -- * |ROM (8MB) | ^ * |(Incl unused area) | | * 0x84000000 +-------------------------------+ | * |I/O area | | * |(Basically not used) | | Physical space (P1) * 0x8c000000 +-------------------------------+ | Cache on * |RAM (64MB) | | * 0x90000000 +-------------------------------+ | * |I/O area | | * |(Basically not used) | v * 0xa0000000 +===============================+ -- * |ROM (Basically not used) | ^ * 0xa4000000 +-------------------------------+ | * |I/O area | | * |(Incl unused area) | | Physical space (P2) * 0xac000000 +-------------------------------+ | Cache off * |RAM (Basically not used) | | * 0xb0000000 +-------------------------------+ | * |I/O area | | * |(Incl unused area) | v * 0xc0000000 +===============================+ -- * |For program map | ^ * 0xd0000000 +-------------------------------+ | Logical space (P3) * |(Not used) | v * 0xe0000000 +===============================+ -- * |Built-in I/O area | ^ * |(Incl unused area) | | Physical space (P4) * | | v * 0xffffffff +-------------------------------+ -- *//* * 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 0x8c000000U#define REALMEMORY_END 0x90000000U/* * Range of address in local space */#define LOCALSPACE_TOP 0x00000000U#define LOCALSPACE_END ( NUM_PDIR_ENTRIES << 22 ) /* 0x10000000 *//* * Range of address in shared/system memory space */#define SYSSPACE_TOP 0x40000000U#define SYSSPACE_END 0x70000000U/* * 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 0x70000000U#define IOSPACE_END 0x80000000U/* * SH-specific memory area type */#define P0_TOP 0x00000000U /* Logical space Cacheable */#define P1_TOP 0x80000000U /* Physical space Cacheable */#define P2_TOP 0xa0000000U /* Physical space Not cacheable */#define P3_TOP 0xc0000000U /* Logical space Cacheable */#define P4_TOP 0xe0000000U /* Control space Not cacheable */#define isP0(addr) ( (UW)(addr) < P1_TOP )#define isP1(addr) ( ((UW)(addr) >= P1_TOP) && ((UW)(addr) < P2_TOP) )#define isP2(addr) ( ((UW)(addr) >= P2_TOP) && ((UW)(addr) < P3_TOP) )#define isP3(addr) ( ((UW)(addr) >= P3_TOP) && ((UW)(addr) < P4_TOP) )#define isP4(addr) ( (UW)(addr) >= P4_TOP )/* * Within ROM area: True */#define isROM(addr) ( ((UW)(addr) >= 0x80000000U) && ((UW)(addr) < 0x84000000U) )/* * Within logical space: True */#define isLogicalSpace(addr) ( isP0(addr) || isP3(addr) )#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -