1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kernel/eka/include/memmodel/epoc/multiple/x86/mmboot.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,116 @@
1.4 +// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// e32\include\memmodel\epoc\multiple\x86\mmboot.h
1.18 +//
1.19 +//
1.20 +
1.21 +/**
1.22 + @file
1.23 + @publishedPartner
1.24 + @released
1.25 +*/
1.26 +
1.27 +#ifndef __MMBOOT_H__
1.28 +#define __MMBOOT_H__
1.29 +#include <x86.h>
1.30 +#include <memmodel.h>
1.31 +#include <kernel/cache.h>
1.32 +
1.33 +//
1.34 +// Linear address map:
1.35 +// 00000000-003FFFFF Unmapped except for AP boot page at 7F000
1.36 +// 00400000-37FFFFFF Local data
1.37 +// 38000000-3FFFFFFF DLL static data (=phys ram size/2 up to 128M)
1.38 +// 40000000-6FFFFFFF Shared data
1.39 +// 70000000-7FFFFFFF RAM loaded code (=phys ram size up to 256M)
1.40 +// 80000000-8FFFFFFF ROM
1.41 +// 90000000-9FFFFFFF User Global Area
1.42 +// A0000000-BFFFFFFF RAM drive
1.43 +// C0000000-C0001FFF Super page/CPU page (extends to C0005FFF for SMP)
1.44 +// C0006000-C0006FFF Trampoline page for SMP
1.45 +// C0030000-C00303FF KPageInfoMap
1.46 +// C0040000-C004FFFF ASID info
1.47 +// C0080000-C00FFFFF Page table info
1.48 +// C1000000-C1FFFFFF Page directories
1.49 +// C2000000-C5FFFFFF Page tables
1.50 +// C6000000-C6FFFFFF Primary I/O mappings
1.51 +// C7000000-C7FFFFFF
1.52 +// C8000000-C8FFFFFF Kernel .data/.bss, initial stack, kernel heap
1.53 +// C9000000-C93FFFFF Kernel stacks
1.54 +// C9400000-F9FFFFFF Extra kernel mappings (I/O, RAM loaded device drivers)
1.55 +// FA000000-FA3FFFFF IPC Alias for CPU 0
1.56 +// FA400000-FA7FFFFF IPC Alias for CPU 1 (SMP only)
1.57 +// FA800000-FABFFFFF IPC Alias for CPU 2 (SMP only)
1.58 +// FAC00000-FAFFFFFF IPC Alias for CPU 3 (SMP only)
1.59 +// FB000000-FB3FFFFF IPC Alias for CPU 4 (SMP only)
1.60 +// FB400000-FB7FFFFF IPC Alias for CPU 5 (SMP only)
1.61 +// FB800000-FBBFFFFF IPC Alias for CPU 6 (SMP only)
1.62 +// FBC00000-FBFFFFFF IPC Alias for CPU 7 (SMP only)
1.63 +// FC000000-FDFFFFFF Page Info array
1.64 +// FE000000-FEBFFFFF Unused
1.65 +// FEC00000-FEFFFFFF IO APIC + Local APIC
1.66 +// FF000000-FFFFFFFF Unused
1.67 +
1.68 +// Linear addresses
1.69 +const TLinAddr KUserLocalDataBase =0x00400000u;
1.70 +const TLinAddr KUserSharedDataBase =0x40000000u;
1.71 +const TLinAddr KUserSharedDataEnd =0x80000000u; // after code
1.72 +const TLinAddr KRomLinearBase =0x80000000u;
1.73 +const TLinAddr KRomLinearEnd =0x90000000u;
1.74 +const TLinAddr KUserGlobalDataBase =0x90000000u;
1.75 +const TLinAddr KUserGlobalDataEnd =0xA0000000u;
1.76 +const TLinAddr KRamDriveStartAddress=0xA0000000u;
1.77 +const TInt KRamDriveMaxSize=0x20000000;
1.78 +const TLinAddr KRamDriveEndAddress =0xC0000000u;
1.79 +const TLinAddr KSuperPageLinAddr =0xC0000000u;
1.80 +const TLinAddr KPageInfoMap =0xC0030000u;
1.81 +const TLinAddr KAsidInfoBase =0xC0040000u;
1.82 +const TLinAddr KPageTableInfoBase =0xC0080000u;
1.83 +const TLinAddr KPageDirectoryBase =0xC1000000u;
1.84 +const TLinAddr KPageTableBase =0xC2000000u;
1.85 +const TLinAddr KPrimaryIOBase =0xC6000000u;
1.86 +const TLinAddr KKernelSectionEnd =0xFA000000u;
1.87 +const TLinAddr KIPCAlias =0xFA000000u; // for SMP 4MB for each CPU
1.88 + // Thus CPU0->FC0, CPU1->FC4, ..., CPU7->FDC
1.89 +const TUint32 KIPCAliasAreaSize =0x02000000u; // total size of alias area
1.90 +const TLinAddr KPageInfoLinearBase =0xFC000000u;
1.91 +
1.92 +const TLinAddr KMachineConfigLinAddr=0xC0000800u;
1.93 +const TLinAddr KTempAddr=0xC0010000u;
1.94 +const TLinAddr KSecondTempAddr=0xC0014000u;
1.95 +const TLinAddr KDefragAltStackAddr=0xC001F000u;
1.96 +const TLinAddr KApTrampolinePageLin =0xC0006000u;
1.97 +const TLinAddr KBiosInfoLin =0xC0100000u; // RAM info + MP info
1.98 +
1.99 +// Constants for X86 MMU
1.100 +const TInt KChunkShift=22;
1.101 +const TInt KChunkSize=1<<KChunkShift;
1.102 +const TInt KChunkMask=KChunkSize-1;
1.103 +const TInt KPageTableShift=KChunkShift-12+2; // PTE is 4 bytes
1.104 +const TInt KPageTableSize=1<<KPageTableShift;
1.105 +const TInt KPageTableMask=KPageTableSize-1;
1.106 +const TInt KPtClusterShift=12-KPageTableShift;
1.107 +const TInt KPtClusterSize=1<<KPtClusterShift;
1.108 +const TInt KPtClusterMask=KPtClusterSize-1;
1.109 +const TInt KPtBlockShift=12-3; /**< @internalTechnology */ // sizeof(SPageTableInfo)=8
1.110 +const TInt KPtBlockSize=1<<KPtBlockShift; /**< @internalTechnology */
1.111 +const TInt KPtBlockMask=KPtBlockSize-1; /**< @internalTechnology */
1.112 +const TInt KPagesInPDEShift=KChunkShift-12;
1.113 +const TInt KPagesInPDE=1<<KPagesInPDEShift;
1.114 +const TInt KPagesInPDEMask=KPagesInPDE-1;
1.115 +
1.116 +
1.117 +const TInt KPageInfoShift = 5;
1.118 +
1.119 +#endif // __MMBOOT_H__