Skip to content

Commit 93ba088

Browse files
committed
[NDK] Introduce function attributes for section placement
Increase code readability by using the function attributes instead of a plain DECLSPEC_NOINLINE
1 parent c8e4a72 commit 93ba088

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

sdk/include/ndk/section_attribs.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,20 @@ Header Name:
3333
#error Invalid compiler!
3434

3535
#endif
36+
37+
/*
38+
* This attribute should be applied to a function that
39+
* called from pageable code and raises the IRQL at DISPATCH_LEVEL or higher,
40+
* and restores the IRQL before it returns. We must make sure that function is not inlined.
41+
*/
42+
#define DECLSPEC_NOINLINE_FROM_PAGED DECLSPEC_NOINLINE
43+
44+
/*
45+
* This attribute should be applied to a function that
46+
* called from non-pageable code at IRQL lower than DISPATCH_LEVEL.
47+
* We should make sure that function is not inlined. Some compilers (GCC)
48+
* can do inlining even if the function is in another section.
49+
* See the discussion https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31362
50+
* for more details.
51+
*/
52+
#define DECLSPEC_NOINLINE_FROM_NOT_PAGED DECLSPEC_NOINLINE

0 commit comments

Comments
 (0)