kernel/eka/kernel/sinit.cpp
branchRCL_3
changeset 19 4a8fed1c0ef6
parent 0 a41df078684a
child 39 2bb754abd467
equal deleted inserted replaced
15:2d65c2f76d7b 19:4a8fed1c0ef6
    19 #include <e32uid.h>
    19 #include <e32uid.h>
    20 #include <collate.h>
    20 #include <collate.h>
    21 #include <kernel/emi.h>
    21 #include <kernel/emi.h>
    22 #include <kernel/sshbuf.h>
    22 #include <kernel/sshbuf.h>
    23 #include "platform.h"
    23 #include "platform.h"
       
    24 #include "securerng.h"
    24 
    25 
    25 #ifdef __VC32__
    26 #ifdef __VC32__
    26     #pragma setlocale("english")
    27     #pragma setlocale("english")
    27 #endif
    28 #endif
    28 
    29 
    44 const TInt KDfcThread1Priority=48;
    45 const TInt KDfcThread1Priority=48;
    45 const TInt KMaxEventQueue=40;
    46 const TInt KMaxEventQueue=40;
    46 
    47 
    47 TInt SupervisorThread(TAny*);
    48 TInt SupervisorThread(TAny*);
    48 TInt DebuggerInit();
    49 TInt DebuggerInit();
       
    50 extern TInt InitialiseEntropyBuffers();
    49 
    51 
    50 extern const SNThreadHandlers EpocThreadHandlers;
    52 extern const SNThreadHandlers EpocThreadHandlers;
    51 
    53 
    52 /**
    54 /**
    53 Returns information about how the system started
    55 Returns information about how the system started
   390 	TInt r=K::Init3();
   392 	TInt r=K::Init3();
   391 	if (r!=KErrNone)
   393 	if (r!=KErrNone)
   392 		K::Fault(K::EInit3Failed);
   394 		K::Fault(K::EInit3Failed);
   393 
   395 
   394 	P::StartExtensions();
   396 	P::StartExtensions();
       
   397 	M::Init4();
   395 	K::StartKernelServer();
   398 	K::StartKernelServer();
   396 	return 0;
   399 	return 0;
   397 	}
   400 	}
   398 
   401 
   399 TInt K::Init3()
   402 TInt K::Init3()
   439 	NTimerQ::Init3(K::DfcQ1);
   442 	NTimerQ::Init3(K::DfcQ1);
   440 
   443 
   441 	// Start the system tick timer
   444 	// Start the system tick timer
   442 	r=K::StartTickQueue();
   445 	r=K::StartTickQueue();
   443 	if (r!=KErrNone)
   446 	if (r!=KErrNone)
       
   447 		return r;
       
   448 	
       
   449 	// Initilize the Secure RNG.
       
   450 	SecureRNG = new DSecureRNG;
       
   451 	
       
   452 	// Initialise entropy buffers for secure RNG
       
   453 	r=InitialiseEntropyBuffers();
       
   454     if (r!=KErrNone)
   444 		return r;
   455 		return r;
   445 
   456 
   446 	// Third phase initialisation of ASIC/Variant
   457 	// Third phase initialisation of ASIC/Variant
   447 	// This enables the system tick and millisecond timer
   458 	// This enables the system tick and millisecond timer
   448 	A::Init3();
   459 	A::Init3();
   449 
   460 
   450 	// Mark the super page signature valid
   461 	// Mark the super page signature valid
   451 	P::SetSuperPageSignature();
   462 	P::SetSuperPageSignature();
   452 
       
   453 	// Initialise the random pool
       
   454 	K::Randomize();
       
   455 
   463 
   456 	return KErrNone;
   464 	return KErrNone;
   457 	}
   465 	}
   458 
   466 
   459 extern "C" void KernelMain()
   467 extern "C" void KernelMain()