1 // Copyright (c) 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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #if 0 // not needed for Symbian^3
25 A class that exports ASSP register access functionality to
26 device drivers and other kernel-side code.
28 Although Symbian OS defines this class, it does not implement all
29 the functions within it. An implementation for each of the register
30 modification functions defined by this class must be provided by
38 Return the contents of an 8-bit register.
40 @param aAddr The address of the register to be read.
41 @return The contents of the register.
42 @pre Can be called in any context.
44 static inline TUint8 Read8(TLinAddr aAddr)
45 { return *(volatile TUint8*)aAddr; }
48 Store a new value in an 8-bit register. This will change
49 the entire contents of the register concerned.
51 @param aAddr The address of the register to be written.
52 @param aValue The new value to be written to the register.
53 @pre Can be called in any context.
55 static inline void Write8(TLinAddr aAddr, TUint8 aValue)
56 { *(volatile TUint8*)aAddr = aValue; }
59 Modify the contents of an 8-bit register.
61 @param aAddr The address of the register to be modified.
62 @param aClearMask A mask of the bits to be cleared in the register.
63 @param aSetMask A mask of the bits to be set in the register after the clear.
64 @pre Can be called in any context.
66 IMPORT_C static void Modify8(TLinAddr aAddr, TUint8 aClearMask, TUint8 aSetMask);
69 Return the contents of an 16-bit register.
71 @param aAddr The address of the register to be read.
72 @return The contents of the register.
73 @pre Can be called in any context.
75 static inline TUint16 Read16(TLinAddr aAddr)
76 { return *(volatile TUint16*)aAddr; }
79 Store a new value in a 16-bit register. This will change
80 the entire contents of the register concerned.
82 @param aAddr The address of the register to be written.
83 @param aValue The new value to be written to the register.
84 @pre Can be called in any context.
86 static inline void Write16(TLinAddr aAddr, TUint16 aValue)
87 { *(volatile TUint16*)aAddr = aValue; }
90 Modify the contents of a 16-bit register.
92 @param aAddr The address of the register to be modified.
93 @param aClearMask A mask of the bits to be cleared in the register.
94 @param aSetMask A mask of the bits to be set in the register after the clear.
95 @pre Can be called in any context.
97 IMPORT_C static void Modify16(TLinAddr aAddr, TUint16 aClearMask, TUint16 aSetMask);
100 Return the contents of a 32-bit register.
102 @param aAddr The address of the register to be read.
103 @return The contents of the register.
104 @pre Can be called in any context.
106 static inline TUint32 Read32(TLinAddr aAddr)
107 { return *(volatile TUint32*)aAddr; }
110 Store a new value in a 32-bit register. This will change
111 the entire contents of the register concerned.
113 @param aAddr The address of the register to be written.
114 @param aValue The new value to be written to the register.
115 @pre Can be called in any context.
117 static inline void Write32(TLinAddr aAddr, TUint32 aValue)
118 { *(volatile TUint32*)aAddr = aValue; }
121 Modify the contents of a 32-bit register.
123 @param aAddr The address of the register to be modified.
124 @param aClearMask A mask of the bits to be cleared in the register.
125 @param aSetMask A mask of the bits to be set in the register after the clear.
126 @pre Can be called in any context.
128 IMPORT_C static void Modify32(TLinAddr aAddr, TUint32 aClearMask, TUint32 aSetMask);
131 Return the contents of a 64-bit register.
133 @param aAddr The address of the register to be read.
134 @return The contents of the register.
135 @pre Can be called in any context.
137 IMPORT_C static TUint64 Read64(TLinAddr aAddr);
140 Store a new value in a 64-bit register. This will change
141 the entire contents of the register concerned.
143 @param aAddr The address of the register to be written.
144 @param aValue The new value to be written to the register.
145 @pre Can be called in any context.
147 IMPORT_C static void Write64(TLinAddr aAddr, TUint64 aValue);
150 Modify the contents of a 64-bit register.
152 @param aAddr The address of the register to be modified.
153 @param aClearMask A mask of the bits to be cleared in the register.
154 @param aSetMask A mask of the bits to be set in the register after the clear.
155 @pre Can be called in any context.
157 IMPORT_C static void Modify64(TLinAddr aAddr, TUint64 aClearMask, TUint64 aSetMask);