os/kernelhwsrv/kernel/eka/include/memmodel/epoc/flexible/x86/mmboot.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @publishedPartner
sl@0
    19
 @prototype
sl@0
    20
*/
sl@0
    21
sl@0
    22
#ifndef __MMBOOT_H__
sl@0
    23
#define __MMBOOT_H__
sl@0
    24
sl@0
    25
// Linear address map
sl@0
    26
// 00000000-003FFFFF	Unmapped
sl@0
    27
// 00400000-7FFFFFFF	Local data
sl@0
    28
// 80000000-			ROM
sl@0
    29
//         -8FFFFFFF	Global user area
sl@0
    30
// 90000000-EFFFFFFF	Kernel memory
sl@0
    31
// F0000000-FEBFFFFF	Fixed kernel mappings
sl@0
    32
// FEC00000-FEFFFFFF	IO APIC + Local APIC
sl@0
    33
// FF000000-FFFFFFFF	???
sl@0
    34
sl@0
    35
// Linear addresses
sl@0
    36
sl@0
    37
const TLinAddr KUserLocalDataBase		=0x00400000u;
sl@0
    38
sl@0
    39
const TLinAddr KUserLocalDataEnd		=0x80000000u;
sl@0
    40
sl@0
    41
/** Everything above here is global (visible to all processes).*/
sl@0
    42
const TLinAddr KGlobalMemoryBase		=0x80000000u;
sl@0
    43
sl@0
    44
const TLinAddr KRomLinearBase			=0x80000000u;
sl@0
    45
sl@0
    46
/** Everything below here has user access permissions, everything above is supervisor only. */
sl@0
    47
const TLinAddr KUserMemoryLimit			=0x90000000u;
sl@0
    48
sl@0
    49
const TLinAddr KKernelSectionBase		=0x90000000u;
sl@0
    50
sl@0
    51
const TLinAddr KPrimaryIOBase			=0xC6000000u; // XXX This magic constant is hard coded into baseports!
sl@0
    52
const TLinAddr KPrimaryIOEnd			=0xC8000000u;
sl@0
    53
sl@0
    54
const TLinAddr KKernelDataBase			=0xC8000000u;
sl@0
    55
sl@0
    56
const TLinAddr KKernelSectionEnd		=0xF0000000u;
sl@0
    57
sl@0
    58
const TLinAddr KSuperPageLinAddr		=0xF0000000u;
sl@0
    59
const TLinAddr KMachineConfigLinAddr	=0xF0000800u;
sl@0
    60
sl@0
    61
const TLinAddr KPageInfoMap				=0xF0010000u;
sl@0
    62
const TLinAddr KApTrampolinePageLin		=0xF0040000u;
sl@0
    63
const TLinAddr KTempAddr				=0xF0080000u;
sl@0
    64
const TLinAddr KTempAddrEnd				=0xF0100000u;
sl@0
    65
const TLinAddr KBiosInfoLin				=0xF0100000u;	// RAM info + MP info
sl@0
    66
sl@0
    67
const TLinAddr KPageTableInfoBase		=0xF0C00000u;
sl@0
    68
const TLinAddr KPageTableInfoEnd		=0xF1000000u;
sl@0
    69
sl@0
    70
const TLinAddr KPageArraySegmentBase	=0xF1000000u;
sl@0
    71
const TLinAddr KPageArraySegmentEnd		=0xF2000000u;
sl@0
    72
sl@0
    73
const TLinAddr KPageInfoLinearBase		=0xF2000000u;
sl@0
    74
const TLinAddr KPageInfoLinearEnd		=0xF4000000u;
sl@0
    75
sl@0
    76
const TLinAddr KPageDirectoryBase		=0xF4000000u;
sl@0
    77
const TLinAddr KPageDirectoryEnd		=0xF5000000u;
sl@0
    78
sl@0
    79
const TLinAddr KIPCAlias				=0xF6000000u;
sl@0
    80
const TLinAddr KIPCAliasAreaSize		=0x02000000u;
sl@0
    81
sl@0
    82
const TLinAddr KPageTableBase			=0xF8000000u;
sl@0
    83
const TLinAddr KPageTableEnd			=0xFEC00000u;
sl@0
    84
