The ndis_kspin_lock type is called KSPIN_LOCK in MS-Windows.

According to the Windows DDK header files, KSPIN_LOCK is defined like this:
	typedef ULONG_PTR KSPIN_LOCK;

From basetsd.h (SDK, Feb. 2003):
	typedef [public] unsigned __int3264 ULONG_PTR, *PULONG_PTR;
	typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;
	typedef _W64 unsigned long ULONG_PTR, *PULONG_PTR;

The keyword __int3264 specifies an integral type that has the following
properties:
 + It is 32-bit on 32-bit platforms
 + It is 64-bit on 64-bit platforms
 + It is 32-bit on the wire for backward compatibility.
   It gets truncated on the sending side and extended appropriately
   (signed or unsigned) on the receiving side.

Thus register_t seems the proper mapping onto FreeBSD for spin locks.
This commit is contained in:
obrien 2004-01-16 02:07:04 +00:00
parent 37e1e5e54c
commit 1432ab7b7e
2 changed files with 23 additions and 2 deletions

View File

@ -46,7 +46,7 @@ typedef uint32_t ndis_status;
typedef void *ndis_handle;
typedef uint32_t ndis_oid;
typedef uint32_t ndis_error_code;
typedef uint32_t ndis_kspin_lock;
typedef register_t ndis_kspin_lock;
typedef uint8_t ndis_kirql;
/*

View File

@ -55,7 +55,28 @@
#define MDL_VA(b) \
((void *)((char *)((b)->nb_startva) + (b)->nb_byteoffset))
typedef uint32_t kspin_lock;
/*-
* The ndis_kspin_lock type is called KSPIN_LOCK in MS-Windows.
* According to the Windows DDK header files, KSPIN_LOCK is defined like this:
* typedef ULONG_PTR KSPIN_LOCK;
*
* From basetsd.h (SDK, Feb. 2003):
* typedef [public] unsigned __int3264 ULONG_PTR, *PULONG_PTR;
* typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;
* typedef _W64 unsigned long ULONG_PTR, *PULONG_PTR;
*
* The keyword __int3264 specifies an integral type that has the following
* properties:
* + It is 32-bit on 32-bit platforms
* + It is 64-bit on 64-bit platforms
* + It is 32-bit on the wire for backward compatibility.
* It gets truncated on the sending side and extended appropriately
* (signed or unsigned) on the receiving side.
*
* Thus register_t seems the proper mapping onto FreeBSD for spin locks.
*/
typedef register_t kspin_lock;
struct slist_entry {
struct slist_entry *sl_next;