⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 memdef_depend.h

📁 T-kernel 的extension源代码
💻 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	SFT_PDIR_ENTRIES	6	/* 1 << 6 = 64 *//* * Memory maps of T-Engine/VR5500 and VR4131 * *	Both are identical except that VR4131's RAM is 32MB. * *   0x00000000	+-------------------------------+ *		|Task-specific space		| *   0x10000000	+-------------------------------+ *		|(Reserved task-specific space)	| *   0x40000000	+-------------------------------+  -- *		|				|  ^ *		|Same as			|  |	Shared logical space *		|0xc0000000 - 0xffffffff	|  |	User-level accessible *		|				|  | *   0x80000000	+===============================+  -- *		|RAM		(128MB)		|  ^ *		|  KERNEL.SYS			|  | *		|  Page table			|  | *		|  Page frame			|  | *   0x88000000	+-------------------------------+  | *		|I/O and PCI areas		|  |	Physical space *		|(Basically not used)		|  |	Cache on *   0x9f000000	+-------------------------------+  | *		|ROM		(16MB)		|  v *   0xa0000000	+-------------------------------+  -- *		|RAM (Basically not used)	|  ^ *   0xa8000000	+-------------------------------+  | *		|I/O and PCI areas		|  |	Physical space *		|(Incl reserved area)		|  |	Cache off *   0xbf000000	+-------------------------------+  | *		|ROM (Basically not used)	|  v *   0xc0000000	+===============================+  -- *		|Shared memory space		|  ^ *   0xf0000000	+-------------------------------+  | *		|For program map		|  |	Shared logical space *   0xf8000000	+-------------------------------+  |	User-level not accessible *		|For memory map			|  v *   0xffffffff	+-------------------------------+  -- *//* * Conversion between physical and logical addresses in real memory area (physical space) *	Physical address space: only 512MB is acceptable */#define	toLogicalAddress(paddr)		(VP)((UW)(paddr) | 0x80000000U)#define	toPhysicalAddress(laddr)	(VP)((UW)(laddr) & 0x1fffffffU)/* * Range of address in real memory area */#define	REALMEMORY_TOP			0x80000000U#define	REALMEMORY_END			0x88000000U/* * 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			0xc0000000U#define	SYSSPACE_END			0xf0000000U/* * Range of address in system program map space */#define	SYSPRGSPACE_TOP			0xf0000000U#define	SYSPRGSPACE_END			0xf8000000U/* * Range of address in I/O space */#define	IOSPACE_TOP			0xf8000000U#define	IOSPACE_END			0x00000000U/* * VR-specific memory area type */#define	KUSEG_TOP			0x00000000U	/* USR: Logical space */#define	KSEG0_TOP			0x80000000U	/* SYS: Physical space/cash on */#define	KSEG1_TOP			0xa0000000U	/* SYS: Physical space/cash off */#define	KSSEG_TOP			0xc0000000U	/* SVC: Logical space */#define	KSEG3_TOP			0xe0000000U	/* SYS: Logical space */#define	isKUSEG(addr)			( (UW)(addr) < KSEG0_TOP )#define	isKSEG0(addr)			( (((UW)(addr) >= KSEG0_TOP) && ((UW)(addr) < KSEG1_TOP)) )#define	isKSEG1(addr)			( (((UW)(addr) >= KSEG1_TOP) && ((UW)(addr) < KSSEG_TOP)) )#define	isKSSEG(addr)			( (((UW)(addr) >= KSSEG_TOP) && ((UW)(addr) < KSEG3_TOP)) )#define	isKSEG3(addr)			( (UW)(addr) >= KSEG3_TOP )/* * Within ROM area: True */#define	isROM(addr)			( ((UW)(addr) >= 0x9f000000U && (UW)(addr) < 0xa0000000U) )/* * Within logical space: True */#define	isLogicalSpace(addr)		( ((UW)(addr) & 0xc0000000U) != 0x80000000U )#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -