symport/e32test/misc/prbs.h
changeset 1 0a7b44b10206
child 2 806186ab5e14
equal deleted inserted replaced
0:c55016431358 1:0a7b44b10206
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // e32test\misc\prbs.h
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __PRBS_H__
       
    19 #define __PRBS_H__
       
    20 #include <e32cmn.h>
       
    21 
       
    22 LOCAL_C TUint Random(TUint* aSeed)
       
    23 	{
       
    24 	TUint x = aSeed[0];
       
    25 	TUint r3 = x >> 1;
       
    26 	r3 |= (aSeed[1] << 31);
       
    27 	aSeed[1] = x & 1;
       
    28 	r3 ^= (x << 12);
       
    29 	x = r3 ^ (r3 >> 20);
       
    30 	aSeed[0] = x;
       
    31 	return x;
       
    32 	}
       
    33 
       
    34 #endif