@@ -28,6 +28,9 @@ enum riscv_regset {
28
28
#ifdef CONFIG_RISCV_ISA_V
29
29
REGSET_V ,
30
30
#endif
31
+ #ifdef CONFIG_RISCV_ISA_SUPM
32
+ REGSET_TAGGED_ADDR_CTRL ,
33
+ #endif
31
34
};
32
35
33
36
static int riscv_gpr_get (struct task_struct * target ,
@@ -152,6 +155,35 @@ static int riscv_vr_set(struct task_struct *target,
152
155
}
153
156
#endif
154
157
158
+ #ifdef CONFIG_RISCV_ISA_SUPM
159
+ static int tagged_addr_ctrl_get (struct task_struct * target ,
160
+ const struct user_regset * regset ,
161
+ struct membuf to )
162
+ {
163
+ long ctrl = get_tagged_addr_ctrl (target );
164
+
165
+ if (IS_ERR_VALUE (ctrl ))
166
+ return ctrl ;
167
+
168
+ return membuf_write (& to , & ctrl , sizeof (ctrl ));
169
+ }
170
+
171
+ static int tagged_addr_ctrl_set (struct task_struct * target ,
172
+ const struct user_regset * regset ,
173
+ unsigned int pos , unsigned int count ,
174
+ const void * kbuf , const void __user * ubuf )
175
+ {
176
+ int ret ;
177
+ long ctrl ;
178
+
179
+ ret = user_regset_copyin (& pos , & count , & kbuf , & ubuf , & ctrl , 0 , -1 );
180
+ if (ret )
181
+ return ret ;
182
+
183
+ return set_tagged_addr_ctrl (target , ctrl );
184
+ }
185
+ #endif
186
+
155
187
static const struct user_regset riscv_user_regset [] = {
156
188
[REGSET_X ] = {
157
189
.core_note_type = NT_PRSTATUS ,
@@ -182,6 +214,16 @@ static const struct user_regset riscv_user_regset[] = {
182
214
.set = riscv_vr_set ,
183
215
},
184
216
#endif
217
+ #ifdef CONFIG_RISCV_ISA_SUPM
218
+ [REGSET_TAGGED_ADDR_CTRL ] = {
219
+ .core_note_type = NT_RISCV_TAGGED_ADDR_CTRL ,
220
+ .n = 1 ,
221
+ .size = sizeof (long ),
222
+ .align = sizeof (long ),
223
+ .regset_get = tagged_addr_ctrl_get ,
224
+ .set = tagged_addr_ctrl_set ,
225
+ },
226
+ #endif
185
227
};
186
228
187
229
static const struct user_regset_view riscv_user_native_view = {
0 commit comments