1 $DragonFly: src/sys/dev/netif/nv/Attic/basetype.h.patch,v 1.2 2005/04/04 18:45:07 joerg Exp $
3 --- basetype.h.orig 2005-03-12 10:59:20.000000000 +0100
4 +++ basetype.h 2005-04-02 20:29:03.000000000 +0200
20 -// Don't use as these are going to be deleted soon. Use NV_ instead
23 +** Don't use as these are going to be deleted soon. Use NV_ instead
29 typedef signed long long NV_SINT64, *PNV_SINT64;
32 - #if _MSC_VER >= 1200 // MSVC 6.0 onwards
33 + #if _MSC_VER >= 1200 /* MSVC 6.0 onwards */
34 typedef unsigned __int64 NV_UINT64, *PNV_UINT64;
35 typedef signed __int64 NV_SINT64, *PNV_SINT64;
42 -// Floating point definitions
44 -typedef float NV_REAL32; // 4-byte floating point
45 -typedef double NV_REAL64; // 8-byte floating point
47 +** Floating point definitions
49 +typedef float NV_REAL32; /* 4-byte floating point */
50 +typedef double NV_REAL64; /* 8-byte floating point */
60 #define NV_BIT(bitpos) (1 << (bitpos))
63 -// Sets the specified bit position (0..31).
64 -// Parameter bits can be 1 byte to 4 bytes, but the caller needs to make sure bitpos fits into it.
69 +** Sets the specified bit position (0..31).
70 +** Parameter bits can be 1 byte to 4 bytes, but the caller needs to make sure bitpos fits into it.
73 +** Result: x = 0xA2 */
74 #define NV_BIT_SET(bits, bitpos) ((bits) |= (NV_BIT(bitpos)))
77 -// Clears the specified bit position (0..31)
78 -// Parameter bits can be 1 byte to 4 bytes, but the caller needs to make sure bitpos fits into it.
80 -// NV_BIT_CLEAR(x, 1)
83 +** Clears the specified bit position (0..31)
84 +** Parameter bits can be 1 byte to 4 bytes, but the caller needs to make sure bitpos fits into it.
86 +** NV_BIT_CLEAR(x, 1)
87 +** Result: x = 0xA8 */
88 #define NV_BIT_CLEAR(bits, bitpos) ((bits) &= (~NV_BIT(bitpos)))
91 -// Gets the bit at the specified bit position (0..31)
92 -// Parameter bits can be 1 byte to 4 bytes, but the caller needs to make sure bitpos fits into it.
93 -// Result is either 1 or 0.
98 +** Gets the bit at the specified bit position (0..31)
99 +** Parameter bits can be 1 byte to 4 bytes, but the caller needs to make sure bitpos fits into it.
100 +** Result is either 1 or 0.
104 #define NV_BIT_GET(bits, bitpos) (((bits) >> (bitpos)) & 0x0001)
108 -// Gets the value from a 32 bit ULONG at specified bit position.
109 -// Parameter bits needs to be 4 bytes long.
110 -// Ex. ul32 = 0xFEDCBA98
111 -// ulVal = NV_BIT_GETVALUE(ul32, 3, 0) : Gets value from Bit position 3 to 0
112 -// Result : ulVal = 8
114 +** Gets the value from a 32 bit ULONG at specified bit position.
115 +** Parameter bits needs to be 4 bytes long.
116 +** Ex. ul32 = 0xFEDCBA98
117 +** ulVal = NV_BIT_GETVALUE(ul32, 3, 0) : Gets value from Bit position 3 to 0
118 +** Result : ulVal = 8 */
119 #define NV_BIT_GETVALUE(ulOrigValue, bitposHi, bitposLow) (((ulOrigValue) >> (bitposLow)) & (~(0xFFFFFFFF << ((bitposHi) - (bitposLow) +1))))
122 -// Set a value in a 32 bit ULONG at a specific bit position.
123 -// Parameter bits needs to be 4 bytes long.
124 -// Ex. ul32 = 0xFEDCBA98
125 -// NV_BIT_SETVALUE(ul32, 0xF, 3, 0) : Sets value at Bit position 3 to 0
126 -// Result : ul32 becomes 0xFEDCBA9F
128 +** Set a value in a 32 bit ULONG at a specific bit position.
129 +** Parameter bits needs to be 4 bytes long.
130 +** Ex. ul32 = 0xFEDCBA98
131 +** NV_BIT_SETVALUE(ul32, 0xF, 3, 0) : Sets value at Bit position 3 to 0
132 +** Result : ul32 becomes 0xFEDCBA9F */
133 #define NV_BIT_SETVALUE(ulOrigValue, ulWindowValue, bitposHi, bitposLow) \
134 ((ulOrigValue) = ((((ulOrigValue) & (~ ((0xFFFFFFFF >> (31 - (bitposHi))) & (0xFFFFFFFF << (bitposLow))))) | ((ulWindowValue) << (bitposLow)))))
137 typedef union _NVLARGE_INTEGER {
140 - // NO UNNAMED UNIONS ALLOWED !@
141 + /* NO UNNAMED UNIONS ALLOWED !@ */
149 -#endif // _BASETYPE_H_
150 +#endif /* _BASETYPE_H_ */