File tree Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,24 @@ static int thread_stack__grow(struct thread_stack *ts)
93
93
return 0 ;
94
94
}
95
95
96
+ static int thread_stack__init (struct thread_stack * ts , struct thread * thread ,
97
+ struct call_return_processor * crp )
98
+ {
99
+ int err ;
100
+
101
+ err = thread_stack__grow (ts );
102
+ if (err )
103
+ return err ;
104
+
105
+ if (thread -> mg && thread -> mg -> machine )
106
+ ts -> kernel_start = machine__kernel_start (thread -> mg -> machine );
107
+ else
108
+ ts -> kernel_start = 1ULL << 63 ;
109
+ ts -> crp = crp ;
110
+
111
+ return 0 ;
112
+ }
113
+
96
114
static struct thread_stack * thread_stack__new (struct thread * thread ,
97
115
struct call_return_processor * crp )
98
116
{
@@ -104,17 +122,11 @@ static struct thread_stack *thread_stack__new(struct thread *thread,
104
122
105
123
ts -> arr_sz = 1 ;
106
124
107
- if (thread_stack__grow (ts )) {
125
+ if (thread_stack__init (ts , thread , crp )) {
108
126
free (ts );
109
127
return NULL ;
110
128
}
111
129
112
- if (thread -> mg && thread -> mg -> machine )
113
- ts -> kernel_start = machine__kernel_start (thread -> mg -> machine );
114
- else
115
- ts -> kernel_start = 1ULL << 63 ;
116
- ts -> crp = crp ;
117
-
118
130
thread -> ts = ts ;
119
131
120
132
return ts ;
You can’t perform that action at this time.
0 commit comments