File tree Expand file tree Collapse file tree 2 files changed +23
-25
lines changed
tools/testing/selftests/arm64/signal/testcases Expand file tree Collapse file tree 2 files changed +23
-25
lines changed Original file line number Diff line number Diff line change 6
6
7
7
#include "testcases.h"
8
8
9
- struct _aarch64_ctx * get_header (struct _aarch64_ctx * head , uint32_t magic ,
10
- size_t resv_sz , size_t * offset )
11
- {
12
- size_t offs = 0 ;
13
- struct _aarch64_ctx * found = NULL ;
14
-
15
- if (!head || resv_sz < HDR_SZ )
16
- return found ;
17
-
18
- while (offs <= resv_sz - HDR_SZ &&
19
- head -> magic != magic && head -> magic ) {
20
- offs += head -> size ;
21
- head = GET_RESV_NEXT_HEAD (head );
22
- }
23
- if (head -> magic == magic ) {
24
- found = head ;
25
- if (offset )
26
- * offset = offs ;
27
- }
28
-
29
- return found ;
30
- }
31
-
32
9
bool validate_extra_context (struct extra_context * extra , char * * err ,
33
10
void * * extra_data , size_t * extra_size )
34
11
{
Original file line number Diff line number Diff line change @@ -88,8 +88,29 @@ struct fake_sigframe {
88
88
89
89
bool validate_reserved (ucontext_t * uc , size_t resv_sz , char * * err );
90
90
91
- struct _aarch64_ctx * get_header (struct _aarch64_ctx * head , uint32_t magic ,
92
- size_t resv_sz , size_t * offset );
91
+ static inline struct _aarch64_ctx * get_header (struct _aarch64_ctx * head , uint32_t magic ,
92
+ size_t resv_sz , size_t * offset )
93
+ {
94
+ size_t offs = 0 ;
95
+ struct _aarch64_ctx * found = NULL ;
96
+
97
+ if (!head || resv_sz < HDR_SZ )
98
+ return found ;
99
+
100
+ while (offs <= resv_sz - HDR_SZ &&
101
+ head -> magic != magic && head -> magic ) {
102
+ offs += head -> size ;
103
+ head = GET_RESV_NEXT_HEAD (head );
104
+ }
105
+ if (head -> magic == magic ) {
106
+ found = head ;
107
+ if (offset )
108
+ * offset = offs ;
109
+ }
110
+
111
+ return found ;
112
+ }
113
+
93
114
94
115
static inline struct _aarch64_ctx * get_terminator (struct _aarch64_ctx * head ,
95
116
size_t resv_sz ,
You can’t perform that action at this time.
0 commit comments