sl@0
    85
										// FEC00000-FEFFFFFF	IO APIC + Local APIC
sl@0
    86
sl@0
    87
sl@0
    88
sl@0
    89
// Constants for X86 MMU
sl@0
    90
#ifndef __KPAGESIZE_DEFINED__
sl@0
    91
const TInt KPageShift=12;
sl@0
    92
const TInt KPageSize=1<<KPageShift;
sl@0
    93
const TInt KPageMask=KPageSize-1;
sl@0
    94
#define __KPAGESIZE_DEFINED__
sl@0
    95
#endif
sl@0
    96
const TInt KChunkShift=22;
sl@0
    97
const TInt KChunkSize=1<<KChunkShift;
sl@0
    98
const TInt KChunkMask=KChunkSize-1;
sl@0
    99
const TInt KPageTableShift=KChunkShift-KPageShift+2;	// PTE is 4 bytes
sl@0
   100
const TInt KPageTableSize=1<<KPageTableShift;
sl@0
   101
const TInt KPageTableMask=KPageTableSize-1;
sl@0
   102
const TInt KPtClusterShift=KPageShift-KPageTableShift;
sl@0
   103
const TInt KPtClusterSize=1<<KPtClusterShift;
sl@0
   104
const TInt KPtClusterMask=KPtClusterSize-1;
sl@0
   105
const TInt KPtBlockShift=KPageShift-4;					/**< @internalTechnology */	// sizeof(SPageTableInfo)=16
sl@0
   106
const TInt KPtBlockSize=1<<KPtBlockShift;				/**< @internalTechnology */
sl@0
   107
const TInt KPtBlockMask=KPtBlockSize-1;					/**< @internalTechnology */
sl@0
   108
const TInt KPagesInPDEShift=KChunkShift-KPageShift;
sl@0
   109
const TInt KPagesInPDE=1<<KPagesInPDEShift;
sl@0
   110
const TInt KPagesInPDEMask=KPagesInPDE-1;
sl@0
   111
sl@0
   112
const TInt KPageDirectoryShift=32-KChunkShift+2;		// PDE is 4 bytes
sl@0
   113
const TInt KPageDirectorySize=1<<KPageDirectoryShift;
sl@0
   114
const TInt KPageDirectoryMask=KPageDirectorySize-1;
sl@0
   115
sl@0
   116
const TInt KNumOsAsids=1024;
sl@0
   117
const TUint KKernelOsAsid=0;
sl@0
   118
sl@0
   119
const TUint32 KPdePtePresent=0x01;
sl@0
   120
const TUint32 KPdePteWrite=0x02;
sl@0
   121
const TUint32 KPdePteUser=0x04;
sl@0
   122
const TUint32 KPdePteWriteThrough=0x08;
sl@0
   123
const TUint32 KPdePteUncached=0x10;
sl@0
   124
const TUint32 KPdePteAccessed=0x20;
sl@0
   125
const TUint32 KPdePteDirty=0x40;
sl@0
   126
const TUint32 KPdeLargePage=0x80;						// Pentium and above, not 486
sl@0
   127
const TUint32 KPdePteGlobal=0x100;						// P6 and above, not 486 or Pentium
sl@0
   128
sl@0
   129
const TUint32 KPdePtePhysAddrMask=0xfffff000u;
sl@0
   130
const TUint32 KPdeLargePagePhysAddrMask=0xffc00000u;	// Pentium and above, not 486
sl@0
   131
const TUint32 KPdeUnallocatedEntry=0;
sl@0
   132
const TUint32 KPteUnallocatedEntry=0;
sl@0
   133
const TUint32 KPdeMatchMask=KPdePteAccessed|KPdePteDirty|KPdePteUser|KPdePteWrite; // ignore 'user' and 'write' in PDEs
sl@0
   134
const TUint32 KPteMatchMask=KPdePteAccessed|KPdePteDirty;
sl@0
   135
sl@0
   136
const TInt KPageInfoShift = 5;
sl@0
   137
sl@0
   138
const TInt KPageColourShift=0;
sl@0
   139
const TInt KPageColourCount=(1<<KPageColourShift);
sl@0
   140
const TInt KPageColourMask=KPageColourCount-1;
sl@0
   141
sl@0
   142
#endif	// __MMBOOT_H__