Author: tkreuzer
Date: Tue Mar 10 09:10:00 2015
New Revision: 66654
URL:
http://svn.reactos.org/svn/reactos?rev=66654&view=rev
Log:
[SAL]
- kernelspecs.h: Add IRQL level defines, remove a duplicate annotation and make some
definitions more consistent
- concurrencysal.h: Add missing annotations (only dummies so far)
- driverspecs.h: Add some missing annotations
- sal_old.h: remove __inner_callback, which is in sal.h
Modified:
trunk/reactos/include/ddk/kernelspecs.h
trunk/reactos/include/psdk/concurrencysal.h
trunk/reactos/include/psdk/driverspecs.h
trunk/reactos/include/psdk/sal_old.h
Modified: trunk/reactos/include/ddk/kernelspecs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/kernelspecs.h?…
==============================================================================
--- trunk/reactos/include/ddk/kernelspecs.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/kernelspecs.h [iso-8859-1] Tue Mar 10 09:10:00 2015
@@ -26,6 +26,20 @@
#include "driverspecs.h"
#ifdef _PREFAST_
+
+/* Make sure we have IRQL level definitions early */
+#define DISPATCH_LEVEL 2
+#define APC_LEVEL 1
+#define PASSIVE_LEVEL 0
+#if defined(_X86_)
+#define HIGH_LEVEL 31
+#elif defined(_AMD64_)
+#define HIGH_LEVEL 15
+#elif defined(_ARM_)
+#define HIGH_LEVEL 15
+#elif defined(_IA64_)
+#define HIGH_LEVEL 15
+#endif
#undef _IRQL_always_function_max_
#undef _IRQL_always_function_min_
@@ -68,18 +82,18 @@
#define _IRQL_saves_global_(kind,param) _Post_ _SA_annotes2(SAL_saveIRQLGlobal,#kind,
param\t)
#define _IRQL_uses_cancel_ _Post_ _SA_annotes0(SAL_UseCancelIrql)
#define _IRQL_is_cancel_ _IRQL_uses_cancel_
_Releases_nonreentrant_lock_(_Global_cancel_spin_lock_) \
- _At_(return, _IRQL_always_function_min_(2
/*DISPATCH_LEVEL*/) _IRQL_requires_(2 /*DISPATCH_LEVEL*/))
+ _At_(return,
_IRQL_always_function_min_(DISPATCH_LEVEL) _IRQL_requires_(DISPATCH_LEVEL))
#define __drv_setsIRQL(irql) _Post_ _SA_annotes1(SAL_IRQL,irql)
-#define __drv_raisesIRQL _IRQL_raises_
-#define __drv_requiresIRQL _IRQL_requires_
-#define __drv_maxIRQL _IRQL_requires_max_
-#define __drv_minIRQL _IRQL_requires_min_
+#define __drv_raisesIRQL(irql) _IRQL_raises_(irql)
+#define __drv_requiresIRQL(irql) _IRQL_requires_(irql)
+#define __drv_maxIRQL(irql) _IRQL_requires_max_(irql)
+#define __drv_minIRQL(irql) _IRQL_requires_min_(irql)
#define __drv_savesIRQL _IRQL_saves_
-#define __drv_savesIRQLGlobal _IRQL_saves_global_
+#define __drv_savesIRQLGlobal(kind,param) _IRQL_saves_global_(kind,param)
#define __drv_restoresIRQL _IRQL_restores_
-#define __drv_restoresIRQLGlobal _IRQL_restores_global_
-#define __drv_minFunctionIRQL _IRQL_always_function_min_
-#define __drv_maxFunctionIRQL _IRQL_always_function_max_
+#define __drv_restoresIRQLGlobal(kind,param) _IRQL_restores_global_(kind,param)
+#define __drv_minFunctionIRQL(irql) _IRQL_always_function_min_(irql)
+#define __drv_maxFunctionIRQL(irql) _IRQL_always_function_max_(irql)
#define __drv_sameIRQL _IRQL_requires_same_
#define __drv_useCancelIRQL _IRQL_uses_cancel_
#define __drv_isCancelIRQL _IRQL_is_cancel_
@@ -90,7 +104,6 @@
__ANNOTATION(SAL_IRQL(__int64);)
__ANNOTATION(SAL_raiseIRQL(__int64);)
-__ANNOTATION(SAL_IRQL(__int64);)
__ANNOTATION(SAL_maxIRQL(__int64);)
__ANNOTATION(SAL_minIRQL(__int64);)
__ANNOTATION(SAL_saveIRQL(void);)
Modified: trunk/reactos/include/psdk/concurrencysal.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/concurrencysa…
==============================================================================
--- trunk/reactos/include/psdk/concurrencysal.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/concurrencysal.h [iso-8859-1] Tue Mar 10 09:10:00 2015
@@ -20,13 +20,98 @@
*
*/
+#if defined(_PREFAST_)
+
+#define _Benign_race_begin_ __pragma(warning(push)) __pragma(warning(disable:26100 26101
26150 26130 26180 26131 26181 28112))
+#define _Benign_race_end_ __pragma(warning(pop))
+#define _No_competing_thread_begin_ __pragma(warning(push))
__pragma(warning(disable:26100 26101 26150 26101 26151 26110 26160 26130 26180 26131 26181
28112))
+#define _No_competing_thread_end_ __pragma(warning(pop))
+
+#define _Acquires_exclusive_lock_(lock)
+#define _Acquires_lock_(lock)
+#define _Acquires_nonreentrant_lock_(lock)
+#define _Acquires_shared_lock_(lock)
+#define _Analysis_assume_lock_acquired_(lock)
+#define _Analysis_assume_lock_released_(lock)
+#define _Analysis_assume_lock_held_(lock)
+#define _Analysis_assume_lock_not_held_(lock)
+#define _Analysis_assume_same_lock_(lock1, lock2)
+#define _Analysis_suppress_lock_checking_(lock)
+#define _Create_lock_level_(level)
+#define _Csalcat1_(x,y)
+#define _Csalcat2_(x,y)
+#define _Function_ignore_lock_checking_(lock)
+#define _Guarded_by_(lock)
+#define _Has_lock_kind_(kind)
+#define _Has_lock_level_(level)
+#define _Interlocked_
+#define _Internal_lock_level_order_(a,b)
+#define _Lock_level_order_(a,b)
+#define _No_competing_thread_
+#define _Post_same_lock_(lock1,lock2)
+#define _Releases_exclusive_lock_(lock)
+#define _Releases_lock_(lock)
+#define _Releases_nonreentrant_lock_(lock)
+#define _Releases_shared_lock_(lock)
+#define _Requires_exclusive_lock_held_(lock)
+#define _Requires_shared_lock_held_(lock)
+#define _Requires_lock_held_(lock)
+#define _Requires_lock_not_held_(lock)
+#define _Requires_no_locks_held_
+#define _Write_guarded_by_(lock)
+const char _Lock_kind_mutex_[] = "";
+const char _Lock_kind_event_[] = "";
+const char _Lock_kind_semaphore_[] = "";
+const char _Lock_kind_spin_lock_[] = "";
+const char _Lock_kind_critical_section_[] = "";
+
+#else /* _PREFAST_ */
+
+#define _Benign_race_begin_ __pragma(warning(push))
+#define _Benign_race_end_ __pragma(warning(pop))
+#define _No_competing_thread_begin_ __pragma(warning(push))
+#define _No_competing_thread_end_ __pragma(warning(pop))
+
+#define _Acquires_exclusive_lock_(lock)
+#define _Acquires_lock_(lock)
+#define _Acquires_nonreentrant_lock_(lock)
+#define _Acquires_shared_lock_(lock)
+#define _Analysis_assume_lock_acquired_(lock)
+#define _Analysis_assume_lock_released_(lock)
+#define _Analysis_assume_lock_held_(lock)
+#define _Analysis_assume_lock_not_held_(lock)
+#define _Analysis_assume_same_lock_(lock1, lock2)
+#define _Analysis_suppress_lock_checking_(lock)
+#define _Create_lock_level_(level)
+#define _Csalcat1_(x,y)
+#define _Csalcat2_(x,y)
+#define _Function_ignore_lock_checking_(lock)
+#define _Guarded_by_(lock)
+#define _Has_lock_kind_(kind)
+#define _Has_lock_level_(level)
+#define _Interlocked_
+#define _Internal_lock_level_order_(a,b)
+#define _Lock_level_order_(a,b)
+#define _No_competing_thread_
+#define _Post_same_lock_(lock1,lock2)
+#define _Releases_exclusive_lock_(lock)
+#define _Releases_lock_(lock)
+#define _Releases_nonreentrant_lock_(lock)
+#define _Releases_shared_lock_(lock)
+#define _Requires_exclusive_lock_held_(lock)
+#define _Requires_shared_lock_held_(lock)
#define _Requires_lock_held_(lock)
#define _Requires_lock_not_held_(lock)
-#define _Acquires_lock_(lock)
-#define _Acquires_shared_lock_(lock)
-#define _Acquires_exclusive_lock_(lock)
-#define _Releases_lock_(lock)
-#define _Post_same_lock_(lock1,lock2)
+#define _Requires_no_locks_held_
+#define _Write_guarded_by_(lock)
+#endif /* _PREFAST_ */
+
+#if 0 /* Check these */
+#define _Internal_set_lock_count_(lock, count)
+#define _Internal_set_lock_count_to_zero_(lock)
+#define _Internal_set_lock_count_to_one_(lock)
+#endif // 0
+
Modified: trunk/reactos/include/psdk/driverspecs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/driverspecs.h…
==============================================================================
--- trunk/reactos/include/psdk/driverspecs.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/driverspecs.h [iso-8859-1] Tue Mar 10 09:10:00 2015
@@ -13,6 +13,7 @@
#include <specstrings.h>
#endif
+//#include "sdv_driverspecs.h"
#include <concurrencysal.h>
#ifdef _PREFAST_
@@ -34,7 +35,7 @@
#define _IRQL_uses_cancel_
#define __drv_setsIRQL(irql)
-#define _Dispatch_type_ _Function_class_
+#define _Dispatch_type_(x) _Function_class_(x)
#define _Kernel_clear_do_init_(yesNo) _Post_
_SA_annotes1(SAL_clearDoInit,yesNo)
#define _Kernel_float_restored_ _Post_
_SA_annotes0(SAL_floatRestored)
#define _Kernel_float_saved_ _Post_ _SA_annotes0(SAL_floatSaved)
@@ -44,7 +45,7 @@
#define _Kernel_requires_resource_held_(kind) _Pre_ _SA_annotes1(SAL_mustHold,
#kind)
#define _Kernel_requires_resource_not_held_(kind) _Pre_ _SA_annotes1(SAL_neverHold,
#kind)
#define _Kernel_acquires_resource_(kind) _Post_ _SA_annotes1(SAL_acquire,
#kind)
-
+#define _Landmark_(name)
#define __drv_acquiresCancelSpinLock
_Acquires_nonreentrant_lock_(_Global_cancel_spin_lock_)
#define __drv_acquiresCriticalRegion
_Acquires_lock_(_Global_critical_region_)
#define __drv_acquiresExclusiveResource(kind) _Acquires_nonreentrant_lock_(_Curr_)
@@ -70,7 +71,7 @@
#define __drv_formatString(kind) _SA_annotes1(SAL_IsFormatString,
#kind)
#define __drv_freesMem(kind) _Post_
_SA_annotes1(SAL_NeedsRelease,__no)
#define __drv_fun(annotes) _At_(return, annotes)
-#define __drv_functionClass _Function_class_
+#define __drv_functionClass(x) _Function_class_(x)
#define __drv_holdsCancelSpinLock()
_Holds_resource_global_("CancelSpinLock",)
#define __drv_holdsCriticalRegion()
_Holds_resource_global_("CriticalRegion",)
#define __drv_holdsPriorityRegion()
_Holds_resource_global_("PriorityRegion",)
@@ -81,6 +82,7 @@
#define __drv_innerNeverHoldGlobal(kind,param)
#define __drv_innerReleasesGlobal(kind,param)
#define __drv_interlocked
+#define __drv_inTry
#define __drv_IoGetDmaAdapter
#define __drv_isCancelIRQL _IRQL_is_cancel_
#define __drv_isObjectPointer
@@ -118,7 +120,7 @@
#define __drv_reportError(why)
#define __drv_requiresIRQL(irql)
#define __drv_restoresIRQL
-#define __drv_restoresIRQLGlobal
+#define __drv_restoresIRQLGlobal(kind,param)
#define __drv_ret(annotes)
#define __drv_sameIRQL
#define __drv_savesIRQL
@@ -143,8 +145,19 @@
#define ___drv_unit_user_code
#define ___drv_unit_user_driver
+#define __drv_typeConst 0
+#define __drv_typeCond 1
+#define __drv_typeBitset 2
+#define __drv_typeExpr 3
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
__ANNOTATION(SAL_neverHold(_In_ char *);)
+__ANNOTATION(SAL_neverHoldGlobal(__In_impl_ char *, ...);)
__ANNOTATION(SAL_acquire(_In_ char *);)
+__ANNOTATION(SAL_acquireGlobal(__In_impl_ char *, ...);)
__ANNOTATION(SAL_floatUsed(void);)
__ANNOTATION(SAL_floatSaved(void);)
__ANNOTATION(SAL_floatRestored(void);)
@@ -153,8 +166,34 @@
__ANNOTATION(SAL_IsAliased(void);)
__ANNOTATION(SAL_NeedsRelease(enum __SAL_YesNo);)
__ANNOTATION(SAL_mustHold(_In_ char *);)
+__ANNOTATION(SAL_mustHoldGlobal(__In_impl_ char *, ...);)
__ANNOTATION(SAL_release(_In_ char *);)
+__ANNOTATION(SAL_releaseGlobal(__In_impl_ char *, ...);)
__ANNOTATION(SAL_IoGetDmaAdapter(void);)
+__ANNOTATION(SAL_kernel();)
+__ANNOTATION(SAL_nokernel();)
+__ANNOTATION(SAL_driver();)
+__ANNOTATION(SAL_nodriver();)
+__ANNOTATION(SAL_internal_kernel_driver();)
+__ANNOTATION(SAL_landmark(__In_impl_ char *);)
+__ANNOTATION(SAL_return(__In_impl_ __AuToQuOtE char *);)
+__ANNOTATION(SAL_strictType(__In_impl_ __AuToQuOtE char *);)
+__ANNOTATION(SAL_strictTypeMatch(__int64);)
+__ANNOTATION(SAL_preferredFunction(__In_impl_ __AuToQuOtE char *, __In_impl_ __AuToQuOtE
char *);)
+__ANNOTATION(SAL_preferredFunction3(__In_impl_ __AuToQuOtE char *, __In_impl_ __AuToQuOtE
char *, __In_impl_ __int64);)
+__ANNOTATION(SAL_error(__In_impl_ __AuToQuOtE char *);)
+__ANNOTATION(SAL_error2(__In_impl_ __AuToQuOtE char *, __In_impl_ __int64);)
+__ANNOTATION(SAL_IsFormatString(__In_impl_ char *);)
+__ANNOTATION(SAL_completionType(__In_impl_ __AuToQuOtE char *);)
+__ANNOTATION(SAL_callbackType(__In_impl_ __AuToQuOtE char *);)
+//__PRIMOP(int, _Holds_resource_(__In_impl_ __deferTypecheck char *,__In_impl_ char *);)
+//__PRIMOP(int, _Holds_resource_global_(__In_impl_ char *, ...);)
+//__PRIMOP(int, _Is_kernel_(void);)
+//__PRIMOP(int, _Is_driver_(void);)
+
+#ifdef __cplusplus
+}
+#endif
#else
@@ -182,6 +221,7 @@
#define _Kernel_requires_resource_held_(kind)
#define _Kernel_requires_resource_not_held_(kind)
#define _Kernel_acquires_resource_(kind)
+#define _Landmark_(name)
#define __drv_acquiresCancelSpinLock
#define __drv_acquiresCriticalRegion
#define __drv_acquiresExclusiveResource(kind)
@@ -218,6 +258,7 @@
#define __drv_innerNeverHoldGlobal(kind,param)
#define __drv_innerReleasesGlobal(kind,param)
#define __drv_interlocked
+#define __drv_inTry
#define __drv_IoGetDmaAdapter
#define __drv_isCancelIRQL
#define __drv_isObjectPointer
@@ -255,7 +296,7 @@
#define __drv_reportError(why)
#define __drv_requiresIRQL(irql)
#define __drv_restoresIRQL
-#define __drv_restoresIRQLGlobal
+#define __drv_restoresIRQLGlobal(kind,param)
#define __drv_ret(annotes)
#define __drv_sameIRQL
#define __drv_savesIRQL
Modified: trunk/reactos/include/psdk/sal_old.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/sal_old.h?rev…
==============================================================================
--- trunk/reactos/include/psdk/sal_old.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/sal_old.h [iso-8859-1] Tue Mar 10 09:10:00 2015
@@ -45,7 +45,6 @@
#define __exceptthat __declspec("SAL_except")
#define __execeptthat __exceptthat
#define __inner_blocksOn(resource)
__declspec("SAL_blocksOn("SPECSTRINGIZE(resource)")")
-#define __inner_callback __declspec("__callback")
#define __inner_checkReturn __declspec("SAL_checkReturn")
#define __inner_control_entrypoint(category)
__declspec("SAL_entrypoint(controlEntry, "SPECSTRINGIZE(category)")")
#define __inner_data_entrypoint(category) __declspec("SAL_entrypoint(dataEntry,
"SPECSTRINGIZE(category)")")
@@ -80,7 +79,6 @@
#define __exceptthat
#define __execeptthat
#define __inner_blocksOn(resource)
-#define __inner_callback
#define __inner_checkReturn
#define __inner_control_entrypoint(category)
#define __inner_data_entrypoint(category)